[CMake] CMake without C/C++ tests

Дима Dimanne at yandex.ru
Mon Jan 31 05:59:11 EST 2011


So, I put the line
project (astl "NONE")
in CmakeLists.txt

But it does not work, i got these messages
$ cmake -DCMAKE_TOOLCHAIN_FILE=/home/Void/devel/svnroot/trunk/gcc/libstdc++-v3/astl/ToolchainFile.cmake /home/Void/devel/svnroot/trunk/gcc/libstdc++-v3/astl/
-- Configuring done
CMake Error: Cannot determine link language for target "astl".
CMake Error: CMake can not determine linker language for target:astl
-- Generating done
-- Build files have been written to: /home/Void/devel/svnroot/trunk/gcc/libstdc++-v3/astl
void at Impedance-Pad-T410:/home/Void/devel/build-astl$

Then i googled this http://www.cmake.org/pipermail/cmake/2006-July/010380.html
and add SET_TARGET_PROPERTIES(astl PROPERTIES LINKER_LANGUAGE CXX) to CMakeLists.txt
And got these
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_CREATE_STATIC_LIBRARY


After it I add 
SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_CXX_COMPILER> -o <TARGET> <OBJECTS>")
in my CmakeLists.txt


And finally, after cmake command, i got these

void at Impedance-Pad-T410:/home/Void/devel/build-astl$ make
Scanning dependencies of target astl
Linking CXX static library libastl.a                                                                                                    
Error running link command: No such file or directory                                                                                   
make[2]: *** [libastl.a] Error 2
make[1]: *** [CMakeFiles/astl.dir/all] Error 2
make: *** [all] Error 2
void at Impedance-Pad-T410:/home/Void/devel/build-astl$ 


Also, i can not compile project with standard gcc due to 
project (astl "NONE")


So, how can I remove -rdynamic option? Is it possible?


28.01.2011, 20:20, "Eric Noulard" <eric.noulard at gmail.com>:
> 2011/1/28 Дима <Dimanne at yandex.ru>;:
>
>>  How can I change or disable C/C++ testing during cmake command?
>
> project(YourProject NONE)
>
> from the doc;
>
> Set a name for the entire project.
>
>          project(<projectname> [languageName1 languageName2 ... ] )
>
>         Sets the name of the project.  Additionally this sets the variables
>        <projectName>_BINARY_DIR and <projectName>_SOURCE_DIR to the
>        respective values.
>
>        Optionally you can specify which languages your project supports.
>        Example languages are CXX (i.e.  C++), C, Fortran, etc.  By default C
>        and CXX are enabled.  E.g.  if you do not have a C++ compiler, you can
>        disable the check for it by explicitly listing the languages you want
>        to support, e.g.  C.  By using the special language "NONE" all checks
>        for any language can be disabled.
>
>>  PS CMake tries to compile with -rdynamic option, but our port of gcc does
>>  not support it yet.
>
> Then may be you should set up a specific compiler ID.
>
> --
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org


More information about the CMake mailing list