View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010769CMakeCMakepublic2010-05-27 17:462016-06-10 14:31
ReporterKen Moreland 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake-2-8 
Target VersionFixed in Version 
Summary0010769: CMAKE_SOURCE_DIR wrong in cache init scripts
DescriptionWhen you use the -C command to load a cache init script, CMAKE_SOURCE_DIR is incorrectly set to the binary directory while that file is executed. As a demonstration consider the following shell output. Note the value for CMAKE_SOURCE_DIR is the binary directory in CacheInit.cmake.

$ ls source
CMakeLists.txt CacheInit.cmake
$ cat source/CMakeLists.txt
PROJECT(TMP NONE)
MESSAGE("CMakeLists.txt CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}")
MESSAGE("CMakeLists.txt CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}")
$ cat source/CacheInit.cmake
MESSAGE("CacheInit.cmake CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}")
MESSAGE("CacheInit.cmake CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}")
$ cd binary/
$ cmake --version
cmake version 2.8.1
$ cmake -C ../source/CacheInit.cmake ../source
loading initial cache file ../source/CacheInit.cmake
CacheInit.cmake CMAKE_SOURCE_DIR: /Users/kmorel/tmp/binary
CacheInit.cmake CMAKE_BINARY_DIR: /Users/kmorel/tmp/binary
CMakeLists.txt CMAKE_SOURCE_DIR: /Users/kmorel/tmp/source
CMakeLists.txt CMAKE_BINARY_DIR: /Users/kmorel/tmp/binary
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/kmorel/tmp/binary
$

TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0035687)
Paul M (reporter)
2014-04-14 04:29

This is affecting me. CMake 2.8.7 on Ubuntu LTS 12.04
Has a fix been released?

What is the status of this?
It has been quite some time now...
(0041705)
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
2010-05-27 17:46 Ken Moreland New Issue
2010-12-14 18:41 David Cole Assigned To => David Cole
2010-12-14 18:41 David Cole Status new => assigned
2011-02-09 14:26 David Cole Status assigned => backlog
2011-02-09 15:08 David Cole Assigned To David Cole =>
2014-04-14 04:29 Paul M Note Added: 0035687
2016-06-10 14:28 Kitware Robot Note Added: 0041705
2016-06-10 14:28 Kitware Robot Status backlog => resolved
2016-06-10 14:28 Kitware Robot Resolution open => moved
2016-06-10 14:28 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team