Re: [CMake] OS X framework headers with capital letters
Not to be picky, but the issue of case sensitivity ignores the original question. If it helps someone think about the issue better, change: set(FOO_HEADER_FILES foo.h;bar.h;bat.h;Foo.h;Foo.hpp) to set(FOO_HEADER_FILES bar.h;bat.h;Foo.h;Foo.hpp) Thanks, Steve On Tue, Jul 21, 2015 at 10:59 AM, Michael Jackson mike.jack...@bluequartz.net wrote: to be very precise, OS X is a Case Preserving but NOT Case sensitive be default. OS X can be made to be case sensitive but no one actually recommends it. this means that on OS X foo.h and Foo.h resolve to be the same file, where as on Linux they would be 2 different files. You would have the same issues on Windows. Mike Jackson On Jul 21, 2015, at 10:35 AM, Dan Kegel d...@kegel.com wrote: It can't installiert both foo.h and Foo.h in the mac, better correct your example. Am 21.07.2015 5:19 vorm. schrieb Steven Wilson steven.wesley.wil...@gmail.com: I've noticed that CMake 3.3.0-rc3 will not install a header file in a Mac OS X framework if the header file starts with a capital letter (either that or has the same name as the framework). For example if I have the following: set(FOO_HEADER_FILES foo.h;bar.h;bat.h;Foo.h;Foo.hpp) add_library(Foo SHARED ${FOO_SOURCE_FILES}) set_target_properties(Foo PROPERTIES FRAMEWORK ON OUTPUT_NAME Foo PUBLIC_HEADER ${FOO_HEADER_FILES} ) install(TARGETS Foo FRAMEWORK DESTINATION frameworks) Then when running 'make install' or the install target from Xcode, the installation step silently does not install Foo.h or Foo.hpp. This behavior seems arbitrary, wrong, and completely annoying. Comments? -- 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 -- 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] OS X framework headers with capital letters
I am saying the file does not exist in the either installed framework or in the framework in the build directory. CMake is not moving the header files that start with a capital letter into the framework headers directory. Now I did double check and it *is* moving the .hpp header that matches the name of the framework (Foo.hpp in the example case), but it is not copying Foo.h.In addition I tried adding two more arbitrary headers called AnotherHeader.h and AnotherHeader.hpp and neither of those get included in the framework either. The example I have posted is just an example. My actual source files do not share names where case sensitivity is a problem. The file names in the real project do not collide in any form. I am running on a a Mac with the HFS+ system without case sensitivity. On Tue, Jul 21, 2015 at 12:51 PM, David Cole dlrd...@aol.com wrote: Are you saying the file does not exist in the installed framework, or that you do not see copying Foo.h in the install output ...? This seems very unlikely. The header files are supposed to be in the framework in the build tree, and the built framework in its entirety is supposed to be recursively copied at install time ... Are you running on a Mac volume with a case sensitive file system or not? Are the source header files in question named with the case you've listed in the CMakeLists file? Does this reproduce if you add another header file named AnotherHeader.h and add it into the mix, say listing it first in the list of header files? On Tue, Jul 21, 2015 at 12:15 PM, Steven Wilson steven.wesley.wil...@gmail.com wrote: Not to be picky, but the issue of case sensitivity ignores the original question. If it helps someone think about the issue better, change: set(FOO_HEADER_FILES foo.h;bar.h;bat.h;Foo.h;Foo.hpp) to set(FOO_HEADER_FILES bar.h;bat.h;Foo.h;Foo.hpp) Thanks, Steve On Tue, Jul 21, 2015 at 10:59 AM, Michael Jackson mike.jack...@bluequartz.net wrote: to be very precise, OS X is a Case Preserving but NOT Case sensitive be default. OS X can be made to be case sensitive but no one actually recommends it. this means that on OS X foo.h and Foo.h resolve to be the same file, where as on Linux they would be 2 different files. You would have the same issues on Windows. Mike Jackson On Jul 21, 2015, at 10:35 AM, Dan Kegel d...@kegel.com wrote: It can't installiert both foo.h and Foo.h in the mac, better correct your example. Am 21.07.2015 5:19 vorm. schrieb Steven Wilson steven.wesley.wil...@gmail.com: I've noticed that CMake 3.3.0-rc3 will not install a header file in a Mac OS X framework if the header file starts with a capital letter (either that or has the same name as the framework). For example if I have the following: set(FOO_HEADER_FILES foo.h;bar.h;bat.h;Foo.h;Foo.hpp) add_library(Foo SHARED ${FOO_SOURCE_FILES}) set_target_properties(Foo PROPERTIES FRAMEWORK ON OUTPUT_NAME Foo PUBLIC_HEADER ${FOO_HEADER_FILES} ) install(TARGETS Foo FRAMEWORK DESTINATION frameworks) Then when running 'make install' or the install target from Xcode, the installation step silently does not install Foo.h or Foo.hpp. This behavior seems arbitrary, wrong, and completely annoying. Comments? -- 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 -- 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
Re: [CMake] OS X framework headers with capital letters
Thanks David, That change appears to have corrected the issue. Steve On Tue, Jul 21, 2015 at 4:30 PM, David Cole dlrd...@aol.com wrote: Try putting ${FOO_HEADER_FILES} in the add_library call, too. I reproduced this by adding a file, with **ANY** name, to the PUBLIC_HEADER list of the [CMake/Tests/Framework/CMakeLists.txt]( https://github.com/Kitware/CMake/blob/master/Tests/Framework/CMakeLists.txt ) file... but NOT adding it to the list of sources given to add_library. It would appear from this experiment that the header files for a framework must be listed as sources of the library **and** added to the PUBLIC_HEADER target property. (I am guessing that you have the other header files that are working already in your FOO_SOURCE_FILES variable. Either that, or I'm missing something still...) HTH, David C. On Tue, Jul 21, 2015 at 1:39 PM, Steven Wilson steven.wesley.wil...@gmail.com wrote: I am saying the file does not exist in the either installed framework or in the framework in the build directory. CMake is not moving the header files that start with a capital letter into the framework headers directory. Now I did double check and it *is* moving the .hpp header that matches the name of the framework (Foo.hpp in the example case), but it is not copying Foo.h. In addition I tried adding two more arbitrary headers called AnotherHeader.h and AnotherHeader.hpp and neither of those get included in the framework either. The example I have posted is just an example. My actual source files do not share names where case sensitivity is a problem. The file names in the real project do not collide in any form. I am running on a a Mac with the HFS+ system without case sensitivity. On Tue, Jul 21, 2015 at 12:51 PM, David Cole dlrd...@aol.com wrote: Are you saying the file does not exist in the installed framework, or that you do not see copying Foo.h in the install output ...? This seems very unlikely. The header files are supposed to be in the framework in the build tree, and the built framework in its entirety is supposed to be recursively copied at install time ... Are you running on a Mac volume with a case sensitive file system or not? Are the source header files in question named with the case you've listed in the CMakeLists file? Does this reproduce if you add another header file named AnotherHeader.h and add it into the mix, say listing it first in the list of header files? On Tue, Jul 21, 2015 at 12:15 PM, Steven Wilson steven.wesley.wil...@gmail.com wrote: Not to be picky, but the issue of case sensitivity ignores the original question. If it helps someone think about the issue better, change: set(FOO_HEADER_FILES foo.h;bar.h;bat.h;Foo.h;Foo.hpp) to set(FOO_HEADER_FILES bar.h;bat.h;Foo.h;Foo.hpp) Thanks, Steve On Tue, Jul 21, 2015 at 10:59 AM, Michael Jackson mike.jack...@bluequartz.net wrote: to be very precise, OS X is a Case Preserving but NOT Case sensitive be default. OS X can be made to be case sensitive but no one actually recommends it. this means that on OS X foo.h and Foo.h resolve to be the same file, where as on Linux they would be 2 different files. You would have the same issues on Windows. Mike Jackson On Jul 21, 2015, at 10:35 AM, Dan Kegel d...@kegel.com wrote: It can't installiert both foo.h and Foo.h in the mac, better correct your example. Am 21.07.2015 5:19 vorm. schrieb Steven Wilson steven.wesley.wil...@gmail.com: I've noticed that CMake 3.3.0-rc3 will not install a header file in a Mac OS X framework if the header file starts with a capital letter (either that or has the same name as the framework). For example if I have the following: set(FOO_HEADER_FILES foo.h;bar.h;bat.h;Foo.h;Foo.hpp) add_library(Foo SHARED ${FOO_SOURCE_FILES}) set_target_properties(Foo PROPERTIES FRAMEWORK ON OUTPUT_NAME Foo PUBLIC_HEADER ${FOO_HEADER_FILES} ) install(TARGETS Foo FRAMEWORK DESTINATION frameworks) Then when running 'make install' or the install target from Xcode, the installation step silently does not install Foo.h or Foo.hpp. This behavior seems arbitrary, wrong, and completely annoying. Comments? -- 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
[CMake] OS X framework headers with capital letters
I've noticed that CMake 3.3.0-rc3 will not install a header file in a Mac OS X framework if the header file starts with a capital letter (either that or has the same name as the framework). For example if I have the following: set(FOO_HEADER_FILES foo.h;bar.h;bat.h;Foo.h;Foo.hpp) add_library(Foo SHARED ${FOO_SOURCE_FILES}) set_target_properties(Foo PROPERTIES FRAMEWORK ON OUTPUT_NAME Foo PUBLIC_HEADER ${FOO_HEADER_FILES} ) install(TARGETS Foo FRAMEWORK DESTINATION frameworks) Then when running 'make install' or the install target from Xcode, the installation step silently does not install Foo.h or Foo.hpp. This behavior seems arbitrary, wrong, and completely annoying. Comments? -- 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] Custom Commands Generator Expressions
Consider the following CMakeLists.txt file (on a Mac, 10.9.1, Xcode 5, Unix Makefiles generator): cmake_minimum_required(VERSION 2.8.12) project(CustomCommandTest) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test.cpp COMMAND echo #include iostream ${CMAKE_CURRENT_BINARY_DIR}/test.cpp COMMAND echo ${CMAKE_CURRENT_BINARY_DIR}/test.cpp COMMAND echo int main() ${CMAKE_CURRENT_BINARY_DIR}/test.cpp COMMAND echo { ${CMAKE_CURRENT_BINARY_DIR}/test.cpp COMMAND echo std::cout \Hello World\ std::endl; ${CMAKE_CURRENT_BINARY_DIR}/test.cpp COMMAND echo return 0; ${CMAKE_CURRENT_BINARY_DIR}/test.cpp COMMAND echo } ${CMAKE_CURRENT_BINARY_DIR}/test.cpp COMMAND echo ${CMAKE_CURRENT_BINARY_DIR}/test.cpp VERBATIM ) add_executable(customcommandtest ${CMAKE_CURRENT_BINARY_DIR}/test.cpp) add_custom_command(TARGET customcommandtest POST_BUILD COMMAND $$CONFIG:Release:strip -u -r customcommandtest ) The custom command for the POST_BUILD step should invoke strip to strip the binary of symbols. Instead the following output is produced: Linking CXX executable customcommandtest /Users/stevew/cmake/install/bin/cmake -E cmake_link_script CMakeFiles/customcommandtest.dir/link.txt --verbose=1 /usr/bin/c++ -O3 -DNDEBUG -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/customcommandtest.dir/test.cpp.o -o customcommandtest \$1:strip -u -r customcommandtest Note the \$1:strip -u -r customcommandtest output from the generator expression. What do I need to change in the POST_BUILD custom command to make the generator expression work correctly? Thanks, Steve -- 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://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Custom Commands Generator Expressions
Ok. Thanks for the help! I'll take a look at bug #14353 as I have time. On Wed, Jan 29, 2014 at 2:13 PM, Stephen Kelly steve...@gmail.com wrote: Steven Wilson wrote: \$1:strip -u -r customcommandtest Note the \$1:strip -u -r customcommandtest output from the generator expression. What do I need to change in the POST_BUILD custom command to make the generator expression work correctly? The generator expression stops parsing at whitespace. I believe you're hitting a problem related to what is discussed in this thread: http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/7063 It will require patching CMake, but there is no one working on a patch yet. http://public.kitware.com/Bug/view.php?id=14353 Thanks, Steve. -- 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://www.cmake.org/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://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Ninja + CMake on a dashboard?
Where does the Ninja generator currently live? Ie which branch in the sources, etc? I am keen to see support for the Ninja generator on Mac/Linux/Windows and would not mind working on it. Thanks, Steve 2012/3/8 Peter Collingbourne pe...@pcc.me.uk On Wed, Mar 07, 2012 at 07:14:52AM +0100, Nicolas Desprès wrote: On Tue, Mar 6, 2012 at 8:58 PM, Clifford Yapp cliffy...@gmail.com wrote: We *could*, if popular demand is high enough, merge it in anyway and call it experimental to start with, or we could get it right all the way before we merge to 'master' and put it out in an official CMake release. What would be involved with fixing the remaining OSX issues? Do we need CMake changes, ninja changes, both...? Obviously full support would be preferable, unless it won't be happening for quite some time - I would agree that if non-GUI apps won't work on OSX it would be better to limit an activation of Ninja to those platforms where it will Work As Expected. So contrary to what I have said at the beginning of this thread. It seems that merging it master will generate more bug report than patches to fix the issue. If it is the case, I prefer to disable it. I will try to fix them ASAP anyway. It seems that public opinion is against me. Well, I guess we can disable the Ninja generator by default on Mac. Anyone who wants to turn it back on should be able to use an internal CMake variable when building CMake. Thanks, -- Peter -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] symbolic links
Thanks Eric, This solution should work and Unix is the only place where I need this to happen anyway. On Fri, Feb 17, 2012 at 12:23 PM, Eric Noulard eric.noul...@gmail.comwrote: 2012/2/17 Steven Wilson steven.wesley.wil...@gmail.com: I have a large software system that depends on third party libraries. The CMake system that builds this software uses install() to copy these libraries into the appropriate place in the layout. On some systems I would like to provide my developers with the option of not copying these libraries and instead creating symbolic links to the libraries in the software layout. Using symbolic links would save a great deal of disk space for developers when they have many different versions(debug, profile, etc...) of the software build system.Is there a way to create symbolic links to files rather than copy files at install time? You could certainly achieve that using install(CODE or install(SCRIPT and execute_process with cmake -E create_symlink that said it will only work on unix. -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] OS X QT Gui build question
When building the 2.8.7 CMake sources with the following configuration: cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=../path/to/install -DBUILD_QtDialog:BOOL=ON ../cmake I get the following error when doing a 'make install' - Installing: /Users/stevew/cmake/tmp/build/../install/CMake 2.8-7.app/Contents/share/mime/packages/cmakecache.xml -- fixup_bundle -- app='../install/CMake 2.8-7.app/Contents/MacOS/CMake 2.8-7' -- libs='' -- dirs='/Library/Frameworks;/Developer/Tools/Qt' -- warning: *NOT* handled - directory/file does not exist... CMake Error at /Users/stevew/cmake/tmp/cmake/Modules/BundleUtilities.cmake:668 (message): error: fixup_bundle: not a valid bundle Call Stack (most recent call first): Source/QtDialog/cmake_install.cmake:54 (fixup_bundle) Source/cmake_install.cmake:86 (INCLUDE) cmake_install.cmake:52 (INCLUDE) I would appreciate any advice on how to correct this problem. Thanks, Steve -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Xcode 4 and FOLDER target properties
I was able to get the FOLDER working with the following form: set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(TARGET target PROPERTY FOLDER value) The following construct does not work (in either Visual Studio or Xcode): set_target_properties(target PROPERTY FOLDER value) In Xcode 4, the FOLDER property arranges the list of project folders in the project browser. Is there a mechanism for grouping the target names in the IDE pull down list of build targets? On Sat, Oct 1, 2011 at 11:57 AM, David Cole david.c...@kitware.com wrote: On Tue, Sep 27, 2011 at 1:15 PM, Steven Wilson steven.wesley.wil...@gmail.com wrote: Using the Xcode generator, the FOLDER property of targets appears to do nothing. Is this behavior simply a function a Xcode not supporting groupings of targets or will support be added in 2.8.6? I will have to investigate this... It should work. This commit, which is included in the CMake 2.8.5 release that is out there right now, added the FOLDER support for Xcode: http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca1082a8be5890a6d2096b505ebe584fc2b7 Perhaps more code is needed... What version of CMake and Xcode are you using? Thx, David C. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Xcode 4 and FOLDER target properties
Using the Xcode generator, the FOLDER property of targets appears to do nothing. Is this behavior simply a function a Xcode not supporting groupings of targets or will support be added in 2.8.6? Thanks, Steve -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Cross compilation question
In my CMake configuration files I have something like the following: if(SYSTEM STREQUAL iOS) set(CMAKE_C_COMPILER foo CACHE STRING message FORCE) set(CMAKE_CXX_COMPILER bar CACHE STRING message FORCE) endif(SYSTEM STREQUAL iOS) Then when configuring the system I pass -DSYSTEM:STRING=iOS on the command line (or through a GUI). For my iOS system I use the makefile generator. Steve 2011/2/15 Alexander Neundorf a.neundorf-w...@gmx.net On Monday 14 February 2011, Steven Wilson wrote: My apologies if this question has been asked and answered previously. I have a CMake system that I use for cross compilation for iOS software (ie reset CMAKE_C_COMPILER, etc...). How do you do that ? You have to set CMAKE_C_COMPILER, CMAKE_CXX_COMPILER and CMAKE_SYSTEM_NAME. And they have to be set so that they stay the same later on, e.g. by using a toolchain file. Do you do it that way or in some other way ? Do you use the makefile generator or xcode ? Alex ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Cross compilation question
I haven't done anything with toolchains. I will take a look at the page and give it a go. Thanks, Steve On Tue, Feb 15, 2011 at 3:16 PM, Peter Kümmel syntheti...@gmx.net wrote: On 15.02.2011 22:52, Steven Wilson wrote: In my CMake configuration files I have something like the following: if(SYSTEM STREQUAL iOS) set(CMAKE_C_COMPILER foo CACHE STRING message FORCE) set(CMAKE_CXX_COMPILER bar CACHE STRING message FORCE) endif(SYSTEM STREQUAL iOS) Do you know this wiki page: http://www.cmake.org/Wiki/CMake_Cross_Compiling I never had such problems you describe by writing a small toolchain file and initially pass it to cmake by -DCMAKE_TOOLCHAIN_FILE=... Later on I only call cmake . Peter ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Cross compilation question
My apologies if this question has been asked and answered previously.I have a CMake system that I use for cross compilation for iOS software (ie reset CMAKE_C_COMPILER, etc...). Everything works great, except for the following usage scenario: 1. configure build system for iOS build. 2. build 3. developer updates one of the CMakeLists.txt files for the system. 3. try to build again. At this point CMake has to re-configure/re-generate the build system, but when it does, it prints out a message stating that the the C compilers have changed and then tries to reconfigure the system with default settings for the compilers, compiler flags, linker flags, etc... I need to know how to force CMake to not try and switch back to the default compilers, et al and instead use the settings that were used when the system was first configured and generated. Any suggestions? Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] undefining preprocessor macros
Using set_target_properties() we can set the COMPILE_DEFINITIONS target property to easily define preprocessor macros for our build. Is there a mechanism to undefine preprocessor macros (equivalent to -U for many Unix compilers or /U for Microsoft's compilers)? Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] check_c_source_compiles question
The following variables exist for passing parameters to check_c_source_compiles: CMAKE_REQUIRED_FLAGS CMAKE_REQUIRED_DEFINITIONS CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES Why do we not have CMAKE_REQUIRED_LINK_DIRECTORIES or some such equivalent? On Unix I can make the check_c_source_compiles work by appending -L/path/to/library to the value of CMAKE_REQUIRED_FLAGS. On Windows, this trick doesn't (with the correct compiler flags) seem to work. I end up getting errors about missing source file names, etc when check_c_source_compiles runs. How can I reliably pass the list of library directories? ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] try_compile question
The CMake 2.8.0 documentation for try_compile() states: Some extra flags that can be included are, INCLUDE_DIRECTORIES, LINK_DIRECTORIES, and LINK_LIBRARIES. I need to know how to actually set those values so that try_compile() makes use of them. The documentation does not make it clear if they are arguments to try_compile() or should be set in some other way. I have tried setting -DINCLUDE_DIRECTORIES:STRING=${DIRECTORIES} in the arguments to CMAKE_FLAGS to try_compile(), but in the case where ${DIRECTORIES} contains a list, only one value of the list makes it into the Cache of the output build system. I'ld appreciate any insight that you might have to offer. Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] try_compile question
I think that will work. I will give it a shot and if not will ask more questions later. I didn't know check_c_source_compiles() existed. Thanks for the tip! Steve 2010/5/4 Alexander Neundorf a.neundorf-w...@gmx.net On Tuesday 04 May 2010, Steven Wilson wrote: The CMake 2.8.0 documentation for try_compile() states: Some extra flags that can be included are, INCLUDE_DIRECTORIES, LINK_DIRECTORIES, and LINK_LIBRARIES. I'd recommend not to use try_compile() directly. Did you try check_c_source_compiles() ? This is more high level. Does that work for you ? Alex ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] C/C++ dependency scanner
Hey all, I have a large project whose source files start as files with an alternate extension (.bc). Those files are mostly generic C files that have some C++ like features that are preprocessed into vanilla C files using a custom C pre-processor. My project uses an add_custom_command() call to put the file through the necessary steps to go from .bc to a .c file.By the time it becomes a .c file, the C preprocessor(and the custom preprocessor) has already run and all the header files, etc have been put into the .c file. I need a way to generate a list of dependencies (ie header files) for the original .bc file so that my add_custom_command() call can use those file names in the DEPEND section so that the .c file gets regenerated correctly when any of the dependencies change. I know different techniques for getting this information into CMake once the list is compiled for any give source file, but I'm not sure how to generate the list. Can CMake's C dependency scanner be invoked (using cmake -E cmake_depends) to create this kind of list. The .bc files are generic C (from a preprocessor scanning point of view) so CMake's dependency scanner should be able to produce this information.If cmake -E cmake_depends cannot function for this task, does anyone know of another tool that could be forced into service for this type of functionality? Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] C/C++ dependency scanner
That's an interesting idea. Would this step attach the dependencies to the .c file or the .bc file? On Thu, Mar 18, 2010 at 7:49 PM, Bill Hoffman bill.hoff...@kitware.comwrote: I have a hack of an idea that might work If you could changed your bc - c generator to put in the #include lines , but with if blockers around it: #if FOOL_CMAKE_DEPEND_SCANNER #include foo.h #include bar.h #endif Since CMake ignores #if directives will depend on foo and bar, but the c compiler will not expand them. -Bill ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Xcode and ReRunCMake.make
Reported as bug #10151. Steve On Thu, Jan 14, 2010 at 5:57 PM, Bill Hoffman bill.hoff...@kitware.comwrote: Steven Wilson wrote: The mechanism that creates the ReRunCMake.make file seems to not correctly gather all the dependent CMakeLists.txt files from a project. For example if you have the following source tree: src/ - CMakeLists.txt - A/ - CMakeLists.txt - B/ - CMakeLists.txt where the src/CMakeLists.txt file calls add_subdirectory(A) and add_subdirectory(B), then CMake only includes the src/CMakeLists.txt file in the file dependency list in ReRunCMake.make file. The A/CMakeLists.txt and B/CMakeLists.txt files do not get included.Interestingly enough, these files do get added to ReRunCMake.make but get overwritten each time CMake processes another CMakeLists.txt file. As a result, if I change CMakeLists.txt in either the A or B directories, the Xcode project does not re-run CMake to regenerate the the project files and the Xcode project does not get updated correctly. Any help would be appreciated, thanks, Sounds like a bug... Can you create a bug report? -Bill ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Xcode and ReRunCMake.make
The mechanism that creates the ReRunCMake.make file seems to not correctly gather all the dependent CMakeLists.txt files from a project. For example if you have the following source tree: src/ - CMakeLists.txt - A/ - CMakeLists.txt - B/ - CMakeLists.txt where the src/CMakeLists.txt file calls add_subdirectory(A) and add_subdirectory(B), then CMake only includes the src/CMakeLists.txt file in the file dependency list in ReRunCMake.make file. The A/CMakeLists.txt and B/CMakeLists.txt files do not get included.Interestingly enough, these files do get added to ReRunCMake.make but get overwritten each time CMake processes another CMakeLists.txt file. As a result, if I change CMakeLists.txt in either the A or B directories, the Xcode project does not re-run CMake to regenerate the the project files and the Xcode project does not get updated correctly. Any help would be appreciated, thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Mac OSX GUI
Do you have to do something special to turn it on when you build(2.8.0) CMake on OS X? My bin directory that contains cmake/ccmake/etc... does not contain a cmake-gui program. Thanks, Steve On Sat, Dec 12, 2009 at 11:32 AM, David Cole david.c...@kitware.com wrote: cmake-gui is available on mac, Linux and windows since CMake 2.6.0... HTH, David On Saturday, December 12, 2009, Steven Wilson steven.wesley.wil...@gmail.com wrote: Is there an actual GUI for Mac OSX (Similar to Windows) other than the curses GUI? Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Mac OSX GUI
I downloaded/installed the Qt libraries (the Cocoa libs), and rebuilt CMake 2.8.0. I'm using a customized version of CMake 2.8.0 so the stock binaries from Kitware won't work for my project. The gui builds correctly and I can run the gui from the CMake 2.8.0.app bundle in the build directory. After running make install, trying to run the CMake 2.8.0.app bundle from /usr/local just results in the app crashing on startup. I'm running OS X 10.6.2. Any suggestions? Thanks, Steve On Sun, Dec 13, 2009 at 12:21 PM, Bill Hoffman bill.hoff...@kitware.comwrote: Michael Wild wrote: You need to have Qt installed. http://qt.nokia.com/products If you only want to build Qt software (i.e. don't care about the IDE), make sure you only download the library package (163MB) and not the SDK (444MB). You can also download the CMake binary for OSX from Kitware it includes the gui. -Bill ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Mac OSX GUI
Is there an actual GUI for Mac OSX (Similar to Windows) other than the curses GUI? Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] New version of Mastering CMake
I read in a past post that Kitware (or the authors) has another edition planned for the book Mastering CMake. I plan to recommend this text to people in my company for learning CMake, but I wanted to know how soon to expect the new edition in order to best advise people on which edition to purchase. Is there a timetable for releasing the new edition? If so, will you share when we can expect it? Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Suggestion: CMake should support custom commands that can vary by configuration.
The current CMake 2.8.0 system does not allow custom commands created with add_custom_command() to do different things based on the build configuration. I propose adding a new keyword to the add_custom_command CMake directive called CONFIG: add_custom_command(OUTPUT output1 [output2 ...] COMMAND command1 [ARGS] [args1...] [COMMAND command2 [ARGS] [args2...] ...] [MAIN_DEPENDENCY depend] [DEPENDS [depends...]] [IMPLICIT_DEPENDS lang1 depend1 ...] [WORKING_DIRECTORY dir] [COMMENT comment] [VERBATIM] [APPEND] [CONFIG Debug | MinSizeRel | Release | RelWithDebInfo | ...]) add_custom_command(TARGET target PRE_BUILD | PRE_LINK | POST_BUILD COMMAND command1 [ARGS] [args1...] [COMMAND command2 [ARGS] [args2...] ...] [WORKING_DIRECTORY dir] [COMMENT comment] [VERBATIM] [CONFIG Debug | MinSizeRel | Release | RelWithDebInfo | ...]) The CONFIG option specifies that the custom command(s) should run only when the given build configuration is active. This option allows custom commands to have configuration specific behavior. When the CONFIG option is not present, add_custom_command behaves as before. I have reported this issue(9974) in the Mantis database and provided patches that implement this change. Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] string REGEX question
I have the following string in a variable C:\path\to\foo I want to do something like the following: string(REGEX REPLACE \\ OUTPUT_VAR ${INPUT_VAR}) where INPUT_VAR contains the original string. I want the result to be: C:\\path\\to\\foo I'm just not seeing how to make this regular expression work. If you have any suggestions I would appreciate the help! Thanks in advance, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CMAKE_GENERATOR question
Thanks! Is CMAKE_EXTRA_GENERATOR a documented variable? I couldn't find it at: http://www.cmake.org/cmake/help/cmake-2-8-docs.html Steve 2009/11/19 Alexander Neundorf a.neundorf-w...@gmx.net On Thursday 19 November 2009, Steven Wilson wrote: Why, in CMake 2.8.0, is the value of CMAKE_GENERATOR Unix Makefiles when using the Eclipse CDT4 - Unix Makefiles generator? That is also the case in cmake 2.6.x. Check CMAKE_EXTRA_GENERATOR, this should contain Eclipse CDT4. Alex ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] string REGEX question
Never mind, I figured out the problem... Thanks, Steve On Fri, Nov 20, 2009 at 6:12 PM, Steven Wilson steven.wesley.wil...@gmail.com wrote: I have the following string in a variable C:\path\to\foo I want to do something like the following: string(REGEX REPLACE \\ OUTPUT_VAR ${INPUT_VAR}) where INPUT_VAR contains the original string. I want the result to be: C:\\path\\to\\foo I'm just not seeing how to make this regular expression work. If you have any suggestions I would appreciate the help! Thanks in advance, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] CMAKE_GENERATOR question
Why, in CMake 2.8.0, is the value of CMAKE_GENERATOR Unix Makefiles when using the Eclipse CDT4 - Unix Makefiles generator? Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Windows Qt CMake 2.8 build question
Thanks everyone for the help, I was able to get Qt recompiled and working with Visual Studio and am happily building the cmake Qt gui.If anyone else found these posts helpful, you will also need to know that you need to compile Qt with static libraries enabled otherwise the CMake build will not install the cmake-gui binary. Steve On Thu, Nov 12, 2009 at 10:57 AM, John Drescher dresche...@gmail.comwrote: On Thu, Nov 12, 2009 at 12:51 PM, Steven Wilson steven.wesley.wil...@gmail.com wrote: Caveat: I am a complete Qt novice. I'm trying to build the 2.8 CVS branch of CMake on Windows and would like to build the Qt GUI. I downloaded and installed the LGPL/Free Windows Qt SDK from the Nokia website. When I use the CMake 2.6.4 or CMake 2.8.0 RC 7 GUI to configure the build for Visual Studio(2008) (with the Qt GUI enabled) I get the following error from CMake: CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindQt4.cmake:771 (MESSAGE): It appears you're trying to use Visual Studio with Qt built by mingw Call Stack (most recent call first): Source/QtDialog/CMakeLists.txt:14 (FIND_PACKAGE) The FindQT4.cmake package indicates that it is looking for a qmake.exe binary to run to configure the rest of the Qt CMake variables. I set my PATH environment variable to point to C:\Qt\2009.4\qt\bin so that the FindQT4.cmake package can find the qmake binary, but it seems to think that qmake is for mingw. I have also tried setting my PATH variable to point to C:\Qt\2009.4\qt\qmake so that it can find the qmake in that directory, but using that one gives errors about temporary library versions of the Qt library not being installed. The FindQT4.cmake file tries to query the qmake binary for QT_INSTALL_LIBS and qt\qmake\qmake.exe from the SDK I installed returns the following: C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more /Troll/4.5.0/qt/lib This path of course does not exist on my system and appears to be an artifact of the Qt build process from Nokia. I can not find any other qmake.exe binaries on the system and at this point I do not understand why the configuration does not work. If you have any advice that you can offer, I will greatly appreciate the help. You need to rebuild Qt using visual studio. John ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Windows Qt CMake 2.8 build question
Caveat: I am a complete Qt novice. I'm trying to build the 2.8 CVS branch of CMake on Windows and would like to build the Qt GUI. I downloaded and installed the LGPL/Free Windows Qt SDK from the Nokia website. When I use the CMake 2.6.4 or CMake 2.8.0 RC 7 GUI to configure the build for Visual Studio(2008) (with the Qt GUI enabled) I get the following error from CMake: CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindQt4.cmake:771 (MESSAGE): It appears you're trying to use Visual Studio with Qt built by mingw Call Stack (most recent call first): Source/QtDialog/CMakeLists.txt:14 (FIND_PACKAGE) The FindQT4.cmake package indicates that it is looking for a qmake.exe binary to run to configure the rest of the Qt CMake variables. I set my PATH environment variable to point to C:\Qt\2009.4\qt\bin so that the FindQT4.cmake package can find the qmake binary, but it seems to think that qmake is for mingw. I have also tried setting my PATH variable to point to C:\Qt\2009.4\qt\qmake so that it can find the qmake in that directory, but using that one gives errors about temporary library versions of the Qt library not being installed. The FindQT4.cmake file tries to query the qmake binary for QT_INSTALL_LIBS and qt\qmake\qmake.exe from the SDK I installed returns the following: C:/qt-greenhouse/Trolltech/Code_less_create_more/Trolltech/Code_less_create_more /Troll/4.5.0/qt/lib This path of course does not exist on my system and appears to be an artifact of the Qt build process from Nokia. I can not find any other qmake.exe binaries on the system and at this point I do not understand why the configuration does not work. If you have any advice that you can offer, I will greatly appreciate the help. Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] static libraries and symbol resolution
I have a group of static archive libraries (.a libs) on Linux and because of the way the linker does symbol resolution I need to use the -Wl,--start-group and -Wl,--end-group linker options to group these libraries. These linker options tell the linker to continue searching the libraries for symbols until all symbol resolution is accomplished. On the command line these options need to appear like the following(or some equivalent variant thereof): -Wl,--start-group libA.a libB.a libC.a ... -Wl,--end-group. I can put something together with CMake that can construct a custom command line to do this kind of thing, but I wanted to check and see if someone knew a good way to make this happen with CMake before I started. Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] static libraries and symbol resolution
Never mind, I figured out how to do it... You can use target_link_libraries() (because target_link_libraries also accepts linker options) to do this kind of thing: target_link_libraries(FOO -Wl,--start-group A B C -Wl,--end-group) On Tue, Nov 10, 2009 at 12:30 PM, Steven Wilson steven.wesley.wil...@gmail.com wrote: I have a group of static archive libraries (.a libs) on Linux and because of the way the linker does symbol resolution I need to use the -Wl,--start-group and -Wl,--end-group linker options to group these libraries. These linker options tell the linker to continue searching the libraries for symbols until all symbol resolution is accomplished. On the command line these options need to appear like the following(or some equivalent variant thereof): -Wl,--start-group libA.a libB.a libC.a ... -Wl,--end-group. I can put something together with CMake that can construct a custom command line to do this kind of thing, but I wanted to check and see if someone knew a good way to make this happen with CMake before I started. Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] CVS tag/branch question
On Mon, Nov 9, 2009 at 11:36 AM, Eric Noulard eric.noul...@gmail.comwrote: 2009/11/9 Steven Wilson steven.wesley.wil...@gmail.com: What CVS tag is used for the 2.8.0 release? I guess it **WILL** be something like CMake-2-8-0 I see a CMake-2-8 branch, but when building from that branch the cmake --version still reports cmake version 2.8.0-rc5 Then I guess 2.8.0 is not out... yet :-) Still in RC = release candidate. Are you being facetious (I can't quite tell for sure)? www.cmake.org has announced that 2.8.0 is available, I would have thought that would be reflected in CVS.. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] LINK_FLAGS_CONFIG bug in Xcode Generator in CVS 2.8 branch and head branch
You can find this issue at bug #9841. Thanks, Steve On Wed, Nov 4, 2009 at 7:12 AM, Brad King brad.k...@kitware.com wrote: Steven Wilson wrote: CMake is ignoring the LINK_FLAGS_CONFIG settings for set_target_properties() when using the Xcode generator in the 2.8 branch and the head branch. It looks like the implementation is just plain missing from that generator. Please submit a bug report here: http://www.cmake.org/Bug and send me the issue number. Thanks, -Brad ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] How to define an 'include_directories' different for each library
There is no magic way to do this with CMake. However, if you don't mind writing some functions/macros you can use a variant of the following function to do what you want: function(build_library NAME KIND SOURCES DEFINITIONS CFLAGS LFLAGS LIBS IPATHS LPATHS) unset(MYCOMPILE_FLAGS) unset(MYLINK_FLAGS) set(MYCOMPILE_FLAGS ${CFLAGS}) set(MYLINK_FLAGS ${LFLAGS}) if(UNIX) foreach(IPATH ${IPATHS}) set(MYCOMPILE_FLAGS ${MYCOMPILE_FLAGS} -I${IPATH}) endforeach(IPATH) foreach(LPATH ${LPATHS}) set(MYLINK_FLAGS ${MYLINK_FLAGS} -L${LPATH}) endforeach(LPATH) elseif(WIN32) foreach(IPATH ${IPATHS}) set(MYCOMPILE_FLAGS ${MYCOMPILE_FLAGS} /I${IPATH}) endforeach(IPATH) foreach(LPATH ${LPATHS}) set(MYLINK_FLAGS ${MYLINK_FLAGS} /LIBPATH:\${LPATH}\) endforeach(LPATH) endif(UNIX) add_library(${NAME} ${KIND} ${SOURCES}) target_link_libraries(${NAME} ${LIBS}) set_target_properties(${NAME} PROPERTIES COMPILE_DEFINITIONS ${DEFINITIONS} COMPILE_FLAGS ${MYCOMPILE_FLAGS} LINK_FLAGS ${MYLINK_FLAGS} ) endfunction(build_library) This function build_library is designed to allow you to pass target specific configurations where includes/etc are different for each target. You assign the includes/defintions/etc to variables and then pass the values as follows: build_library(foo STATIC ${FOO_SOURCES} ${FOO_COMPILE_DEFINITIONS} ${FOO_COMPILE_FLAGS} ${FOO_LINK_FLAGS} ${FOO_LIBS} ${FOO_INCLUDE_DIRECTORIES} ${FOO_LINK_DIRECTORIES} ) The sources, compile definitions, libraries, include directories and link directories variables should all be lists of values while the compile flags and the link flags should be strings of compiler/linker flags. The second argument of the function sets the kind of library, STATIC/SHARED/etc... This function then 'hacks' the include directories into the compiler flags and the link directories into the link flags with the appropriate command line escape by platform (-I for Unix, /I for Windows, etc...). Hope this helps, Steve On Wed, Nov 4, 2009 at 8:39 AM, Olivier Pierard olivier.pier...@cenaero.bewrote: Hi, A quite basic question... In a given project, I build several libraries and an executable. How can I get a different 'include_directories' for each library and not the same list for all of them (typically, I don't want to have access to the includes related to the last library when compiling the first one). Thank you, Olivier ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Bug in 2.8 branch (Head branch also)
I have verified that the issue is fixed in the CVS head branch. Thanks for the quick fix. Steve On Tue, Nov 3, 2009 at 8:04 AM, Bill Hoffman bill.hoff...@kitware.comwrote: Pretty sure this is fixed in CVS, and will be in the next RC, can you try CVS head? That said this is still bad CMake code as there is no parent to the top level CMakeLists.txt file. -Bill ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] LINK_FLAGS_CONFIG bug in Xcode Generator in CVS 2.8 branch and head branch
CMake is ignoring the LINK_FLAGS_CONFIG settings for set_target_properties() when using the Xcode generator in the 2.8 branch and the head branch. Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Bug in 2.8 branch (Head branch also)
Consider the following: foo.cpp #include iostream int main() { std::cout foo std::endl; return 0; } CMakeLists.txt cmake_minimum_required(VERSION 2.6.4) add_executable(foo foo.cpp) set(BUILD_FOO ON PARENT_SCOPE) With CMake built from the CMake-2-8 branch and also the head branch of the CVS tree, the set(BUILD_FOO ON PARENT_SCOPE) crashes CMake on snow-leopard. Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Setting Visual Studio/Xcode variables(macros)
Is it possible to set Visual Studio/Xcode variables from CMake? ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Configuration specific custom commands
Is it possible to set up custom commands with add_custom_command so that the behavior is configuration dependent? Ie, the command does it's thing one way in Release configuration, but another in Debug configuration. What I really have is a custom command that is used to turn source files in one form into vanilla C files. The custom command uses variables to pass arguments to the binaries that are doing the transformation, but I would like to pass different different arguments to the binaries when the configuration type is different. Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Deleting directories at 'clean' time
Is it possible to insert hooks so that the 'Clean' build event in Visual Studio will delete directories created with custom commands? Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] add_custom_command/get_target_property bug on Windows?
Thanks! These comments have the insight that I needed! Steve On Thu, Oct 22, 2009 at 6:22 AM, Brad King brad.k...@kitware.com wrote: Steven Wilson wrote: Consider the following simple C++ file foo.cpp: #include iostream int main() { std::cout bar std::endl; return 0; } Now consider the following CMakeLists.txt file for foo.cpp: cmake_minimum_required(VERSION 2.6) project(Bug) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) add_executable(foo foo.cpp) get_target_property(FOO_LOCATION foo LOCATION) message(${FOO_LOCATION}) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/bar COMMAND ${CMAKE_COMMAND} -E make_directory bat COMMAND chdir bat COMMAND ${FOO_LOCATION} ${CMAKE_CURRENT_BINARY_DIR}/bar DEPENDS foo ) add_custom_target(Bar DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/bar) When you configure this project using the Windows Visual Studio 9 generator, the generation step correctly displays(ie from the message() command) the value C:\path\to\build\directory\bin\$(OutDir)\foo.exe for the variable FOO_LOCATION. The problem comes in the add_custom_command step. The generator writes the following line into the .vcproj file: bin\$(OutDir)\foo.exe C:\path\to\build\directory\bar What I'm pointing out is that the generator puts a path to foo.exe that is not the full path name and this behavior causes the add_custom_command build step to fail because the custom command includes a chdir command so the current working directory has changed and bin\$(OutDir)\foo.exe is not longer available. Now, if you instead modify the add_custom_command the line to read: COMMAND ..\${FOO_LOCATION}| ${CMAKE_CURRENT_BINARY_DIR}/bar the generator instead puts the following in the project files: ..\C:\path\to\build\directory\bin\$(OutDir)\foo.exe ?!? The correct path now appears, but it is wrong because of the ..\ prepended to the value. What is going on? Why doesn't the value of FOO_LOCATION always and everywhere stay C:\path\to\build\directory\bin\$(OutDir)\foo.exe? It's converted to a path relative to the expected working directory of the custom command. This is the current binary directory by default, or can be set with the add_custom_command() call through the WORKING_DIRECTORY option. You can use file(MAKE_DIRECTORY) to prepare the directory at CMake time, or a separate custom command to make it. FYI, the LOCATION property is not necessary in CMake 2.6. You can just name the target: file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bat) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/bar COMMAND foo ${CMAKE_CURRENT_BINARY_DIR}/bar DEPENDS foo WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bat ) -Brad ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Visual Studio and /DEBUG linker flag
I have CMake project that I use to generate a set of Visual Studio project files. On the CMake side I explicitly turn off CMAKE_EXE_LINKER_FLAGS and CMAKE_EXE_LINKER_FLAGS_RELEASE by setting their values to the empty string . When CMake generates the project files, I can open the .vcproj file and check to make sure that /DEBUG does not appear in the linker flags for the Release section of my program. However, when I open the solution in Visual Studio (2008 BTW), Visual Studio seems to automatically turn on /DEBUG in the linker settings for my program. I need /DEBUG to be turned off for my Release configuration. Does anyone know what is going on in this situation? Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Visual Studio and /DEBUG linker flag
I am using the Release configuration. On Wed, Oct 21, 2009 at 10:43 AM, Tyler Roscoe ty...@cryptio.net wrote: On Wed, Oct 21, 2009 at 10:30:34AM -0600, Steven Wilson wrote: I have CMake project that I use to generate a set of Visual Studio project files. On the CMake side I explicitly turn off CMAKE_EXE_LINKER_FLAGS and CMAKE_EXE_LINKER_FLAGS_RELEASE by setting their values to the empty string . When CMake generates the project files, I can open the .vcproj file and check to make sure that /DEBUG does not appear in the linker flags for the Release section of my program. However, when I open the solution in Visual Studio (2008 BTW), Visual Studio seems to automatically turn on /DEBUG in the linker settings for my program. I need /DEBUG to be turned I assume you're not using the RelWithDebInfo build configuration? tyler ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] add_custom_command/get_target_property bug on Windows?
Consider the following simple C++ file foo.cpp: #include iostream int main() { std::cout bar std::endl; return 0; } Now consider the following CMakeLists.txt file for foo.cpp: cmake_minimum_required(VERSION 2.6) project(Bug) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) add_executable(foo foo.cpp) get_target_property(FOO_LOCATION foo LOCATION) message(${FOO_LOCATION}) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/bar COMMAND ${CMAKE_COMMAND} -E make_directory bat COMMAND chdir bat COMMAND ${FOO_LOCATION} ${CMAKE_CURRENT_BINARY_DIR}/bar DEPENDS foo ) add_custom_target(Bar DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/bar) When you configure this project using the Windows Visual Studio 9 generator, the generation step correctly displays(ie from the message() command) the value C:\path\to\build\directory\bin\$(OutDir)\foo.exe for the variable FOO_LOCATION. The problem comes in the add_custom_command step. The generator writes the following line into the .vcproj file: bin\$(OutDir)\foo.exe C:\path\to\build\directory\bar What I'm pointing out is that the generator puts a path to foo.exe that is not the full path name and this behavior causes the add_custom_command build step to fail because the custom command includes a chdir command so the current working directory has changed and bin\$(OutDir)\foo.exe is not longer available. Now, if you instead modify the add_custom_command the line to read: COMMAND ..\${FOO_LOCATION}| ${CMAKE_CURRENT_BINARY_DIR}/bar the generator instead puts the following in the project files: ..\C:\path\to\build\directory\bin\$(OutDir)\foo.exe ?!? The correct path now appears, but it is wrong because of the ..\ prepended to the value. What is going on? Why doesn't the value of FOO_LOCATION always and everywhere stay C:\path\to\build\directory\bin\$(OutDir)\foo.exe? Thanks in advance, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] COMPILE_FLAGS_CONFIG
I am asking why CMake doesn't support the following: set_target_properties(${TARGET} PROPERTIES COMPILE_FLAGS_CONFIG -fmyflag) Would set_target_properties() work? Then you can do something like: set_target_properties( ${TARGET} PROPERTIES COMPILE_FLAGS -fmyflag ) to set compile flags on a target by target basis. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] COMPILE_FLAGS_CONFIG
I am asking why CMake doesn't support the following: set_target_properties(${TARGET} PROPERTIES COMPILE_FLAGS_CONFIG -fmyflag) On Tue, Oct 20, 2009 at 10:44 AM, Tyler ty...@cryptio.net wrote: Please reply to the list so others can help. On Mon, Oct 19, 2009 at 06:11:23PM -0600, Steven Wilson wrote: Yes, but CMAKE_CXX_FLAGS_CONFIG and CMAKE_C_FLAGS_CONFIG are global in scope. I want to be able to make changes to the compilation flags at the target level based on the current configuration. Ok; just wanted to make sure you knew about them. Can you use set_source_files_properties() or set_target_properties() with the COMPILE_FLAGS property? tyler ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] COMPILE_FLAGS_CONFIG
Sweet! Thanks much! On Tue, Oct 20, 2009 at 10:59 AM, Philip Lowman phi...@yhbt.com wrote: cmake.org/Bug/view.php?id=6493 On Oct 20, 2009 11:29 AM, Steven Wilson steven.wesley.wil...@gmail.com wrote: I am asking why CMake doesn't support the following: set_target_properties(${TARGET} PROPERTIES COMPILE_FLAGS_CONFIG -fmyflag) Would set_target_properties() work? Then you can do something like: set_target_properties(... ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] COMPILE_FLAGS_CONFIG
It appears that CMake does not support a COMPILE_FLAGS_CONFIG target property.This kind of property would be incredibly useful. Is there some reason it does not exist? Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] COMPILE_FLAGS_CONFIG
-- Forwarded message -- From: Steven Wilson steven.wesley.wil...@gmail.com Date: Mon, Oct 19, 2009 at 6:11 PM Subject: Re: [CMake] COMPILE_FLAGS_CONFIG To: Tyler Roscoe ty...@cryptio.net Yes, but CMAKE_CXX_FLAGS_CONFIG and CMAKE_C_FLAGS_CONFIG are global in scope. I want to be able to make changes to the compilation flags at the target level based on the current configuration. On Mon, Oct 19, 2009 at 4:48 PM, Tyler Roscoe ty...@cryptio.net wrote: On Mon, Oct 19, 2009 at 04:06:29PM -0600, Steven Wilson wrote: It appears that CMake does not support a COMPILE_FLAGS_CONFIG target property.This kind of property would be incredibly useful. Is there some reason it does not exist? Are you aware of CMAKE_CXX_FLAGS_CONFIG? tyler ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Turning off extra Visual Studio options
Is there a way to turn off all the extra options that CMake tries to append to compiler flags, linker flags, etc for the Visual Studio generators? I have a project that I want to explicity control every option for some of my exes/libs. Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Turning off extra Visual Studio options
Thanks for the help! On Fri, Oct 16, 2009 at 2:52 PM, Philip Lowman phi...@yhbt.com wrote: Thanks for linking. Posting via mobile :) On Oct 16, 2009 4:27 PM, John Drescher dresche...@gmail.com wrote: On Fri, Oct 16, 2009 at 4:14 PM, Philip Lowman phi...@yhbt.com wrote: You may want to also look ... Found that: http://www.itk.org/Wiki/CMake_FAQ#Make_Override_Files Thanks. I will have to bookmark that.. John ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Pleas... ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] comparing variable contents
Is there a way to compare the contents of one variable with another? I'm looking for something like: if(${FOO} EQUAL ${BAR}) Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] comparing variable contents
Of course I read the docs for the if() command. It doesn't contain any comments about comparing a variable's value to another variable's value. Are you suggesting that if it isn't in the documentation then it isn't supported? If so, please say so. I was just hoping someone might know a way to do this kind of test/comparison. On Tue, Sep 29, 2009 at 11:08 AM, Tyler Roscoe ty...@cryptio.net wrote: On Tue, Sep 29, 2009 at 10:56:45AM -0600, Steven Wilson wrote: Is there a way to compare the contents of one variable with another? I'm looking for something like: if(${FOO} EQUAL ${BAR}) Did you read the docs for the if() command? cmake --help-command if tyler ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] comparing variable contents
Thanks all, I was missing the quotes around the initial ${FOO} in my tests... if(${FOO} STREQUAL ${BAR}) does what I wanted. On Tue, Sep 29, 2009 at 1:51 PM, Nathaniel Waisbrot (Cont ARL/CISD) nathaniel.waisb...@arl.army.mil wrote: Of course I read the docs for the if() command. It doesn't contain any comments about comparing a variable's value to another variable's value. Are you suggesting that if it isn't in the documentation then it isn't supported? If so, please say so. I was just hoping someone might know a way to do this kind of test/comparison. Maybe the information that you're missing is that all CMake variables are stored internally as strings. So paths, lists, numbers, etc can be compared with STREQUAL. ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Win32 multi-platform settings
Visual Studio supports having solution files where the solution can set the supported platform to x64 and yet have individual projects in the solution build for the Win32 platform despite having the solution set to x64. Can I configure CMake to set up projects/solutions in this fashion? Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Add OSX_ARCHITECTURES and OSX_ARCHITECTURES_CONFIG to target properties
I work for a company that is considering porting one of its major software products to CMake. In the course of developing a CMake based build system for the Mac port of the product the following issue came up. What follows is a description of the problem and a proposed solution for the problem. I have submitted this problem as bug (feature) # 8725 to the cmake bug tracker. Thanks, Steve Consider the following source tree on OSX: TopDir/ - CMakeLists.txt - src1.c - src2.c Where src1.c is compiled into a 32-bit(i386) binary that links with libExample1.a a non-Universal i386 architecture library. Where src2.c is compiled into a 64-bit(x86_64) binary that links with libExample2.a a non-Universal x86_64 architecture library. libExample1.a and libExample2.a exist outside of the scope of the source tree and cannot be rebuilt to be Universal libraries. Here are the basic entries in CMakeLists.txt: add_executable(src1 src1.c) target_link_libraries(src1 Example1) set_target_properties(src1 PROPERTIES COMPILE_FLAGS -arch i386 LINK_FLAGS -arch i386) add_executable(src2 src2.c) target_link_libraries(src2 Example2) set_target_properties(src2 PROPERTIES COMPILE_FLAGS -arch x86_64 LINK_FLAGS -arch x86_64 When generating a build system using the 'Unix Makefiles' generator this CMakeLists.txt will correctly build and link src1 and src2 as i386 and x86_64 binaries respectively. When generating a build system using the Xcode generator this CMakeLists.txt will generate an Xcode project that cannot correctly build src2. CMake provides default values for CMAKE_OSX_ARCHITECTURES. When the Xcode generator runs, it will use the default value for CMAKE_OSX_ARCHITECTURES (i386 in this case (assume a Core 2 Duo processor)) and the Xcode project will not have any explicit reference to i386 architectures when it is generated. Xcode will by default use the 'native' architecture for the given machine and automatically append -arch i386 to the compile/link commands for src1 and src2. Given that src2 must be an x86_64 architecture only binary (see dependency on libExample2.a) then src2 cannot link correctly. Explicitly setting CMAKE_OSX_ARCHITECTURES to x86_64 in the CMakeLists.txt file does not solve the problem but rather switches the case to src1 which must be compiled as an i386 architecture only binary. Explicitly setting CMAKE_OSX_ARCHITECTURES to x86_64;i386 violates the requirement that the binaries only have i386 and x86_64 architectures respectively. This behavior makes it impossible to have working Makefile and Xcode build systems generated for this source tree. To put it another way, you cannot generate an Xcode project that contains targets with strict exclusive architecture requirements where those requirements vary by target. In order to correct this deficiency, we need to have a property for targets that allows a target to override the project level CMAKE_OSX_ARCHITECTURES setting. I propose the use of the following property names: OSX_ARCHITECTURES and OSX_ARCHITECTURES_CONFIG The CMAKE_OSX_ARCHITECTURES property sets the target binary architecture for targets on OSX. Use CMAKE_OSX_ARCHITECTURES_CONFIG to set the binary architectures on a per-configuration basis. CONFIG is an upper-case name (ex. CMAKE_OSX_ARCHITECTURES_DEBUG). ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Add OPTIONAL to install(DIRECTORY ...)
Currently install(FILES ...) and install(PROGRAMS ...) allow the OPTIONAL modifier. Directories can also be optional install items. install(DIRECTORY dirs... DESTINATION dir [FILE_PERMISSIONS permissions...] [DIRECTORY_PERMISSIONS permissions...] [USE_SOURCE_PERMISSIONS] [CONFIGURATIONS [Debug|Release|...]] [COMPONENT component] [FILES_MATCHING] [[PATTERN pattern | REGEX regex] [EXCLUDE] [PERMISSIONS permissions...]] [OPTIONAL] [...]) I have submitted this request as bug # 8743 to the bug tracker and would like to see this issue integrated into the next release of CMake. Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] GUI or commandline
Is there a programmatic way for a CMakeLists.txt file to determine if it is being processed by the command line cmake or the gui cmake? Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Feature request question
Following the FAQ ( http://www.cmake.org/Wiki/CMake_FAQ#I_want_a_new_feature_in_CMake._What_should_I_do.3F) I have submitted a couple feature requests(8725, 8743) to the cmake bugs database along with source patches implementing the features. I haven't yet received any feedback yet on either of these issues. I am not in a hurry for a response, however I do want to check to make sure that I have submitted these requests appropriately. Is the FAQ regarding feature requests up to date, and what kind of time frame should I expect for responses to requests? Thanks for your help, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Feature request question
0008725 0008743 Thanks again for the help. On Tue, Mar 17, 2009 at 1:56 PM, Bill Hoffman bill.hoff...@kitware.comwrote: Steven Wilson wrote: Following the FAQ ( http://www.cmake.org/Wiki/CMake_FAQ#I_want_a_new_feature_in_CMake._What_should_I_do.3F) I have submitted a couple feature requests(8725, 8743) to the cmake bugs database along with source patches implementing the features. I haven't yet received any feedback yet on either of these issues. I am not in a hurry for a response, however I do want to check to make sure that I have submitted these requests appropriately. Is the FAQ regarding feature requests up to date, and what kind of time frame should I expect for responses to requests? Just busy... Lots of feature requests in the bug tracker... Can you post the ones that you are interested in? -Bill ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Rules for files with non-standard extensions
The example I gave is only just an example for illustrating my question about Xcode and the true source files. The actual code does have unique names for tmpfile so it will work correctly in a parallel build. On Thu, Mar 5, 2009 at 6:28 AM, Mathieu Malaterre mathieu.malate...@gmail.com wrote: On Tue, Mar 3, 2009 at 9:06 PM, Steven Wilson steven.wesley.wil...@gmail.com wrote: As a new member of the list, I just wanted to say thanks for providing this forum as a place to get answers about cmake! First, the problem: I have a software system composed of a number of source files in C. These files have an alternate file extension .bc. In order to compile these files, the build system first needs to pass them through two preprocessors; 1. The C preprocessor and 2. a homegrown preprocessor that handles a private C language extension and converts occurrences of that language extension to standard C. Finally the preprocessed source is handed to the C compiler.My initial port of this build system used the following kind of construct: macro(process_bc_files INPUT_FILE) add_custom_command(OUTPUT ${INPUT_FILE}.c COMMAND preprocessor1 ${INPUT_FILE} tmpfile COMMAND preprocessor2 tmpfile ${INPUT_FILE}.c ) endmacro(process_bc_files) Just out of curiosity, does this work in parallel build (make -j4) ? I am seeing a single 'tmpfile' for all your input files ... -- Mathieu ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Rules for files with non-standard extensions
Thanks for the suggestion, I will give it a try! On Thu, Mar 5, 2009 at 6:22 AM, Philip Lowman phi...@yhbt.com wrote: On Tue, Mar 3, 2009 at 3:06 PM, Steven Wilson steven.wesley.wil...@gmail.com wrote: As a new member of the list, I just wanted to say thanks for providing this forum as a place to get answers about cmake! First, the problem: I have a software system composed of a number of source files in C. These files have an alternate file extension .bc. In order to compile these files, the build system first needs to pass them through two preprocessors; 1. The C preprocessor and 2. a homegrown preprocessor that handles a private C language extension and converts occurrences of that language extension to standard C. Finally the preprocessed source is handed to the C compiler.My initial port of this build system used the following kind of construct: macro(process_bc_files INPUT_FILE) add_custom_command(OUTPUT ${INPUT_FILE}.c COMMAND preprocessor1 ${INPUT_FILE} tmpfile COMMAND preprocessor2 tmpfile ${INPUT_FILE}.c ) endmacro(process_bc_files) process_bc_file(/path/to/main.bc) add_executable(Foo main.bc.c) Now this construct works and the build functions correctly, but I have noticed a problem that I need to have corrected. When I use the Xcode generator on my project I get a nice Xcode project except that the source files listed for executable Foo are the processed files (*.bc.c) not the original .bc files. This state of course makes sense because the .bc.c files are used in the add_executable line, but it makes the Xcode project file incorrect because developers will not edit the .bc.c files but the originals. The question: Does a way to do something like the following exist? add_executable(Foo main.bc) Ie can I create some rules that act like the add_custom_command so that the add_executable refers to the processed output while the Xcode project refers to the source file? You might be able to use the HEADER_FILE_ONLY property of set_source_files_properties() to get it to show up in the project, but simply not have it compiled. I know this works in Visual Studio (not sure about Xcode). -- Philip Lowman ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Resetting include and link directories
Is there a way to reset the directory lists created by include_directories and link_directories? Thanks, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] Rules for files with non-standard extensions
As a new member of the list, I just wanted to say thanks for providing this forum as a place to get answers about cmake! First, the problem: I have a software system composed of a number of source files in C. These files have an alternate file extension .bc. In order to compile these files, the build system first needs to pass them through two preprocessors; 1. The C preprocessor and 2. a homegrown preprocessor that handles a private C language extension and converts occurrences of that language extension to standard C. Finally the preprocessed source is handed to the C compiler.My initial port of this build system used the following kind of construct: macro(process_bc_files INPUT_FILE) add_custom_command(OUTPUT ${INPUT_FILE}.c COMMAND preprocessor1 ${INPUT_FILE} tmpfile COMMAND preprocessor2 tmpfile ${INPUT_FILE}.c ) endmacro(process_bc_files) process_bc_file(/path/to/main.bc) add_executable(Foo main.bc.c) Now this construct works and the build functions correctly, but I have noticed a problem that I need to have corrected. When I use the Xcode generator on my project I get a nice Xcode project except that the source files listed for executable Foo are the processed files (*.bc.c) not the original .bc files. This state of course makes sense because the .bc.c files are used in the add_executable line, but it makes the Xcode project file incorrect because developers will not edit the .bc.c files but the originals. The question: Does a way to do something like the following exist? add_executable(Foo main.bc) Ie can I create some rules that act like the add_custom_command so that the add_executable refers to the processed output while the Xcode project refers to the source file? Thanks for any help, Steve ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake