[CMake] dates on web site
Hi. To many people in the world, partly because you use periods, 03.12.2015 looks like December 3 10.09.2014 looks like Sept 10 whereas 2015-03.12 means March 12 to everyone. 2014-10-09 means Oct 9 to everyone I suggest you switch to ISO 8601 https://en.wikipedia.org/wiki/ISO_8601 for dates, which will cause no difficulties for non-American users. Dave The dates currently on the home page are unambiguous Thanks-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] output of add_custom_command as target in Makefile
Hooray! Thanks! Could a future version of cmake provide a nicer way to do this, without these error messages? 0 Fri 12:29:25 yost DaveBook ~/p/c++/cmake/custom-command-target/build 391 Z% make foo.cc Scanning dependencies of target foo.cc make[3]: Circular CMakeFiles/foo.cc - foo.cc dependency dropped. make[3]: Circular foo.cc - foo.cc dependency dropped. [100%] Generating foo.cc [100%] Built target foo.cc 0 Fri 12:29:27 yost DaveBook ~/p/c++/cmake/custom-command-target/build 392 Z% On 2015-06-12, at 8:40 AM, Glenn Coombs glenn.coo...@gmail.com wrote: If you run make help it will list targets it understands. And as you pointed out there is no target for foo.cc. You can make foo but if you really want a target for foo.cc you can add one yourself: cmake_minimum_required(VERSION 3.0.0) project(custom-command-target) add_custom_command ( OUTPUT foo.cc COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/genFoo foo.cc ) add_custom_target(foo.cc DEPENDS ${CMAKE_BINARY_DIR}/foo.cc) add_executable (foo foo.cc) That should create a foo.cc target that you can run that will do the right thing. -- Glenn On 12 June 2015 at 14:20, Dave Yost d...@yost.com mailto:d...@yost.com wrote: I’m not doing it wrong. Remember, this is a simplified example. We want to be able to make foo.cc http://foo.cc/ so we can look at it and compare it. Yes, we could make foo and then look at foo.cc http://foo.cc/, but until foo.cc http://foo.cc/ is right, we will suffer a lot of compiler error clutter. When foo.cc http://foo.cc/ looks right, then we will make foo. BTW, changing add_custom_command to add_custom_target has no apparent effect and doesn’t help. On 2015-06-12, at 12:24 AM, Nagy-Egri Máté Ferenc csiga.b...@aol.com mailto:csiga.b...@aol.com wrote: You’re doing it all wrong. You do not name source files as make targets, but the target name (or project name, I have no idea, because it rarely makes sense to name them differently). Try simply “foo” or “custom-command-target”. You would never say “make foo.cpp”, not even in an ordinary GNU Make script. Feladó: Dave Yost mailto:d...@yost.com Elküldve: péntek, 2015. június 12. 2:00 Címzett: cmake@cmake.org mailto:cmake@cmake.org In this example, how do I get make foo.cc http://foo.cc/ to work? 0 Thu 16:56:19 yost DaveBook ~/p/c++/cmake/custom-command-target 369 Z% bundle CMakeLists.txt genFoo #!/usr/bin/env unbundle # See http://yost.com/computers/bundle/ http://yost.com/computers/bundle/ CMakeLists.txt cmake_minimum_required(VERSION 3.3.0) project(custom-command-target) add_custom_command ( OUTPUT foo.cc http://foo.cc/ COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/genFoo foo.cc http://foo.cc/ ) add_executable (foo foo.cc http://foo.cc/) genFoo #!/bin/bash echo int main() { return 0; } 0 Thu 16:56:23 yost DaveBook ~/p/c++/cmake/custom-command-target 370 Z% cd build 0 Thu 16:56:36 yost DaveBook ~/p/c++/cmake/custom-command-target/build 371 Z% cmake .. -- Configuring done -- Generating done -- Build files have been written to: /Users/yost/p/c++/cmake/custom-command-target/build 0 Thu 16:56:41 yost DaveBook ~/p/c++/cmake/custom-command-target/build 372 Z% make clean 0 Thu 16:56:45 yost DaveBook ~/p/c++/cmake/custom-command-target/build 373 Z% make foo.cc http://foo.cc/ make: *** No rule to make target 'foo.cc http://foo.cc/'. Stop. 2 Thu 16:56:49 yost DaveBook ~/p/c++/cmake/custom-command-target/build 374 Z% -- Powered by www.kitware.com http://www.kitware.com/ Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake http://public.kitware.com/mailman/listinfo/cmake -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake
Re: [CMake] output of add_custom_command as target in Makefile
I’m not doing it wrong. Remember, this is a simplified example. We want to be able to make foo.cc so we can look at it and compare it. Yes, we could make foo and then look at foo.cc, but until foo.cc is right, we will suffer a lot of compiler error clutter. When foo.cc looks right, then we will make foo. BTW, changing add_custom_command to add_custom_target has no apparent effect and doesn’t help. On 2015-06-12, at 12:24 AM, Nagy-Egri Máté Ferenc csiga.b...@aol.com wrote: You’re doing it all wrong. You do not name source files as make targets, but the target name (or project name, I have no idea, because it rarely makes sense to name them differently). Try simply “foo” or “custom-command-target”. You would never say “make foo.cpp”, not even in an ordinary GNU Make script. Feladó: Dave Yost mailto:d...@yost.com Elküldve: péntek, 2015. június 12. 2:00 Címzett: cmake@cmake.org mailto:cmake@cmake.org In this example, how do I get make foo.cc http://foo.cc/ to work? 0 Thu 16:56:19 yost DaveBook ~/p/c++/cmake/custom-command-target 369 Z% bundle CMakeLists.txt genFoo #!/usr/bin/env unbundle # See http://yost.com/computers/bundle/ http://yost.com/computers/bundle/ CMakeLists.txt cmake_minimum_required(VERSION 3.3.0) project(custom-command-target) add_custom_command ( OUTPUT foo.cc http://foo.cc/ COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/genFoo foo.cc http://foo.cc/ ) add_executable (foo foo.cc http://foo.cc/) genFoo #!/bin/bash echo int main() { return 0; } 0 Thu 16:56:23 yost DaveBook ~/p/c++/cmake/custom-command-target 370 Z% cd build 0 Thu 16:56:36 yost DaveBook ~/p/c++/cmake/custom-command-target/build 371 Z% cmake .. -- Configuring done -- Generating done -- Build files have been written to: /Users/yost/p/c++/cmake/custom-command-target/build 0 Thu 16:56:41 yost DaveBook ~/p/c++/cmake/custom-command-target/build 372 Z% make clean 0 Thu 16:56:45 yost DaveBook ~/p/c++/cmake/custom-command-target/build 373 Z% make foo.cc http://foo.cc/ make: *** No rule to make target 'foo.cc http://foo.cc/'. Stop. 2 Thu 16:56:49 yost DaveBook ~/p/c++/cmake/custom-command-target/build 374 Z% -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
[CMake] output of add_custom_command as target in Makefile
In this example, how do I get make foo.cc to work? 0 Thu 16:56:19 yost DaveBook ~/p/c++/cmake/custom-command-target 369 Z% bundle CMakeLists.txt genFoo #!/usr/bin/env unbundle # See http://yost.com/computers/bundle/ CMakeLists.txt cmake_minimum_required(VERSION 3.3.0) project(custom-command-target) add_custom_command ( OUTPUT foo.cc COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/genFoo foo.cc ) add_executable (foo foo.cc) genFoo #!/bin/bash echo int main() { return 0; } 0 Thu 16:56:23 yost DaveBook ~/p/c++/cmake/custom-command-target 370 Z% cd build 0 Thu 16:56:36 yost DaveBook ~/p/c++/cmake/custom-command-target/build 371 Z% cmake .. -- Configuring done -- Generating done -- Build files have been written to: /Users/yost/p/c++/cmake/custom-command-target/build 0 Thu 16:56:41 yost DaveBook ~/p/c++/cmake/custom-command-target/build 372 Z% make clean 0 Thu 16:56:45 yost DaveBook ~/p/c++/cmake/custom-command-target/build 373 Z% make foo.cc make: *** No rule to make target 'foo.cc'. Stop. 2 Thu 16:56:49 yost DaveBook ~/p/c++/cmake/custom-command-target/build 374 Z% -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] getting a build parameter from a file
On 2015-06-09, at 8:05 AM, David Cole dlrd...@aol.com wrote: Why not just use configure_file because I didn’t know about it. Thanks! to write ${metals} into the file... configure_file only actually touches/writes-to/updates the file if the contents are different... Then you can just depend on that file and you don't need a separate timestamp file. HTH, David C. On Tue, Jun 9, 2015 at 1:05 AM, Dave Yost d...@yost.com wrote: First, my cmake code does this: sets ${metals} from a cmake command-line argument compares the contents of ${metals} against the contents of a file to note whether the variable is being changed since the last run of cmake writes the new value to that file for next time call an add_timestamp_file_target function. which touches the file metalsTimestamp if the variable is being changed or if the file doesn’t exist. Then comes this: set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -DMETALS=${metals}) add_executable (metals metals.cc) add_dependencies (metals metalsTimestamp) My add_timestamp_file_target function has to use one of add_custom_target add_custom_command to make metalsTimestamp visible to the add_dependencies function. Problem is, it seems that those commands have to touch the file every time cmake runs, but I want to touch it only when necessary. Is there a way to make this work? -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
[CMake] CMAKE_COLOR_MAKEFILE
Hey, I love colors. But one of my users doesn’t. Why doesn’t this work? CMAKE_COLOR_MAKEFILE=OFF cmake .. If that worked, he could set it and forget it. Instead, he has to do this: cmake -DCMAKE_COLOR_MAKEFILE=OFF .. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
[CMake] getting a build parameter from a file
First, my cmake code does this: sets ${metals} from a cmake command-line argument compares the contents of ${metals} against the contents of a file to note whether the variable is being changed since the last run of cmake writes the new value to that file for next time call an add_timestamp_file_target function. which touches the file metalsTimestamp if the variable is being changed or if the file doesn’t exist. Then comes this: set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -DMETALS=${metals}) add_executable (metals metals.cc http://metals.cc/) add_dependencies (metals metalsTimestamp) My add_timestamp_file_target function has to use one of add_custom_target add_custom_command to make metalsTimestamp visible to the add_dependencies function. Problem is, it seems that those commands have to touch the file every time cmake runs, but I want to touch it only when necessary. Is there a way to make this work? -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Not finding boost
Here is my solution. if (DEFINED BOOST_ROOT) message ( Using argument BOOST_ROOT ${BOOST_ROOT}) elseif (DEFINED ENV{BOOST_ROOT}) message ( Using env var BOOST_ROOT $ENV{BOOST_ROOT}) set (BOOST_ROOT $ENV{BOOST_ROOT}) else () message ( Looking in CPATH for include/boost/) if (DEFINED ENV{CPATH}) string (REPLACE : ; cpathList $ENV{CPATH}) foreach (dir ${cpathList}) if (EXISTS ${dir}/boost) message ( BOOST_ROOT found in CPATH ${dir}/..) set (BOOST_ROOT ${dir}/..) break () endif () endforeach () endif () endif () On 2015-06-01, at 7:43 PM, Dave Yost d...@yost.com wrote: Also, from what I can make of CMake.app/Contents/share/cmake-3.2/Modules/FindBoost.cmake findBoost looks in /sw/local/ which is a path from the old, old Fink package system for OS X. findBoost should also look in /usr/local (Homebrew and long unix tradition) /opt/local (MacPorts) /opt/ (linux and others) On 2015-06-01, at 7:18 PM, Dave Yost d...@yost.com mailto:d...@yost.com wrote: On 2015-06-01, at 2:28 PM, Dave Yost d...@yost.com mailto:d...@yost.com wrote: The boost I want is not in a normal location, but: Boost's include dir is first in my CPATH. Boost's lib dir is first in my LD_LIBRARY_PATH. Why doesn't cmake 3.2.2 find it? I'm not being picky about the version. In other words, why should I have to set BOOST_ROOT? It should be obvious where a boost is, even obvious where the one I want is. What am I missing? 0 Mon 19:13:25 yost DaveBook ~/p/c++/cmake/findboost/build 243 Z% cat ../CMakeLists.txt cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) project(findBoost CXX) find_package (Boost COMPONENTS program_options REQUIRED) if (NOT Boost_FOUND) message (FATAL_ERROR Could not find boost! ${BOOST_VERSION}) endif () message ( Boost_LIBRARY_DIR_DEBUG is ${Boost_LIBRARY_DIR_DEBUG}) 0 Mon 19:13:34 yost DaveBook ~/p/c++/cmake/findboost/build 244 Z% cmake --version cmake version 3.2.20150504-ga4a12 CMake suite maintained and supported by Kitware (kitware.com/cmake http://kitware.com/cmake). 0 Mon 19:13:45 yost DaveBook ~/p/c++/cmake/findboost/build 245 Z% ls -l /usr/local/boost/1.55.0..llvm/include total 0 drwxrwxr-x 221 yost admin 7514 Mar 8 22:19 boost 0 Mon 19:13:51 yost DaveBook ~/p/c++/cmake/findboost/build 246 Z% CPATH=/usr/local/boost/1.55.0..llvm/include 0 Mon 19:13:53 yost DaveBook ~/p/c++/cmake/findboost/build 247 Z% ls -l /usr/local/boost/1.55.0..llvm/lib/libboost_program_options.* -rw-rw-r-- 1 yost admin 938312 Mar 8 22:19 /usr/local/boost/1.55.0..llvm/lib/libboost_program_options.a -rwxrwxr-x 1 yost admin 444236 Mar 8 22:18 /usr/local/boost/1.55.0..llvm/lib/libboost_program_options.dylib 0 Mon 19:14:18 yost DaveBook ~/p/c++/cmake/findboost/build 248 Z% LD_LIBRARY_PATH=/usr/local/boost/1.55.0..llvm/lib 0 Mon 19:14:22 yost DaveBook ~/p/c++/cmake/findboost/build 249 Z% DYLD_LIBRARY_PATH=/usr/local/boost/1.55.0..llvm/lib 0 Mon 19:14:25 yost DaveBook ~/p/c++/cmake/findboost/build 250 Z% cmake .. CMake Error at /Applications/CMake.app/Contents/share/cmake-3.2/Modules/FindBoost.cmake:1243 (message): Unable to find the requested Boost libraries. Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers. Call Stack (most recent call first): CMakeLists.txt:5 (find_package) CMake Error at CMakeLists.txt:10 (message): Could not find boost! -- Configuring incomplete, errors occurred! See also /Users/yost/p/c++/cmake/findboost/build/CMakeFiles/CMakeOutput.log. 1 Mon 19:14:46 yost DaveBook ~/p/c++/cmake/findboost/build 251 Z% -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
[CMake] Not finding boost
The boost I want is not in a normal location, but: Boost's include dir is first in my CPATH. Boost's lib dir is first in my LD_LIBRARY_PATH. Why doesn't cmake 3.2.2 find it? I'm not being picky about the version. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] no convenience target for generated files?
0 Mon 19:44:33 yost DaveBook ~/p/c++/cmake/target-for-generate/build 261 Z% make help The following are some of the valid targets for this Makefile: ... all (the default if no target is provided) ... clean ... depend ... edit_cache ... rebuild_cache ... foo ... genBar ... bar ... foo.o ... foo.i ... foo.s 0 Mon 19:44:35 yost DaveBook ~/p/c++/cmake/target-for-generate/build 262 Z% On 2015-04-08, at 8:05 PM, David Cole dlrd...@aol.com wrote: Does cd bar make help Tell you anything? On Wednesday, April 8, 2015, Dave Yost d...@yost.com mailto:d...@yost.com wrote: I’m using add_custom_command to generate a file, “bar.cc http://bar.cc/”. It would be convenient if I could say make bar.cc http://bar.cc/ or make bar/bar.cc http://bar.cc/ but neither of these work, and I can’t see a target in the Makefiles that I can use. There is a way to make bar.cc.o, but not bar.cc http://bar.cc/ 0 Wed 14:15:54 yost DaveBook ~/p/c++/cmake/target-for-generate 241 Z% bundle `findf *` [ find CMakeLists.txt bar foo.cc http://foo.cc/ -type f ] #!/usr/bin/env unbundle # See http://yost.com/computers/bundle/ http://yost.com/computers/bundle/ CMakeLists.txt cmake_minimum_required(VERSION 3.2.1) project(yost-cmake-example) add_subdirectory(bar) add_executable (foo foo.cc http://foo.cc/) target_link_libraries(foo bar) bar/bar.hh extern char* str1; bar/CMakeLists.txt add_executable(genBar genBar.cc http://genbar.cc/) add_custom_command( OUTPUT bar.cc http://bar.cc/ COMMAND genBar bar.cc http://bar.cc/ DEPENDS genBar) add_library (bar SHARED bar.cc http://bar.cc/) target_include_directories(bar PUBLIC .) bar/genBar.cc http://genbar.cc/ #include iostream int main(int argc, char** argv) { std::cout #include \bar.hh\\n\n char str1array[] = \Hello!\;\n char* str1 = str1array;\n; return 0; } foo.cc http://foo.cc/ #include iostream #include bar.hh int main(int argc, char** argv) { std::cout str1 std::endl; return 0; } 0 Wed 14:15:57 yost DaveBook ~/p/c++/cmake/target-for-generate 242 Z% mkdir build 0 Wed 14:16:02 yost DaveBook ~/p/c++/cmake/target-for-generate 243 Z% cd build 0 Wed 14:16:03 yost DaveBook ~/p/c++/cmake/target-for-generate/build 244 Z% cmake .. -- The C compiler identification is AppleClang 6.0.0.657 -- The CXX compiler identification is AppleClang 6.0.0.657 -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /Users/yost/p/c++/cmake/target-for-generate/build 0 Wed 14:16:07 yost DaveBook ~/p/c++/cmake/target-for-generate/build 245 Z% make Scanning dependencies of target genBar [ 14%] Building CXX object bar/CMakeFiles/genBar.dir/genBar.cc.o [ 28%] Linking CXX executable genBar [ 28%] Built target genBar [ 42%] Generating bar.cc http://bar.cc/ Scanning dependencies of target bar [ 57%] Building CXX object bar/CMakeFiles/bar.dir/bar.cc.o [ 71%] Linking CXX shared library libbar.dylib [ 71%] Built target bar Scanning dependencies of target foo [ 85%] Building CXX object CMakeFiles/foo.dir/foo.cc.o [100%] Linking CXX executable foo [100%] Built target foo 0 Wed 14:16:09 yost DaveBook ~/p/c++/cmake/target-for-generate/build 246 Z% rm bar/bar.cc http://bar.cc/ 0 Wed 14:16:15 yost DaveBook ~/p/c++/cmake/target-for-generate/build 247 Z% make bar/bar.cc http://bar.cc/ make: *** No rule to make target `bar/bar.cc http://bar.cc/'. Stop. 2 Wed 14:16:24 yost DaveBook ~/p/c++/cmake/target-for-generate/build 248 Z% make bar.cc http://bar.cc/ make: *** No rule to make target `bar.cc http://bar.cc/'. Stop. 2 Wed 14:16:27 yost DaveBook ~/p/c++/cmake/target-for-generate/build 249 Z% cd bar 0 Wed 14:19:20 yost DaveBook ~/p/c++/cmake/target-for-generate/build/bar 253 Z% make bar.cc http://bar.cc/ make: *** No rule to make target `bar.cc http://bar.cc/'. Stop. 2 Wed 14:19:22 yost DaveBook ~/p/c++/cmake/target-for-generate/build/bar 254 Z% make bar.cc.o Generating bar.cc http://bar.cc/ Building CXX object bar/CMakeFiles
Re: [CMake] Not finding boost
On 2015-06-01, at 2:28 PM, Dave Yost d...@yost.com wrote: The boost I want is not in a normal location, but: Boost's include dir is first in my CPATH. Boost's lib dir is first in my LD_LIBRARY_PATH. Why doesn't cmake 3.2.2 find it? I'm not being picky about the version. In other words, why should I have to set BOOST_ROOT? It should be obvious where a boost is, even obvious where the one I want is. What am I missing? 0 Mon 19:13:25 yost DaveBook ~/p/c++/cmake/findboost/build 243 Z% cat ../CMakeLists.txt cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) project(findBoost CXX) find_package (Boost COMPONENTS program_options REQUIRED) if (NOT Boost_FOUND) message (FATAL_ERROR Could not find boost! ${BOOST_VERSION}) endif () message ( Boost_LIBRARY_DIR_DEBUG is ${Boost_LIBRARY_DIR_DEBUG}) 0 Mon 19:13:34 yost DaveBook ~/p/c++/cmake/findboost/build 244 Z% cmake --version cmake version 3.2.20150504-ga4a12 CMake suite maintained and supported by Kitware (kitware.com/cmake). 0 Mon 19:13:45 yost DaveBook ~/p/c++/cmake/findboost/build 245 Z% ls -l /usr/local/boost/1.55.0..llvm/include total 0 drwxrwxr-x 221 yost admin 7514 Mar 8 22:19 boost 0 Mon 19:13:51 yost DaveBook ~/p/c++/cmake/findboost/build 246 Z% CPATH=/usr/local/boost/1.55.0..llvm/include 0 Mon 19:13:53 yost DaveBook ~/p/c++/cmake/findboost/build 247 Z% ls -l /usr/local/boost/1.55.0..llvm/lib/libboost_program_options.* -rw-rw-r-- 1 yost admin 938312 Mar 8 22:19 /usr/local/boost/1.55.0..llvm/lib/libboost_program_options.a -rwxrwxr-x 1 yost admin 444236 Mar 8 22:18 /usr/local/boost/1.55.0..llvm/lib/libboost_program_options.dylib 0 Mon 19:14:18 yost DaveBook ~/p/c++/cmake/findboost/build 248 Z% LD_LIBRARY_PATH=/usr/local/boost/1.55.0..llvm/lib 0 Mon 19:14:22 yost DaveBook ~/p/c++/cmake/findboost/build 249 Z% DYLD_LIBRARY_PATH=/usr/local/boost/1.55.0..llvm/lib 0 Mon 19:14:25 yost DaveBook ~/p/c++/cmake/findboost/build 250 Z% cmake .. CMake Error at /Applications/CMake.app/Contents/share/cmake-3.2/Modules/FindBoost.cmake:1243 (message): Unable to find the requested Boost libraries. Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers. Call Stack (most recent call first): CMakeLists.txt:5 (find_package) CMake Error at CMakeLists.txt:10 (message): Could not find boost! -- Configuring incomplete, errors occurred! See also /Users/yost/p/c++/cmake/findboost/build/CMakeFiles/CMakeOutput.log. 1 Mon 19:14:46 yost DaveBook ~/p/c++/cmake/findboost/build 251 Z% -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Not finding boost
Also, from what I can make of CMake.app/Contents/share/cmake-3.2/Modules/FindBoost.cmake findBoost looks in /sw/local/ which is a path from the old, old Fink package system for OS X. findBoost should also look in /usr/local (Homebrew and long unix tradition) /opt/local (MacPorts) /opt/ (linux and others) On 2015-06-01, at 7:18 PM, Dave Yost d...@yost.com wrote: On 2015-06-01, at 2:28 PM, Dave Yost d...@yost.com mailto:d...@yost.com wrote: The boost I want is not in a normal location, but: Boost's include dir is first in my CPATH. Boost's lib dir is first in my LD_LIBRARY_PATH. Why doesn't cmake 3.2.2 find it? I'm not being picky about the version. In other words, why should I have to set BOOST_ROOT? It should be obvious where a boost is, even obvious where the one I want is. What am I missing? 0 Mon 19:13:25 yost DaveBook ~/p/c++/cmake/findboost/build 243 Z% cat ../CMakeLists.txt cmake_minimum_required (VERSION 3.2.2 FATAL_ERROR) project(findBoost CXX) find_package (Boost COMPONENTS program_options REQUIRED) if (NOT Boost_FOUND) message (FATAL_ERROR Could not find boost! ${BOOST_VERSION}) endif () message ( Boost_LIBRARY_DIR_DEBUG is ${Boost_LIBRARY_DIR_DEBUG}) 0 Mon 19:13:34 yost DaveBook ~/p/c++/cmake/findboost/build 244 Z% cmake --version cmake version 3.2.20150504-ga4a12 CMake suite maintained and supported by Kitware (kitware.com/cmake http://kitware.com/cmake). 0 Mon 19:13:45 yost DaveBook ~/p/c++/cmake/findboost/build 245 Z% ls -l /usr/local/boost/1.55.0..llvm/include total 0 drwxrwxr-x 221 yost admin 7514 Mar 8 22:19 boost 0 Mon 19:13:51 yost DaveBook ~/p/c++/cmake/findboost/build 246 Z% CPATH=/usr/local/boost/1.55.0..llvm/include 0 Mon 19:13:53 yost DaveBook ~/p/c++/cmake/findboost/build 247 Z% ls -l /usr/local/boost/1.55.0..llvm/lib/libboost_program_options.* -rw-rw-r-- 1 yost admin 938312 Mar 8 22:19 /usr/local/boost/1.55.0..llvm/lib/libboost_program_options.a -rwxrwxr-x 1 yost admin 444236 Mar 8 22:18 /usr/local/boost/1.55.0..llvm/lib/libboost_program_options.dylib 0 Mon 19:14:18 yost DaveBook ~/p/c++/cmake/findboost/build 248 Z% LD_LIBRARY_PATH=/usr/local/boost/1.55.0..llvm/lib 0 Mon 19:14:22 yost DaveBook ~/p/c++/cmake/findboost/build 249 Z% DYLD_LIBRARY_PATH=/usr/local/boost/1.55.0..llvm/lib 0 Mon 19:14:25 yost DaveBook ~/p/c++/cmake/findboost/build 250 Z% cmake .. CMake Error at /Applications/CMake.app/Contents/share/cmake-3.2/Modules/FindBoost.cmake:1243 (message): Unable to find the requested Boost libraries. Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers. Call Stack (most recent call first): CMakeLists.txt:5 (find_package) CMake Error at CMakeLists.txt:10 (message): Could not find boost! -- Configuring incomplete, errors occurred! See also /Users/yost/p/c++/cmake/findboost/build/CMakeFiles/CMakeOutput.log. 1 Mon 19:14:46 yost DaveBook ~/p/c++/cmake/findboost/build 251 Z% -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
[CMake] avoiding unnecessary rebuilds
Seems to me that it would be great if cmake could produce Makefiles that work like the proposal below. This approach can eliminate a lot of unnecessary downstream rebuilds. It is similar to how I imagine ccache https://ccache.samba.org/ works, but unlike ccache which is only for compiling C/C++, the approach should work for any kind of target production. It seems reasonable that cmake could do the work of generating rules to work like this, but it also might be possible that make and ninja could be made to work like this, optionally. Proposal For every target foo there will be a foo-stamp timestamp file. If foo-stamp doesn’t exist or is older than any of foo's dependencies # Build foo without clobbering the old foo. make-foo tmpdir/foo # See if what we made is different from the existing target. If tmpdir/foo ≠ foo, then mv -f tmpdir/foo foo # foo is now newer than it was and will cause downstream rebuilds. else rm -f tmpdir/foo # This is no longer needed, and foo is still its old self. # Prevent make-foo from having to run until a dependency is touched. touch foo-stamp -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
[CMake] no convenience target for generated files?
I’m using add_custom_command to generate a file, “bar.cc”. It would be convenient if I could say make bar.cc or make bar/bar.cc but neither of these work, and I can’t see a target in the Makefiles that I can use. There is a way to make bar.cc.o, but not bar.cc 0 Wed 14:15:54 yost DaveBook ~/p/c++/cmake/target-for-generate 241 Z% bundle `findf *` [ find CMakeLists.txt bar foo.cc -type f ] #!/usr/bin/env unbundle # See http://yost.com/computers/bundle/ CMakeLists.txt cmake_minimum_required(VERSION 3.2.1) project(yost-cmake-example) add_subdirectory(bar) add_executable (foo foo.cc) target_link_libraries(foo bar) bar/bar.hh extern char* str1; bar/CMakeLists.txt add_executable(genBar genBar.cc) add_custom_command( OUTPUT bar.cc COMMAND genBar bar.cc DEPENDS genBar) add_library (bar SHARED bar.cc) target_include_directories(bar PUBLIC .) bar/genBar.cc #include iostream int main(int argc, char** argv) { std::cout #include \bar.hh\\n\n char str1array[] = \Hello!\;\n char* str1 = str1array;\n; return 0; } foo.cc #include iostream #include bar.hh int main(int argc, char** argv) { std::cout str1 std::endl; return 0; } 0 Wed 14:15:57 yost DaveBook ~/p/c++/cmake/target-for-generate 242 Z% mkdir build 0 Wed 14:16:02 yost DaveBook ~/p/c++/cmake/target-for-generate 243 Z% cd build 0 Wed 14:16:03 yost DaveBook ~/p/c++/cmake/target-for-generate/build 244 Z% cmake .. -- The C compiler identification is AppleClang 6.0.0.657 -- The CXX compiler identification is AppleClang 6.0.0.657 -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /Users/yost/p/c++/cmake/target-for-generate/build 0 Wed 14:16:07 yost DaveBook ~/p/c++/cmake/target-for-generate/build 245 Z% make Scanning dependencies of target genBar [ 14%] Building CXX object bar/CMakeFiles/genBar.dir/genBar.cc.o [ 28%] Linking CXX executable genBar [ 28%] Built target genBar [ 42%] Generating bar.cc Scanning dependencies of target bar [ 57%] Building CXX object bar/CMakeFiles/bar.dir/bar.cc.o [ 71%] Linking CXX shared library libbar.dylib [ 71%] Built target bar Scanning dependencies of target foo [ 85%] Building CXX object CMakeFiles/foo.dir/foo.cc.o [100%] Linking CXX executable foo [100%] Built target foo 0 Wed 14:16:09 yost DaveBook ~/p/c++/cmake/target-for-generate/build 246 Z% rm bar/bar.cc 0 Wed 14:16:15 yost DaveBook ~/p/c++/cmake/target-for-generate/build 247 Z% make bar/bar.cc make: *** No rule to make target `bar/bar.cc'. Stop. 2 Wed 14:16:24 yost DaveBook ~/p/c++/cmake/target-for-generate/build 248 Z% make bar.cc make: *** No rule to make target `bar.cc'. Stop. 2 Wed 14:16:27 yost DaveBook ~/p/c++/cmake/target-for-generate/build 249 Z% cd bar 0 Wed 14:19:20 yost DaveBook ~/p/c++/cmake/target-for-generate/build/bar 253 Z% make bar.cc make: *** No rule to make target `bar.cc'. Stop. 2 Wed 14:19:22 yost DaveBook ~/p/c++/cmake/target-for-generate/build/bar 254 Z% make bar.cc.o Generating bar.cc Building CXX object bar/CMakeFiles/bar.dir/bar.cc.o 0 Wed 14:19:25 yost DaveBook ~/p/c++/cmake/target-for-generate/build/bar 255 Z% -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
[CMake] commands
Learning and understanding cmake would be a lot easier if the cmake-commands http://www.cmake.org/cmake/help/v3.2/manual/cmake-commands.7.html page would have two columns. On the left, the alphabetic listing, available now. On the right, commands grouped by category. Here’s a category: if http://www.cmake.org/cmake/help/v3.2/command/if.html elseif http://www.cmake.org/cmake/help/v3.2/command/elseif.html else http://www.cmake.org/cmake/help/v3.2/command/else.html endif http://www.cmake.org/cmake/help/v3.2/command/endif.html foreach http://www.cmake.org/cmake/help/v3.2/command/foreach.html endforeach http://www.cmake.org/cmake/help/v3.2/command/endforeach.html while http://www.cmake.org/cmake/help/v3.2/command/while.html endwhile http://www.cmake.org/cmake/help/v3.2/command/endwhile.html continue http://www.cmake.org/cmake/help/v3.2/command/continue.html break http://www.cmake.org/cmake/help/v3.2/command/break.html function http://www.cmake.org/cmake/help/v3.2/command/function.html endfunction http://www.cmake.org/cmake/help/v3.2/command/endfunction.html macro http://www.cmake.org/cmake/help/v3.2/command/macro.html endmacro http://www.cmake.org/cmake/help/v3.2/command/endmacro.html-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
[CMake] nonstandard C++ source filename extension
From what I can glean online, I’ve tried this: set_source_files_properties(foo.bar PROPERTIES LANGUAGE CXX) add_executable(foo foo.bar) set_target_properties(foo PROPERTIES LINKER_LANGUAGE CXX) but it doesn’t work. What am I missing? 0 Mon 20:16:15 yost 1181 Z% cat CMakeLists.txt cmake_minimum_required(VERSION 3.0 FATAL_ERROR) project(asm CXX) set_source_files_properties(foo.bar PROPERTIES LANGUAGE CXX) add_executable(foo foo.bar) set_target_properties(foo PROPERTIES LINKER_LANGUAGE CXX) 0 Mon 20:16:43 yost 1182 Z% cat foo.bar #include iostream int main(int argc, char* argv[]) { std::cout Hello\\n; return 0; } 0 Mon 20:16:46 yost 1183 Z% cd build ; cmake .. -- The CXX compiler identification is GNU 4.9.2 -- Checking whether CXX compiler has -isysroot -- Checking whether CXX compiler has -isysroot - yes -- Checking whether CXX compiler supports OSX deployment target flag -- Checking whether CXX compiler supports OSX deployment target flag - yes -- Check for working CXX compiler: /opt/local/bin/c++ -- Check for working CXX compiler: /opt/local/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /Users/yost/p/c++/cmake/asm/build 0 Mon 20:16:58 yost 1184 Z% make Scanning dependencies of target foo [100%] Building CXX object CMakeFiles/foo.dir/foo.bar.o c++: warning: /Users/yost/p/c++/cmake/asm/foo.bar: linker input file unused because linking not done Linking CXX executable foo c++: error: CMakeFiles/foo.dir/foo.bar.o: No such file or directory CMakeFiles/foo.dir/build.make:85: recipe for target 'foo' failed make[2]: *** [foo] Error 1 CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/foo.dir/all' failed make[1]: *** [CMakeFiles/foo.dir/all] Error 2 Makefile:75: recipe for target 'all' failed make: *** [all] Error 2 2 Mon 20:17:01 yost 1185 Z% rm -rf * ; cmake .. zsh: sure you want to delete all the files in /Users/yost/p/c++/cmake/asm/build [yn]? y -- The CXX compiler identification is GNU 4.9.2 -- Checking whether CXX compiler has -isysroot -- Checking whether CXX compiler has -isysroot - yes -- Checking whether CXX compiler supports OSX deployment target flag -- Checking whether CXX compiler supports OSX deployment target flag - yes -- Check for working CXX compiler: /opt/local/bin/c++ -- Check for working CXX compiler: /opt/local/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /Users/yost/p/c++/cmake/asm/build 0 Mon 20:23:00 yost 1201 Z% make VERBOSE=1 /Applications/CMake.app/Contents/bin/cmake -H/Users/yost/p/c++/cmake/asm -B/Users/yost/p/c++/cmake/asm/build --check-build-system CMakeFiles/Makefile.cmake 0 /Applications/CMake.app/Contents/bin/cmake -E cmake_progress_start /Users/yost/p/c++/cmake/asm/build/CMakeFiles /Users/yost/p/c++/cmake/asm/build/CMakeFiles/progress.marks make -f CMakeFiles/Makefile2 all make[1]: Entering directory '/Users/yost/p/c++/cmake/asm/build' make -f CMakeFiles/foo.dir/build.make CMakeFiles/foo.dir/depend make[2]: Entering directory '/Users/yost/p/c++/cmake/asm/build' cd /Users/yost/p/c++/cmake/asm/build /Applications/CMake.app/Contents/bin/cmake -E cmake_depends Unix Makefiles /Users/yost/p/c++/cmake/asm /Users/yost/p/c++/cmake/asm /Users/yost/p/c++/cmake/asm/build /Users/yost/p/c++/cmake/asm/build /Users/yost/p/c++/cmake/asm/build/CMakeFiles/foo.dir/DependInfo.cmake --color= Dependee /Users/yost/p/c++/cmake/asm/build/CMakeFiles/foo.dir/DependInfo.cmake is newer than depender /Users/yost/p/c++/cmake/asm/build/CMakeFiles/foo.dir/depend.internal. Dependee /Users/yost/p/c++/cmake/asm/build/CMakeFiles/CMakeDirectoryInformation.cmake is newer than depender /Users/yost/p/c++/cmake/asm/build/CMakeFiles/foo.dir/depend.internal. Scanning dependencies of target foo make[2]: Leaving directory '/Users/yost/p/c++/cmake/asm/build' make -f CMakeFiles/foo.dir/build.make CMakeFiles/foo.dir/build make[2]: Entering directory '/Users/yost/p/c++/cmake/asm/build' /Applications/CMake.app/Contents/bin/cmake -E cmake_progress_report /Users/yost/p/c++/cmake/asm/build/CMakeFiles 1 [100%] Building CXX object CMakeFiles/foo.dir/foo.bar.o /opt/local/bin/c++ -o CMakeFiles/foo.dir/foo.bar.o -c /Users/yost/p/c++/cmake/asm/foo.bar c++: warning: /Users/yost/p/c++/cmake/asm/foo.bar: linker input file unused because linking not done Linking CXX executable foo /Applications/CMake.app/Contents/bin/cmake -E cmake_link_script CMakeFiles/foo.dir/link.txt --verbose=1 /opt/local/bin/c++-Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/foo.dir/foo.bar.o -o foo c++: error: CMakeFiles/foo.dir/foo.bar.o: No such file or directory
[CMake] make output two two streams: concise to stdout and verbose to a file
When I do an ordinary make, it would be nice if in addition to the the concise output going to the screen, verbose output would go to a file in the root of the build folder. This way, after the fact I can see exactly what happened with the build I just did. If I have to build again with VERBOSE=1, it’s extra trouble and time, and and the initial condition likelly is different. This feature would be especially convenient in an IDE where setting VERBOSE=1 and then unsetting it again is cumbersome. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
[CMake] cmake picks a compiler
Hi. In our CMakeLists.txt file we want to force the user to pick a c++ compiler explicitly, something like this: if (NOT DEFINED CMAKE_CXX_COMPILER) set(CMAKE_CXX_COMPILER $ENV{CXX}) if (NOT DEFINED CMAKE_CXX_COMPILER) message(FATAL_ERROR You must choose your compiler, in one of two ways: cmake -DCMAKE_CXX_COMPILER=/path/to/compiler++ CXX=/path/to/compiler++ cmake) endif() endif() message(CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}) Problem is, CMAKE_CXX_COMPILER is already set because cmake looked around and picked a compiler (which causes a lot of messages to be output before cmake executes the above statements). Z% CMAKE_CXX_COMPILER=/usr/bin/clang++ cmake .. -- The CXX compiler identification is GNU 4.9.2 -- Checking whether CXX compiler has -isysroot -- Checking whether CXX compiler has -isysroot - yes -- Checking whether CXX compiler supports OSX deployment target flag -- Checking whether CXX compiler supports OSX deployment target flag - yes -- Check for working CXX compiler: /opt/local/bin/c++ -- Check for working CXX compiler: /opt/local/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done CMAKE_CXX_COMPILER: /opt/local/bin/c++ I need a command I can put in my CMakeLists.txt file to disable the cmake feature that automatically locates a c++ compiler. Thanks-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
[CMake] finding boost
Hi. I’m having trouble with the find_package documentation w.r.t. boost. I can’t divine how to get find_package to look for boost in various places it might be on the various systems where we do builds. I know boost looks in several places, but I need to add to that list. Boost might be in any of these places /usr/local/include/boost /usr/local/boost/1.57.0/include /usr/local/boost/1.56.0/include etc. /opt/local/include/boost /opt/local/var/macports/build/_private_tmp_boost149_boost/boost/work/boost_1_49_0/boost/ I tried modifying this in various ways according to the docs to no avail. find_package(Boost ${BOOST_VERSION} EXACT COMPONENTS filesystem program_options serialization system REQUIRED) Thanks -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
[CMake] creating a DLL with an OpenCV dependency
Hi. I can’t divine how to get find_package to look for boost in the various places it might be on the various systems where we do builds. Boost might be in any of these places /usr/local/include/boost /usr/local/boost/1.57.0/include /usr/local/boost/1.56.0/include etc. /opt/local/include/boost /opt/local/var/macports/build/_private_tmp_boost149_boost/boost/work/boost_1_49_0/boost/ I tried modifying this in various ways according to the docs to no avail. find_package(Boost ${BOOST_VERSION} EXACT COMPONENTS filesystem program_options serialization system REQUIRED) Thanks -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake