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 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 these variable are

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) > add

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 gt

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

2011-11-03 Thread Michael Hertling
On 11/03/2011 02:14 AM, Dan Kegel wrote: > 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 look

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

2011-11-02 Thread Tim Gallagher
ven Velez" To: "Dan Kegel" 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( "help string describing option"

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( "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 pre

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 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 work unattende

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 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 an

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

2011-11-02 Thread Tim Gallagher
o: option(gtest_force_shared_crt ON) Tim - Original Message - From: "Dan Kegel" 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(g

[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, http://www.mail-archive