MantisBT - CMake
View Issue Details
0014910CMakeCMakepublic2014-05-07 05:032016-06-10 14:31
shricco 
Kitware Robot 
highmajoralways
closedmoved 
X64Windows7
CMake 2.8.12.2 
 
0014910: CMake ignores CMAKE_TOOLCHAIN_FILE even without existing cache file
I currently need cmake for cross compiling purposes. I have to support several Toolchains so I created several Toolchain files to use later in command line with the -DCMAKE_TOOLCHAIN_FILE flag. The flag is always ignored when using cmake.exe. Even if there is no cache file there. I also tried it on os x and it works fine there (same version). So it must be a windows related bug. I doubted myself at some point and decided then to try it with an older release of cmake. With version 2.8.4 everything works as expected. I also tried the cmake-gui (2.8.12.2). If choose a Toolchainfile there it is used as expected, but set compiler flags within the CMakeList.txt are ignored. Besides that, I don't want to use the gui due to automation purposes.
Extract the binary from tar.gz for windows on 64Bit System. run cmake.exe -DCMAKE_TOOLCHAIN_FILE=foo.cmake .\ and it always uses the default compiler. I am not even getting an error for not finding the given toolchain file.

Also try it with cmake.exe -DCMAKE_TOOLCHAIN_FILE=existingFile.cmake .\ same here. This time with existing file.
I have Visual Studio 2010 Express installed and Windows SDK 7.1 for 64Bit compilation.

Target System are embedded systems so the CMAKE_SYSTEM_NAME is Generic
No tags attached.
Issue History
2014-05-07 05:03shriccoNew Issue
2014-05-07 08:46Brad KingNote Added: 0035834
2016-06-10 14:29Kitware RobotNote Added: 0042546
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0035834)
Brad King   
2014-05-07 08:46   
What generator are you using? The toolchain file approach does not work with the "Visual Studio" generators. Try using a Makefile generator.
(0042546)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.