View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012496CMakeCMakepublic2011-10-06 03:502016-06-10 14:31
ReporterMarkus Klinik 
Assigned ToAlex Neundorf 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake 2.8.5 
Target VersionFixed in Version 
Summary0012496: Compiler tests ignore variables from command line when using toolchain file
DescriptionHave a toolchain file that sets cache variables. On the
command line, override the default values using the -D option. The overrides
are ignored by the configure-time compiler tests, but the overrides go to the
generated makefiles.

Example:

--- toolchain.cmake
set(ANDROID_NDK_ROOT "/home/nosuchuser/android-ndk-r6b" CACHE PATH "Android NDK root")
message("ANDROID_NDK_ROOT is: " ${ANDROID_NDK_ROOT})
--- end of toolchain.cmake

--- CMakeLists.txt
project(foobar)
--- end of CMakeLists.txt

run cmake with the following command:

$ cmake -DANDROID_NDK_ROOT=/home/mkl/android-ndk -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake ..

and observe that ANDROID_NDK_ROOT takes on the default value for the compiler tests:

ANDROID_NDK_ROOT is: /home/mkl/android-ndk
ANDROID_NDK_ROOT is: /home/mkl/android-ndk
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
ANDROID_NDK_ROOT is: /home/nosuchuser/android-ndk-r6b
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
ANDROID_NDK_ROOT is: /home/nosuchuser/android-ndk-r6b
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
ANDROID_NDK_ROOT is: /home/nosuchuser/android-ndk-r6b
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
ANDROID_NDK_ROOT is: /home/nosuchuser/android-ndk-r6b
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0027538)
Markus Klinik (reporter)
2011-10-06 03:50

see also http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/33364/focus=34200 [^]
(0039956)
Trygve Laugstøl (reporter)
2015-12-06 15:27

This is a problem for me too. Are there any available workardounds?
(0041909)
Kitware Robot (administrator)
2016-06-10 14:28

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.

 Issue History
Date Modified Username Field Change
2011-10-06 03:50 Markus Klinik New Issue
2011-10-06 03:50 Markus Klinik Note Added: 0027538
2011-10-06 11:33 Alex Neundorf Assigned To => Alex Neundorf
2011-10-06 11:33 Alex Neundorf Status new => assigned
2012-08-13 14:32 Alex Neundorf Status assigned => backlog
2015-12-06 15:27 Trygve Laugstøl Note Added: 0039956
2016-06-10 14:28 Kitware Robot Note Added: 0041909
2016-06-10 14:28 Kitware Robot Status backlog => resolved
2016-06-10 14:28 Kitware Robot Resolution open => moved
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team