On Tuesday 31 March 2009, James Bigler wrote: ... > Why not something similar to what you proposed, but without the > intermediate configure.h.in step and being able to specify comments and > perhaps custom strings. You could also specify things multiple kinds and > they all just get inserted one after the other. CMake could generate the > .in file and use configure_file in the background. The point is that you > don't have to maintain two files. > > set(VARS HAS_A HAS_B HAS_C) > set(STRING_VARS STRING_A STRING_B) > cmake_autoheader( > CMAKEDEFINE_VARS ${VARS} > STRING_VARS ${STRING_VARS} > CUSTOM_VAR "#define \"I like @my_...@\" > COMMENT "Here's a comment" > CMAKEDEFINE_VARS "SOME_OTHER_VAR;AND_ANOTHER;" > HEADER ${CMAKE_BINARY_DIR}/include/config.h > )
I like that, it's quite straightforward and easy to understand, no tricks involved. And I think this should be doable with a cmake macro or function, probably even a C and a C++ specific version. Alex _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake