[CMake] Bug in SET ?

Alan W. Irwin irwin at beluga.phys.uvic.ca
Fri Apr 13 15:30:04 EDT 2007


Here is a complete test CMakeLists.txt file which illustrates what I believe
is a bug in 2.4.6 for the SET command:

message(STATUS TEST=${TEST})
set(TEST OFF CACHE BOOL "test variable" FORCE)
message(STATUS TEST=${TEST})
set(TEST OFF CACHE BOOL "test variable" FORCE)
message(STATUS TEST=${TEST})

Here are the results (note the important -DTEST=ON option in the command
line) from running cmake-2.4.6 on this using an initially empty
build tree:

software at starling> cmake -DTEST=ON ../test_variable_set/
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Check size of void*
-- Check size of void* - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- TEST=ON
-- TEST=ON
-- TEST=OFF
-- Configuring done
-- Generating done
-- Build files have been written to: /home/software/plplot_cvs/HEAD/cmaketest/build_dir

Why do I have to force TEST OFF twice before it "takes"?
If I don't specify -DTEST on the command line then, the three messages
are

-- TEST=
-- TEST=OFF
-- TEST=OFF

as you would expect.

I believe the -DTEST=ON result where the variable cannot be forced OFF the
first time you try is a bug in 2.4.6, but I would like to see some discussion
here before I make a bug report about this.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list