Just a guess, but the docs for option state: option(<option_variable> "help string describing option" [initial value])
Provide an option for the user to select as ON or OFF. If no initial value is provided, OFF is used. In this description is not optional, but the initial value is. In the usage presented, I believe "ON" may be interpreted as the doc string and the default value is being taken? Maybe Tim made a mistake in his reply. I don't know personally, I've never used this. Steven On Wed, Nov 2, 2011 at 9:36 PM, Dan Kegel <d...@kegel.com> wrote: > On Wed, Nov 2, 2011 at 6:21 PM, Tim Gallagher <tim.gallag...@gatech.edu> > wrote: >> Using set() as you have done only sets the value in the current scoping >> unit. If you did: >> >> set(gtest_force_shared_crt ON CACHE INTERNAL "") >> >> then it will be set to ON and hidden from the GUI display. >> >> If it will always be a bool and you want it displayed on the GUI, you can >> also do: >> >> option(gtest_force_shared_crt ON) > > Tried it, no change, still broken. > > $ grep gtest_force_shared_crt CMakeLists.txt build/CMakeCache.txt > CMakeLists.txt:option(gtest_force_shared_crt ON) > build/CMakeCache.txt:gtest_force_shared_crt:BOOL=OFF > > --trace shows > > CMakeLists.txt(23): option(gtest_force_shared_crt ON ) > gtest/CMakeLists.txt(14): option(gtest_force_shared_crt Use shared > (DLL) run-time lib even when Google Test is built as static lib. OFF ) > > So, now what? How does one set an option declared by a subdirectory > before entering that subdirectory? Lots of people use gtest, surely > someone has run into this before. > - Dan > -- > > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.cmake.org/mailman/listinfo/cmake > -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake