[CMake] TRY_COMPILE without linking...

Theodore Papadopoulo Theodore.Papadopoulo at sophia.inria.fr
Tue May 25 12:13:27 EDT 2010


In porting a library (blitz) from autoconf to cmake, I have the 
sub-project of testing C++ compiler features.
The autoconf way was to create some C++ files and test that they are 
compiling (and just compiling not linking).

TRY_COMPILE (in the variant that creates automatically the CMake 
project) seems to oblige me to link the code.
Many of the tests (taken from autoconf) do not include a main(), some 
the tests fail. Obviously, I can create a main,
but I wondered if there was an easy way to avoid the linking phase 
(without having to create my own CMake project
for all those files).

     Thank's in advance,

         Theo.


More information about the CMake mailing list