On Thu, Jun 16, 2011 at 10:58 AM, Alexander Neundorf <[email protected]> wrote:
> You could simply read the header file and try to grep fpor the version > numbers. Works quite good in many cases. > > Or you could try to mess around with try_compile(), and search in the produced > binary for the version strings. This may need some clever tricks to actually > create such a string in the executable. > CMake does that for a few things, e.g. to determine the sizes of types, > compiler ID, and I think more, see e.g. Modules/CheckTypeSize.*. Grepping the headers wouldn't be as reliable as I would like... usually version numbers are stored in an internal config header file that might be moved or renamed from version to the next. Searching the binaries... that would really be a last resort. Does CMake provide a cross-platform way of running the preprocessor and dumping all macros? For example with gcc, I can do "gcc -E -dD" but I would have to do the same for all other compilers. - David _______________________________________________ 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
