On 05/26/2010 04:03 AM, Bill Hoffman wrote:
On 5/25/2010 8:57 PM, Michael Hertling wrote:Use the CMAKE_FLAGS of TRY_COMPILE() to pass in a no-op for the linker:TRY_COMPILE(... CMAKE_FLAGS "-DCMAKE_CXX_LINK_EXECUTABLE='echo not linking now...'" ...)That will not work with Xcode and VS. The best you can do with those generators is to create a static library instead of a linked executable.
Good point... So I ended up adding main to all tests... Thank's a lot.In case this interests somebody, I attach my current version of the C++ tests in this mail (this is clearly work in progress, needs some cleaning and some improvement -- such as limiting the number of times it is launched -- but if there are useful comments I'll take them).
Usage: dump the directory under your project, add these lines to your project:
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") INCLUDE(CheckCXXFeatures) CHECK_ALL_CXX_FEATURES(BZ_)The BZ_ is a prefix to add to all the various variables defined by this "module". This is maybe misplaced but allows generated config.h of various project to not conflict...
Theo.
CheckCXXFeatures.tgz
Description: application/compressed-tar
_______________________________________________ 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