Re: [CMake] How the heck does one set options?

2011-11-03 Thread Dan Kegel
Thanks for the authoritative answer. I'm now using SET(gtest_force_shared_crt on CACHE BOOL Use shared (DLL) run-time lib even when Google Test is built as static lib.) add_subdirectory(gtest) include_directories(gtest/include) add_executable(mymain mymain.cpp) target_link_libraries(mymain

Re: [CMake] How the heck does one set options?

2011-11-03 Thread Michael Hertling
On 11/03/2011 08:20 PM, Dan Kegel wrote: Thanks for the authoritative answer. I'm now using SET(gtest_force_shared_crt on CACHE BOOL Use shared (DLL) run-time lib even when Google Test is built as static lib.) add_subdirectory(gtest) include_directories(gtest/include)

Re: [CMake] How the heck does one set options?

2011-11-03 Thread Dan Kegel
On Thu, Nov 3, 2011 at 2:44 PM, Michael Hertling mhertl...@online.de wrote: However, variables preset with OPTION() are usually intended to be at the user's disposal - otherwise, they wouldn't be options - so a project should definitely pass through without errors regardless to which values

[CMake] How the heck does one set options?

2011-11-02 Thread Dan Kegel
Right, so, I have this fragment: set(gtest_force_shared_crt ON) add_subdirectory(gtest) Oddly, when I run cmake, that variable is off. WTF? Looking at the cache, I see build/CMakeCache.txt:gtest_force_shared_crt:BOOL=OFF It looks like someone else ran into this before,

Re: [CMake] How the heck does one set options?

2011-11-02 Thread Tim Gallagher
(gtest_force_shared_crt ON) Tim - Original Message - From: Dan Kegel d...@kegel.com To: cmake@cmake.org Sent: Wednesday, November 2, 2011 9:14:19 PM Subject: [CMake] How the heck does one set options? Right, so, I have this fragment: set(gtest_force_shared_crt ON) add_subdirectory(gtest) Oddly

Re: [CMake] How the heck does one set options?

2011-11-02 Thread Dan Kegel
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

Re: [CMake] How the heck does one set options?

2011-11-02 Thread Dan Kegel
On Wed, Nov 2, 2011 at 6:36 PM, Dan Kegel d...@kegel.com wrote: 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. I'm starting to suspect that everyone who needs this to

Re: [CMake] How the heck does one set options?

2011-11-02 Thread Steven Velez
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

Re: [CMake] How the heck does one set options?

2011-11-02 Thread Tim Gallagher
...@gmail.com To: Dan Kegel d...@kegel.com Cc: gtg0...@mail.gatech.edu, cmake@cmake.org Sent: Wednesday, November 2, 2011 9:48:18 PM Subject: Re: [CMake] How the heck does one set options? Just a guess, but the docs for option state: option(option_variable help string describing option [initial