Compile other external libraries (without CMakeLists.txt) with CMake

short - Is it possible to build an external binary / library from a project with CMake when only the makefile is specified in the binary / library file?

So, you have your own project, a bunch of CMakeLists.txt in your src-tree and this external library with source files. Your sources depend on this library, and some binaries / libraries want to link it. How to compile this external library if it has only a makefile or Visual Studio project file and no CMakeLists.txt? Is there any way to invoke configure / make from CMake? Or run batch compilation with VS under Windows? Or something else?

Thanks for the help with this ...

+3
source share
1 answer

It looks like you need an external CMake project. I worked with him quite extensively in developing the Titan build system and provides a way to manage several of the original builds. You can enable ExternalProject, and then something like the following will build the project:

ExternalProject_Add (Qt
   DOWNLOAD_DIR $ {CMAKE_CURRENT_BINARY_DIR}
   URL $ {qt_file}
   UPDATE_COMMAND ""
   SOURCE_DIR $ {qt_source}
   BUILD_IN_SOURCE 1
   CONFIGURE_COMMAND $ {qt_configure}
   BUILD_COMMAND $ {qt_build}
   INSTALL_COMMAND "$ {qt_install}"
   )

2009 . , make, -, Qt, configure Windows, Mac Linux.

+16

Source: https://habr.com/ru/post/1759803/


All Articles