Package: cmake Version: 3.0.2-1 Severity: normal When both -DCMAKE_C_COMPILER and -DCMAKE_CXX_COMPILER are set on cmake invocation, the build goes fine if one just runs "make" afterwards. If one re-runs cmake a second time, then the build cannot succeed:
yann@home:build$ rm -rf * yann@home:build$ cmake .. -DCMAKE_C_COMPILER=clang-3.4 -DCMAKE_CXX_COMPILER=clang++-3.4 -- The CXX compiler identification is Clang 3.4.2 -- The C compiler identification is Clang 3.4.2 -- Check for working CXX compiler: /usr/bin/clang++-3.4 -- Check for working CXX compiler: /usr/bin/clang++-3.4 -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working C compiler: /usr/bin/clang-3.4 -- Check for working C compiler: /usr/bin/clang-3.4 -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Configuring done -- Generating done -- Build files have been written to: /work/yann/deb/sjaak/cmaketest/build yann@home:build$ make Scanning dependencies of target foo [100%] Building CXX object CMakeFiles/foo.dir/src/foo.cc.o Linking CXX executable foo [100%] Built target foo yann@home:build$ cmake .. -DCMAKE_C_COMPILER=clang-3.4 -DCMAKE_CXX_COMPILER=clang++-3.4 -- Configuring done -- Generating done -- Build files have been written to: /work/yann/deb/sjaak/cmaketest/build yann@home:build$ make [100%] Building CXX object CMakeFiles/foo.dir/src/foo.cc.o make[2]: /work/yann/deb/sjaak/cmaketest/build/clang++-3.4: Command not found CMakeFiles/foo.dir/build.make:54: recipe for target 'CMakeFiles/foo.dir/src/foo.cc.o' failed make[2]: *** [CMakeFiles/foo.dir/src/foo.cc.o] Error 127 CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/foo.dir/all' failed make[1]: *** [CMakeFiles/foo.dir/all] Error 2 Makefile:76: recipe for target 'all' failed make: *** [all] Error 2 No such behaviour is observed when just "cmake .." is used. When one of the compiler is changed, the result is even more broken, here following an erroneous use of CXX=clang-3.4. See how alternatively CC and CXX get a wrong setup one after the other, with the only way out being to restart from scratch: yann@home:build$ rm -rf * yann@home:build$ cmake .. -DCMAKE_C_COMPILER=clang-3.4 -DCMAKE_CXX_COMPILER=clang-3.4 -- The CXX compiler identification is Clang 3.4.2 -- The C compiler identification is Clang 3.4.2 -- Check for working CXX compiler: /usr/bin/clang-3.4 -- Check for working CXX compiler: /usr/bin/clang-3.4 -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working C compiler: /usr/bin/clang-3.4 -- Check for working C compiler: /usr/bin/clang-3.4 -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Configuring done -- Generating done -- Build files have been written to: /work/yann/deb/sjaak/cmaketest/build yann@home:build$ cmake .. -DCMAKE_C_COMPILER=clang-3.4 -DCMAKE_CXX_COMPILER=clang++-3.4 -- Configuring done You have changed variables that require your cache to be deleted. Configure will be re-run and you may have to reset some variables. The following variables have changed: CMAKE_CXX_COMPILER= clang++-3.4 -- The CXX compiler identification is Clang 3.4.2 -- The C compiler identification is GNU 4.9.1 -- Check for working CXX compiler: /usr/bin/clang++-3.4 -- Check for working CXX compiler: /usr/bin/clang++-3.4 -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Configuring done -- Generating done -- Build files have been written to: /work/yann/deb/sjaak/cmaketest/build yann@home:build$ cmake .. -DCMAKE_C_COMPILER=clang-3.4 -DCMAKE_CXX_COMPILER=clang++-3.4 -- Configuring done You have changed variables that require your cache to be deleted. Configure will be re-run and you may have to reset some variables. The following variables have changed: CMAKE_C_COMPILER= clang-3.4 -- The CXX compiler identification is GNU 4.9.1 -- The C compiler identification is Clang 3.4.2 -- 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 -- Check for working C compiler: /usr/bin/clang-3.4 -- Check for working C compiler: /usr/bin/clang-3.4 -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Configuring done -- Generating done -- Build files have been written to: /work/yann/deb/sjaak/cmaketest/build Files used: === CMakeLists.txt project(foo CXX C) add_executable ("foo" src/foo.cc) === src/foo.cc int main(void) { return 1; } === -- System Information: Debian Release: jessie/sid APT prefers testing APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (101, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 3.16-3-amd64 (SMP w/4 CPU cores) Locale: LANG=C, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages cmake depends on: ii cmake-data 3.0.2-1 ii dpkg 1.17.21 ii libarchive13 3.1.2-9 ii libc6 2.19-13 ii libcurl3 7.38.0-3 ii libexpat1 2.1.0-6+b3 ii libgcc1 1:4.9.1-19 ii libstdc++6 4.9.1-19 ii procps 2:3.3.9-8 ii zlib1g 1:1.2.8.dfsg-2 Versions of packages cmake recommends: ii gcc 4:4.9.1-5 ii make 4.0-8 Versions of packages cmake suggests: ii codeblocks 13.12-3 pn eclipse <none> ii ninja-build 1.3.4-1.2 -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org