I am trying to include several third-party libraries in my source tree with minimal changes to their build system for easy updating. They all use CMake, just like me, so in my own CMakeLists.txt I can use add_subdirectory(extern/foo) for libfoo.
But foo CMakeLists.txt compiles a test harness, builds documentation, a shared library that I don't need, and so on. The authors of libfoo had the forethought to manage these parameters - for example, option(FOO_BUILD_SHARED "Build libfoo shared library" ON) , which means that I can install them through the CMake command line. But I would like to do this by default and override through the command line.
I tried to do set(FOO_BUILD_SHARED OFF) to add_subdirectory(extern/foo) . This leads to the fact that you are not trying to create a shared library during the second and subsequent assembly attempts, but not during the first one, which I really need to speed up.
Is this possible, or do I need to support forked CMakeLists.txt for these projects?
c ++ build-process build cmake
user79758 Sep 22 '10 at 6:13 2010-09-22 06:13
source share