On Tue, Mar 31, 2009 at 12:23 AM, James Bigler <[email protected]>wrote:

> I think he wants to run ccmake and configure things how he likes and then
> get a command line that would produce the equivalent configuration without
> ccmake (i.e. cmake -DSOMEVAR:BOOL=ON
> -DPATH_TO_SOME_EXE:PATH=/path/to/some.exe).  This way, he can configure a
> new build in one easy step.
>
> I don't believe this feature exists, though you could get something close
> by doing the following.
>
> 1. Create a build directory and run cmake <path to source>.  This is your
> default configuration.
> 2. Copy CMakeCache.txt some where safe.
> 3. Configure you system with ccmake.
> 4. Diff the old CMakeCache.txt and the new CMakeCache.txt.  The differences
> should show you a superset of the options you will need (depending on if
> some options are automatically generated when you turn others on).


You could create a separate file by hand and then include it with INCLUDE(
... OPTIONAL)

initialize_cache.cmake:
set(SOMEVAR ON CACHE BOOL "")
set(PATH_TO_SOME_EXE /path/to/some.exe CACHE PATH "")

I'm assuming here that you're not OK with simply using "cmake" to define all
of your variables and then dump the resulting command (run as "cmake"
"ccmake" or "cmake-gui") manually into a shell script.

i.e. if this works
$ cmake -DSOMEVAR:BOOL=ON -DPATH_TO_SOME_EXE:PATH=/path/to/some.exe ..
run this...
$ echo ccmake -DSOMEVAR:BOOL=ON -DPATH_TO_SOME_EXE:PATH=/path/to/some.exe ..
> ~/my_cmake_start_script.sh

-- 
Philip Lowman
_______________________________________________
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

Reply via email to