[CMake] Need help generating a config file

Aaron Boxer boxerab at gmail.com
Thu Oct 13 15:18:30 EDT 2016


Hello,

I have a     foo.h.cmake.in     file that I am using to generate a
foo_config.h    file.

Here is the line in my cmake file that generates the header:

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/foo.h.cmake.in
  ${CMAKE_CURRENT_BINARY_DIR}/foo_config.h @ONLY)


I would like to define or undefine DEFINE in the config file
based on some cmake variables.


Here is my line in the foo.h.cmake.in file:

#cmakedefine FOO_DEFINE ${SOME_CMAKE_VARIABLE}


However, I only get

#define FOO_DEFINE ${SOME_CMAKE_VARIABLE}

in the foo_config.h file.


Thanks,
Aaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20161013/79d96d11/attachment.html>


More information about the CMake mailing list