2016-10-13 21:18 GMT+02:00 Aaron Boxer <boxe...@gmail.com>: > 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) >
You specified @ONLY option which means that only @VARNAME@ will be processed and not ${VARNAME} > > > 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} > Either you drop the @ONLY option of configure_file or you write #cmakedefine FOO_DEFINE @SOME_CMAKE_VARIABLE@ and you should get what you want. @ONLY is very useful when you configure some kind of shell script template where $ shoudn't be interpreted by CMake condigure_file because it's meant to kept as is in the resulting configured file. > > However, I only get > > #define FOO_DEFINE ${SOME_CMAKE_VARIABLE} > > in the foo_config.h file. > > > Thanks, > Aaron > > > > > > > -- > > Powered by www.kitware.com > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Kitware offers various services to support the CMake community. For more > information on each offering, please visit: > > CMake Support: http://cmake.org/cmake/help/support.html > CMake Consulting: http://cmake.org/cmake/help/consulting.html > CMake Training Courses: http://cmake.org/cmake/help/training.html > > Visit other Kitware open-source projects at http://www.kitware.com/ > opensource/opensource.html > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/cmake > -- Eric
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake