I'm not sure at all. here is my ideas :
- you may be able to use "cmake -D <var>:<type>=<value>" accordingly to cmake help manual. However I never used it so I don't know if it will work or not.
Doing this means I would also need to manually do the build step (calling make or any other command according to any OS and IDE..) as this won't include the SFML build in the project file generated for my library. And I would like everything to be included in this project.
- you can run cmake to generate the default makefile. then you can use sed like this :
sed -i 's/BUILD_DOC:BOOL=FALSE/BUILD_DOC:BOOL=TRUE/g' CMakeCache.txt
followed by make.
Here the issue is sed is for Unix only. What about people running CMake-gui on Windows?
- If you're writing a cmake script you should be able to have the same behavior than with cmake -D with ExternalProject_Add and its CMAKE_CACHE_ARGS argument. (I never wrote cmake script that use external project so I may be completely wrong.)
Looks like the most promising solution but.. it'll unfortunately result in the following error:
loading initial cache file /Users/ceylo/Development/sfeMovie/deps/SFML/tmp/SFML-cache.cmake
CMake Error at CMakeLists.txt:3 (include):
include could not find load file:
/Users/ceylo/Development/sfeMovie/deps/SFML/src/SFML/cmake/Macros.cmake
CMake Error at System/CMakeLists.txt:76 (sfml_add_library):
Unknown CMake command "sfml_add_library".
For some reason ${PROJECT_SOURCE_DIR} is incorrectly set to
/Users/ceylo/Development/sfeMovie/deps/SFML/src/SFML
instead of
/Users/ceylo/Development/sfeMovie/deps/SFML
For now I don't know why.