[CMake] reusable cmakecache.txt

Eric Noulard eric.noulard at gmail.com
Tue Feb 27 16:34:36 EST 2007


2007/2/27, Alexander Ivash <alexander.ivash at psa-software.com>:
> Hello, Bill.
>
> You wrote 26 ôåâðàëÿ 2007 ã., 19:26:44:
>
> > Alexander Ivash wrote:
> >> Hello, cmake.
> >>
> >> I have 2 compilers: gnu and diab. Cmake can't find them so I have to
> >> run cmakesetup and enter path for them every time I need to prepare
> >> new project for compilation.
[...]
> >>
[...]
> > CXX and CC environment variables can be set prior to running cmake if it
> > can not find your compiler.
>

> Due to -D option? But it seems a bit unconvenient to type every time
>
> cmake -D "CMAKE_AR:FILEPATH=D:/WindRiver/diab/5.2.3.0/WIN32/bin/dar.exe"
> -D "CMAKE_CXX_COMPILER:FILEPATH=D:/WindRiver/diab/5.2.3.0/WIN32/bin/dcc.exe"
> -D "CMAKE_C_COMPILER:FILEPATH=D:/WindRiver/diab/5.2.3.0/WIN32/bin/dcc.exe"
> -D "CMAKE_MAKE_PROGRAM:FILEPATH=D:/WindRiver/vxworks-6.1/host/x86-win32/bin/make.exe"
> -G "Unix Makefiles"
>
> each time when I need to generate CmakeCache for project. If there
> would be a feature to use "template cmake cache" as a prototype
> for creating working cmake cache... Or I something misunderstand ?

A new project is a new project which MAY share ONLY  PART
of his forthcoming cache with a previous.

Personnally I would go for 2 wrapper scripts:

gnucmake.bat
diabcmake.bat

which contains the appropriate -D options and/or
proper environnement var settings.

in the end for a new project you will do

mkdir new_project_build
cd new_project_build

gnucmake <path/to/new_project_source>
or
diabcmake <path/to/new_project_source>

after that running cmake in the build directory
will proceed as usual.


-- 
Erk


More information about the CMake mailing list