MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0011940 | CMake | CMake | public | 2011-03-08 11:45 | 2016-06-10 14:31 |
Reporter | Nicolas Despres | ||||
Assigned To | Kitware Robot | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | moved | ||
Platform | i686 | OS | Ubuntu | OS Version | 10.10 |
Product Version | CMake 2.8.4 | ||||
Target Version | Fixed in Version | ||||
Summary | 0011940: Wrong paths in generated Makefile when builddir is a symlink to an out-of-source directory. | ||||
Description | When you have a directory layout like this: /tmp/sourcedir /tmp/sourcedir/_build -> /tmp/build /tmp/build And you call cmake /tmp/sourcedir from /tmp/sourcedir/_build the paths in the generated Makefile are wrong. See the steps to reproduce for more details. I will try to add a test and a patch that fix it as soon as I have time. | ||||
Steps To Reproduce | $ cd /tmp $ mkdir helloworld $ cd helloworld $ cat > CMakeLists.txt <<EOF cmake_minimum_required(VERSION 2.8) project(helloworld) add_executable(helloworld src/main.cc ) EOF $ mkdir src $ cat > src/main.cc <<EOF #include <iostream> int main(void) { std::cout << "Hello world\n" << std::endl; return 0; } EOF $ mkdir /tmp/build $ ln -s /tmp/build _build $ cd _build $ cmake .. CMake Error: The source directory "/tmp" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI. $ cmake /tmp/helloworld -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Configuring done -- Generating done -- Build files have been written to: /tmp/helloworld/_build $ make -- Configuring done -- Generating done -- Build files have been written to: /tmp/helloworld/_build Scanning dependencies of target helloworld make[2]: *** No rule to make target `../src/main.cc', needed by `CMakeFiles/helloworld.dir/src/main.cc.o'. Stop. make[1]: *** [CMakeFiles/helloworld.dir/all] Error 2 make: *** [all] Error 2 I have attached the CMakeCache.txt | ||||
Additional Information | However doing the following works: $ rm -rf /tmp/helloworld/_build /tmp/build $ mkdir /tmp/build $ cd /tmp/build $ cmake /tmp/helloworld -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Configuring done -- Generating done -- Build files have been written to: /tmp/build $ make Scanning dependencies of target helloworld [100%] Building CXX object CMakeFiles/helloworld.dir/src/main.cc.o Linking CXX executable helloworld [100%] Built target helloworld | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | CMakeCache.txt (10,456) 2011-03-08 11:45 https://public.kitware.com/Bug/file/3742/CMakeCache.txt | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2011-03-08 11:45 | Nicolas Despres | New Issue | |||
2011-03-08 11:45 | Nicolas Despres | File Added: CMakeCache.txt | |||
2012-08-11 11:09 | David Cole | Status | new => backlog | ||
2012-08-11 11:09 | David Cole | Note Added: 0030239 | |||
2016-06-10 14:28 | Kitware Robot | Note Added: 0041814 | |||
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 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|