Package: cmake
Version: 2.6.2-1
Severity: normal
Hi,
there is a problem with cmake when the build tree is on some scratch storage
(e.g. /tmp) while the source tree resides in /home and the build tree is
symlinked into the source tree.
Consider the following minimal project:
========== hello.cpp ==========
#include <iostream>
int main()
{ std::cout << "Hello, World!" << std::endl; }
===============================
========== CMakeLists.txt ==========
add_executable(hello hello.cpp)
====================================
I can build it locally (with $PWD == /home/andreas/cmake-test)
without problems using the commands
mkdir build-here
( cd build-here/ ; cmake .. )
make -C build-here
I can also build it in /tmp without problems using
mkdir /tmp/build-in-tmp
HERE=$PWD && ( cd /tmp/build-in-tmp/ ; cmake $HERE )
make -C /tmp/build-in-tmp
But if I symlink the /tmp directory here, the build fails
mkdir /tmp/build-via-symlink
ln -s /tmp/build-via-symlink build-symlinked
HERE=$PWD && ( cd build-symlinked/ ; cmake $HERE )
make -C build-symlinked
....
make[2]: Entering directory `/tmp/build-via-symlink'
make[2]: *** No rule to make target `../hello.cpp', needed by
`CMakeFiles/hello.dir/hello.cpp.o'. Stop.
....
This is probably due to the "mis-interpretation" of $PWD by cmake:
In the make -C build-symlinked call the following happens
#SRC_DIR=/home/user/project
#BLD_DIR=/home/user/project/build -> /tmp/build
PWD=/home/user/project/build
`readlink -f $PWD` = /tmp/build
but since $SRC_DIR is a prefix of $PWD, cmake assumes that $PWD/..
is equal to $SRC_DIR which is not correct.
The same behaviour occurs in 2.6.0 and 2.6.2.
Andreas
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (500, 'testing'), (500, 'stable'), (300, 'unstable'), (130,
'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.26-1-686 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages cmake depends on:
ii libc6 2.7-14 GNU C Library: Shared libraries
ii libgcc1 1:4.3.2-1 GCC support library
ii libidn11 1.8+20080606-1 GNU libidn library, implementation
ii libncurses5 5.6+20080830-1 shared libraries for terminal hand
ii libstdc++6 4.3.2-1 The GNU Standard C++ Library v3
cmake recommends no packages.
cmake suggests no packages.
-- no debconf information
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]