[Cmake] Pb with Last CVS version of CMake

TDeschamps at lbl.gov TDeschamps at lbl.gov
Wed Dec 4 23:03:46 EST 2002


Hi all,

I still have pbs with the latest version of CMake.
Here is a piece of my CmakeList.txt file:

---------------------------------------------------------
# ask cmake to find VTK
INCLUDE(/usr/local/share/CMake/Modules/FindVTK.cmake)

INCLUDE(${VTK_USE_FILE})

SET( CMAKE_CXX_COMPILER ${VTK_CXX_COMPILER} )
SET( CMAKE_CXX_FLAGS ${VTK_CXX_FLAGS} )

MESSAGE( "The current compiler is " ${CMAKE_CXX_COMPILER} " " 
${CMAKE_CXX_FLAGS} )
------------------------------------------------------

And the output is :

> cmake
-- Looking for connect in socket
-- Looking for connect in socket - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Checking for CXX include file iostream
-- Checking for CXX include file iostream -- found
-- Checking for CXX include file sstream
-- Checking for CXX include file sstream -- found
CMake Error: The selected VTK was built with "g++", but the current
compiler is "c++".  Please set CMAKE_CXX_COMPILER to "g++".
The current compiler is g++ -g -O2 -Wno-deprecated
-- Configuring done

I do not understand what is wrong since the correct options are
displayed? Is the order of the calls wrong?

In fact it should try to check conflicts after processing all the
different macros, and not before...
Unless the CMakeList.txt will start to look more and more like a classic
Makefile.
Running cmake with CXX set to g++ in an empty directory for having the
correct setting is too much, there is to be another way, isn't it?

Thomas

----- Original Message -----
> > 4) When I try to link my code with VTK, it does not remember the
> > compiling options while it was doing so with the former version. 
> In my
> 
> This is actually due to an update of VTK, not CMake.  Either way, 
> we have
> disabled the automatic setting of the compiler in projects using VTK.
> There were too many problems with projects that use VTK and a second
> library built by CMake.  When both VTK and the other library try to 
> setthe compiler settings, they fight over it, and different source 
> files get
> built with different settings.
> 
> > CMake Error: The selected VTK was built with "g++", but the current
> > compiler is "c++".  Please set CMAKE_CXX_COMPILER to "g++".
> 
> You have to set the compiler for your project to "g++" as the 
> instructionsin the error message indicate.  This can be done by 
> toggling on advanced
> options in the CMake curses interface.  It can also be done by 
> setting the
> environment variable "CXX" to "g++" before running cmake in an 
> empty build
> tree for your project.
> 
> -Brad




More information about the CMake mailing list