View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012530CMakeCCMakepublic2011-10-21 07:402011-11-01 06:10
Reportertasptz 
Assigned ToAlex Neundorf 
PrioritylowSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
Platformx86_64 GNU/LinuxOSUbuntuOS Version10.04
Product VersionCMake 2.8.6 
Target VersionFixed in Version 
Summary0012530: Problem with ccmake and Toolchain file
DescriptionHello,

I want to use a self compiled gcc 4.6 instead of the system's gcc 4.5. Therefore I wrote a simple toolchain file:

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER "/opt/gcc-4.6.0/bin/gcc-4.6")
set(CMAKE_CXX_COMPILER "/opt/gcc-4.6.0/bin/g++-4.6")
include_directories(BEFORE SYSTEM "/opt/gcc-4.6.0/include")

If I use this with ccmake (empty build directory):
ccmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain-gcc46.cmake ../src/

I get:
You have changed variables that require your cache to be deleted.
 Configure will be re-run and you may have to reset some variables.
 The following variables have changed:
 CMAKE_C_COMPILER= /usr/bin/gcc-4.5
 CMAKE_CXX_COMPILER= /usr/bin/g++-4.5

If I use cmake-gui and specify the toolchain file everything is fine.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0027691)
Alex Neundorf (developer)
2011-11-01 06:09

Simply setting the CC and CXX environment variables to the gcc and g++ you want to use before the initial cmake/ccmake/cmake-gui run should do what you want, there should be no need for a toolchain file (also since this takes you into cross-compiling mode, which makes things more complicated).

CC=/usr/bin/gcc-4.5 CXX=/usr/bin/g++-4.5 ccmake ../src

should do it.

Alex
(0027692)
Alex Neundorf (developer)
2011-11-01 06:09

Feel free to reopen the issue if this doesn't work for you.
(0027693)
Alex Neundorf (developer)
2011-11-01 06:10

...closing again (was just reopened to add a note).

 Issue History
Date Modified Username Field Change
2011-10-21 07:40 tasptz New Issue
2011-11-01 06:09 Alex Neundorf Note Added: 0027691
2011-11-01 06:09 Alex Neundorf Status new => closed
2011-11-01 06:09 Alex Neundorf Resolution open => no change required
2011-11-01 06:09 Alex Neundorf Assigned To => Alex Neundorf
2011-11-01 06:09 Alex Neundorf Note Added: 0027692
2011-11-01 06:09 Alex Neundorf Status closed => feedback
2011-11-01 06:09 Alex Neundorf Resolution no change required => reopened
2011-11-01 06:10 Alex Neundorf Note Added: 0027693
2011-11-01 06:10 Alex Neundorf Status feedback => closed
2011-11-01 06:10 Alex Neundorf Resolution reopened => no change required


Copyright © 2000 - 2018 MantisBT Team