[Cmake] feature request - separate user and system cmake cach e files

Wheeler, Frederick W (Research) wheeler at crd.ge.com
Mon Mar 10 14:45:02 EST 2003


Tony,

I generally accomplish what you describe by deleting the CMakeCache.txt file, replacing it with a
hand generated file that has the settings I want, and then running cmake.  Below is an example
plucked from one of my build scripts.  You can also append to the end of a CMakeCache.txt file.  The
settings made at the end override those that come before.  I never use the CMake GUI.  Perhaps there
is some additional difficulty in doing this with the GUI?

Fred Wheeler

mkdir -p $SRW/vxl_bld_icc
cd $SRW/vxl_bld_icc
rm -f CMakeCache.txt
cat <<'EOF' >> CMakeCache.txt
CMAKE_C_COMPILER:FILEPATH=icc
CMAKE_CXX_COMPILER:FILEPATH=icc
CMAKE_C_FLAGS:STRING=-w -O0 -g
CMAKE_CXX_FLAGS:STRING=-w -O0 -g
BUILD_SHARED_LIBS:BOOL=OFF
BUILD_VGUI:BOOL=ON
VGUI_USE_QT:BOOL=OFF
OPENGL_xmesa_INCLUDE_DIR:PATH=IGNORE
VXL_FORCE_V3P_ZLIB:BOOL=YES
VXL_FORCE_V3P_PNG:BOOL=YES
VXL_FORCE_V3P_JPEG:BOOL=YES
VXL_FORCE_V3P_MPEG2:BOOL=YES
VXL_FORCE_V3P_TIFF:BOOL=YES
EOF

$SRW/cmake_usr_icc/bin/cmake \
  -G"Unix Makefiles" \
  -DCMAKE_INSTALL_PREFIX:PATH=$SRW/vxl_usr_icc \
  $SRW/vxl_src

MAKEFLAGS=kie nice -10 make -k
MAKEFLAGS=kie nice -10 make -k
MAKEFLAGS=kie nice -10 make -k
MAKEFLAGS=kie nice -10 make -k




-----Original Message-----
From: Tony Pan [mailto:tpan at bmi.osu.edu]
Sent: Monday, March 10, 2003 2:35 PM
To: cmake at public.kitware.com
Subject: [Cmake] feature request - separate user and system cmake cache files


I apologize if this has already been brought up.  I think it would be helpful if the CMakeCache.txt
file can be split into a user file and a system file.  The motivation for the request is that I have
been setting up several build environments, and typing in the same stuff over and over is getting old
very quickly.  It'd be nice if I can just copy the user config file, make a few modifications, and
then rerun cmake to regenerate the system configs.  This would be useful for setting up testing
environments.  In addition, having separate cache files would make updating src code to new versions
easier and less prone to dirty cache, as I'd only need to blow away the system cache.

Thanks.

Tony 



More information about the CMake mailing list