[CMake] configure_file - false vs "0"

James C. Sutherland James.Sutherland at utah.edu
Sun Aug 9 12:06:28 EDT 2009


In my configure.h.in file I have:

    #cmakedefine TEST_VAR_VALUE

In my CMakeLists.txt file I have:

   configure_file( ${PROJECT_SOURCE_DIR}/src/config.h.in $ 
{PROJECT_SOURCE_DIR}/src/configure.h )
   set( TEST_VAR_VALUE  "0" )

This results in a configure.h file containing:
   /* #undef TEST_VAR_VALUE */

But what I would like is:
    #define TEST_VAR_VALUE 0


So basically cmake is seeing the value of TEST_VAR_VALUE as 0 and  
treating it as "false" rather than a value.

Any ideas how to accomplish this?

James


More information about the CMake mailing list