Zitat von Bill Hoffman <bill.hoff...@kitware.com>:
I have seen several requests for an autoheader type function to be added to CMake. I have never used autoheader, but I gather it takes a list of variables and generates a config.h.in file automatically. Does anyone on the list have experience with autoheader? If so, what would a nice CMake api for something like this look like?
Well, autoheader just takes the result of certain tests and prepares a file that is usable e.g. with configure_file( .... @ONLY ). Usually, that contains much more than anyone needs or wants. It addresses the problem of not having to keep to distinct lists of variables to replace (avoiding typos) but limits itself to a strict format.
A cmake-equalvalent could be a configure_file()-like function that takes a list of variables or mark variables and use all of them. There is no point in emulating the actual autoheader behaviour as that has the same problem as the configure script itself: an automatically created (and thus non-source) file in the source tree. You can even make it better than autoheader and emit a file with #define/#undef for C and something with const variables for C++ (type safety) and something else for other supported languages. That would make it more complex but definitely better.
HS _______________________________________________ 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