On Thursday 18 February 2010, Buonopane, Robert wrote:
> Hi:
> Running CMAKE 2.6
> In my project level CMakeList.txt file I have:
> INCLUDE (CMakeForceCompiler)
> CMAKE_FORCE_CXX_COMPILER(g++ GNU)
>
> When I build on my Linux platform it compiles and links with g++ which is
> what I want. When I build on my Solaris10 platform it compiles with g++ BUT
> links with gcc.
I think you don't need the force_compiler() macro.
It is intended only for very weird compilers/platforms, usually cross
compiling, where the tools (compiler, linker) are behaving very different
from the standard compilers (like needing a lot of switches for a basic
hello-world).
Why do you think you need it ?
To tell cmake which compiler you want, set the CC and CXX environment
variables before the initial cmake run to point to these compilers.
If you want to make sure in your CMakeLists.txt you got the right compilers,
you may check the compiler id:
if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
message(FATAL_ERROR "I want g++ !")
endif()
Alex
_______________________________________________
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