I'm building DCMTK using the command line, using the following command:
cmake -DBUILD_APPS=BOOL:OFF ../latest_dcmtk
I want to move the BUILD_APPS setting from the command line into the top-level CMakeLists.txt configuration file. No matter how I attempt set the BUILD_APPS option in the top level configuration file, I never get the correct behavior unless I explicitly set the BUILD_APPS option from the command line.
Is there a way to explicitly set command line options from the top-level CMakeLists.txt file?
I've borrowed this from the DCMTK sources & it doesn't work:
SET (BUILD_APPS OFF CACHE BOOL "" FORCE)
MESSAGE ("-- BUILD_APPS is set to " ${BUILD_APPS})
When I look at the CMakeCache.txt file that's generated by the SET command above, I see the option set correctly:
./CMakeCache.txt:BUILD_APPS:BOOL=OFF
Unfortunately, the option doesn't work.