Re: [CMake] using cmake to install dlls into windows/system32
2009/12/18 James Zipperer james.zippe...@modsystems.com: After a lot of trial and error and some rtfm work, I figured out a way to do it. The UpgradeDLL macro I mentioned below appears to be out of date and the preferred method is now InstallLib. It appears to handle DLL versioning and usage counting. Note: I could be wrong, I’ve been at this problem for about a day now. Here’s the hack solution I came up with: 1. Modify NSIS.template.in to include Library.nsh: I would say that if you have a specific behavior which is not configurable with the CMake provided NSIS.template.in you'll better craft your own NSIS.template.in which may contain as much specificities as you need. I mean not only adding include Library.nsh but whatever other NSIS installer code you need. Then after that if the install driver DLL thing is of general interest may be you can report a bug and propose a generic modification of the mainstream NSIS.template.in provided with cmake. -- 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
Re: [CMake] Order of operations in CMakeLists.txt file?
Zitat von Eric LaFranchi eric.lafran...@voltage.com: I'm confused about the following documentation. The CMake FAQ section How do I use a different compiler? states: Set the appropriate CMAKE_FOO_COMPILER variable(s) to a valid compiler name or full path in a list file using set(). This must be done before any language is set (ie before any project() or enable_language() command). I want to conditionally choose the compiler based on platform. My CMakeList.txt contains code similar to the following: cmake_minimum_required (VERSION 2.6) if (CMAKE_SYSTEM_NAME STREQUAL Platform1) set (CMAKE_C_COMPILER cc1) set (CMAKE_C_FLAGS -XYZ1) elseif (CMAKE_SYSTEM_NAME STREQUAL platform2) set (CMAKE_C_COMPILER cc2) set (CMAKE_C_FLAGS -XYZ2) endif() project(test) ... However, before project() is called, the CMAKE_SYSTEM_NAME appears undefined. When is CMAKE_SYSTEM_NAME defined? Is another option available to switch on the system before project() is invoked? use project(test NONE) to not enable any language. Then CMAKE_SYSTEM_NAME should be defined. OTOH, you may want to think again about your approach of doing things. It makes it impossible to change compilers on a platform without changing the CMakeList.txt file. What exactly is your use-case for the above stuff? HS ___ 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 + GCC 4.2
Hi, I can't seem to get the combination of XCode and GCC 4.2 to be happy with CMaka. I've tried several different ways to set the compiler version. Setting the CMAKE_C/CXX_COMPILER doesn't seem to work. But if i set the environment variabes, CMake comes back and tells me something like this: Run Build Command:/usr/local/bin/cmakexbuild -project CMAKE_TRY_COMPILE.xcodeproj build -target cmTryCompileExec -configuration Debug 2009-12-18 00:50:45.858 xcodebuild[42636:331b] Warning: Couldn't discover the 'gcc-4.2' compiler's built-in search paths and preprocessor definitions for language dialect 'c'. This may lead to indexing issues. Compiler: /Developer/Library/Xcode/Plug-ins/GCC 4.0.xcplugin/Contents/Resources/gcc-4.2 Reason: sh: /Developer/Library/Xcode/Plug-ins/GCC 4.0.xcplugin/Contents/Resources/gcc-4.2: No such file or directory What am I missing with here...? Thanks, Hai ___ 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] third party library dependencies
Hi Roman, Not in a portable way. I'm not too familiar with Windows, but on Linux you can do this when libA is a shared library that has its dependency on libB linked in (e.g. ldd libA.so will tell you this). When linking in static libraries you're out of luck. I would write a FindA.cmake file for this and let that macro set the variable A_LIBRARIES to contain both libA and libB. You can then use: find_package(A) target_link_libraries(${A_LIBRARIES}) Hope this helps, Marcel Loose. On Thu, 2009-12-17 at 12:18 -0500, Roman Shtylman wrote: Is there an easy way to setup link dependencies between libraries not build using cmake? Lets say I have a system library A which depends on system library B. I then make an executable that uses code from A. I need to link against A and B, but as a user of just library A, I don't want to worry about that. Does cmake have a facility to define such a hierarchy/dependency chain so that I can just do target_link_libraries(target A) and have it figure out that it needs to link against B as well? Note that neither A nor B are built using cmake, they already exist. ~Roman ___ 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] Cpack ignoring file installs
This is my first shot at cpack, so I may be missing something entirely obvious here. I have two parts to the install on my project, one are the libs, the other are the headers. The libs are installed via the INSTALL(TARGET ...) command, whereas the headers are installed via the INSTALL(FILES ... ) command. A normal cmake install will install everything, but cpack, when run, will only pick up the libraries. I can't seem to find any information that seems to indicate that this is normal in the documentation, but neither can I find any information that say this is what it appears to be - broken. Any pointers? Cheers, Daniel. ___ 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] third party library dependencies
On Fri, Dec 18, 2009 at 10:19 AM, Marcel Loose lo...@astron.nl wrote: Hi Roman, Not in a portable way. I'm not too familiar with Windows, but on Linux you can do this when libA is a shared library that has its dependency on libB linked in (e.g. ldd libA.so will tell you this). When linking in static libraries you're out of luck. I would write a FindA.cmake file for this and let that macro set the variable A_LIBRARIES to contain both libA and libB. You can then use: find_package(A) target_link_libraries(${A_LIBRARIES}) I've had to deal with this issue and Marcel's proposal is what I do. There is one slight gotcha that I haven't resolved cleanly yet. Suppose that A_LIBRARIES depends on certain Boost components, so inside FindA.cmake I perform a find_package(Boost REQUIRED COMPONENTS xxx yyy) and append Boost_LIBRARIES to A_LIBRARIES. Note: I use find_package instead of hardcoding the library names so that libraries appear as fully qualified paths, and nonstandard installation paths can be used. Everything OK for now. Now, in my project, which depends on A and some other Boost component I do find_package(A) find_package(Boost REQUIRED COMPONENTS zzz) What happens is that since Boost was already found in A, the zzz component is not included in Boost_LIBRARIES. Has anybody found a successful way of dealing with this? TIA, Adolfo Hope this helps, Marcel Loose. On Thu, 2009-12-17 at 12:18 -0500, Roman Shtylman wrote: Is there an easy way to setup link dependencies between libraries not build using cmake? Lets say I have a system library A which depends on system library B. I then make an executable that uses code from A. I need to link against A and B, but as a user of just library A, I don't want to worry about that. Does cmake have a facility to define such a hierarchy/dependency chain so that I can just do target_link_libraries(target A) and have it figure out that it needs to link against B as well? Note that neither A nor B are built using cmake, they already exist. ~Roman ___ 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 -- Adolfo Rodríguez Tsouroukdissian, Ph. D. Robotics engineer PAL ROBOTICS S.L http://www.pal-robotics.com Tel. +34.93.414.53.47 Fax.+34.93.209.11.09 AVISO DE CONFIDENCIALIDAD: Este mensaje y sus documentos adjuntos, pueden contener información privilegiada y/o confidencial que está dirigida exclusivamente a su destinatario. Si usted recibe este mensaje y no es el destinatario indicado, o el empleado encargado de su entrega a dicha persona, por favor, notifíquelo inmediatamente y remita el mensaje original a la dirección de correo electrónico indicada. Cualquier copia, uso o distribución no autorizados de esta comunicación queda estrictamente prohibida. CONFIDENTIALITY NOTICE: This e-mail and the accompanying document(s) may contain confidential information which is privileged and intended only for the individual or entity to whom they are addressed. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of this e-mail and/or accompanying document(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender at the above e-mail address. ___ 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] third party library dependencies
Hi Adolfo, I cannot reproduce the problem you mention. I made the following CMakeLists.txt file: cmake_minimum_required(VERSION 2.6) project(MyBoost) find_package(Boost REQUIRED COMPONENTS date_time) message(STATUS Boost_FOUND=${Boost_FOUND}) message(STATUS Boost_LIBRARIES=${Boost_LIBRARIES}) find_package(Boost REQUIRED COMPONENTS regex) message(STATUS Boost_FOUND=${Boost_FOUND}) message(STATUS Boost_LIBRARIES=${Boost_LIBRARIES}) Running cmake (2.6.2) produces: -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Boost version: 1.36.0 -- Found the following Boost libraries: -- date_time -- Boost_FOUND=TRUE -- Boost_LIBRARIES=/usr/lib64/libboost_date_time-mt.so -- Boost version: 1.36.0 -- Found the following Boost libraries: -- regex -- Boost_FOUND=TRUE -- Boost_LIBRARIES=/usr/lib64/libboost_date_time-mt.so;/usr/lib64/libboost_regex-mt.so -- Configuring done -- Generating done So, in my case boost_regex is nicely added to boost_date_time. Best regards, Marcel Loose. On Fri, 2009-12-18 at 10:48 +0100, Adolfo Rodríguez Tsouroukdissian wrote: On Fri, Dec 18, 2009 at 10:19 AM, Marcel Loose lo...@astron.nl wrote: Hi Roman, Not in a portable way. I'm not too familiar with Windows, but on Linux you can do this when libA is a shared library that has its dependency on libB linked in (e.g. ldd libA.so will tell you this). When linking in static libraries you're out of luck. I would write a FindA.cmake file for this and let that macro set the variable A_LIBRARIES to contain both libA and libB. You can then use: find_package(A) target_link_libraries(${A_LIBRARIES}) I've had to deal with this issue and Marcel's proposal is what I do. There is one slight gotcha that I haven't resolved cleanly yet. Suppose that A_LIBRARIES depends on certain Boost components, so inside FindA.cmake I perform a find_package(Boost REQUIRED COMPONENTS xxx yyy) and append Boost_LIBRARIES to A_LIBRARIES. Note: I use find_package instead of hardcoding the library names so that libraries appear as fully qualified paths, and nonstandard installation paths can be used. Everything OK for now. Now, in my project, which depends on A and some other Boost component I do find_package(A) find_package(Boost REQUIRED COMPONENTS zzz) What happens is that since Boost was already found in A, the zzz component is not included in Boost_LIBRARIES. Has anybody found a successful way of dealing with this? TIA, Adolfo Hope this helps, Marcel Loose. On Thu, 2009-12-17 at 12:18 -0500, Roman Shtylman wrote: Is there an easy way to setup link dependencies between libraries not build using cmake? Lets say I have a system library A which depends on system library B. I then make an executable that uses code from A. I need to link against A and B, but as a user of just library A, I don't want to worry about that. Does cmake have a facility to define such a hierarchy/dependency chain so that I can just do target_link_libraries(target A) and have it figure out that it needs to link against B as well? Note that neither A nor B are built using cmake, they already exist. ~Roman ___ 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 -- Adolfo Rodríguez Tsouroukdissian, Ph. D. Robotics engineer PAL ROBOTICS S.L
Re: [CMake] Cpack ignoring file installs
2009/12/18 Daniel Stonier d.ston...@gmail.com: This is my first shot at cpack, so I may be missing something entirely obvious here. I have two parts to the install on my project, one are the libs, the other are the headers. The libs are installed via the INSTALL(TARGET ...) command, whereas the headers are installed via the INSTALL(FILES ... ) command. A normal cmake install will install everything, but cpack, when run, will only pick up the libraries. On which kind of system are you working Linux, Windows etc ... Which version of CMake? Which CPack generator are you trying to use? I can't seem to find any information that seems to indicate that this is normal in the documentation, but neither can I find any information that say this is what it appears to be - broken. Any pointers? May be depending on the missing informations :-) -- 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
Re: [CMake] third party library dependencies
On Fri, Dec 18, 2009 at 11:11 AM, Marcel Loose lo...@astron.nl wrote: Hi Adolfo, I cannot reproduce the problem you mention. I made the following CMakeLists.txt file: Hmm, I'll perform a check on my side. I noticed the issue quite some time ago so I might have missed some details in my previous email. Anyway, thanks for your test. Your output is definitely the expected behavior I want. I'll report back as soon as I have something. Adolfo. cmake_minimum_required(VERSION 2.6) project(MyBoost) find_package(Boost REQUIRED COMPONENTS date_time) message(STATUS Boost_FOUND=${Boost_FOUND}) message(STATUS Boost_LIBRARIES=${Boost_LIBRARIES}) find_package(Boost REQUIRED COMPONENTS regex) message(STATUS Boost_FOUND=${Boost_FOUND}) message(STATUS Boost_LIBRARIES=${Boost_LIBRARIES}) Running cmake (2.6.2) produces: -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Boost version: 1.36.0 -- Found the following Boost libraries: -- date_time -- Boost_FOUND=TRUE -- Boost_LIBRARIES=/usr/lib64/libboost_date_time-mt.so -- Boost version: 1.36.0 -- Found the following Boost libraries: -- regex -- Boost_FOUND=TRUE -- Boost_LIBRARIES=/usr/lib64/libboost_date_time-mt.so;/usr/lib64/libboost_regex-mt.so -- Configuring done -- Generating done So, in my case boost_regex is nicely added to boost_date_time. Best regards, Marcel Loose. On Fri, 2009-12-18 at 10:48 +0100, Adolfo Rodríguez Tsouroukdissian wrote: On Fri, Dec 18, 2009 at 10:19 AM, Marcel Loose lo...@astron.nl wrote: Hi Roman, Not in a portable way. I'm not too familiar with Windows, but on Linux you can do this when libA is a shared library that has its dependency on libB linked in (e.g. ldd libA.so will tell you this). When linking in static libraries you're out of luck. I would write a FindA.cmake file for this and let that macro set the variable A_LIBRARIES to contain both libA and libB. You can then use: find_package(A) target_link_libraries(${A_LIBRARIES}) I've had to deal with this issue and Marcel's proposal is what I do. There is one slight gotcha that I haven't resolved cleanly yet. Suppose that A_LIBRARIES depends on certain Boost components, so inside FindA.cmake I perform a find_package(Boost REQUIRED COMPONENTS xxx yyy) and append Boost_LIBRARIES to A_LIBRARIES. Note: I use find_package instead of hardcoding the library names so that libraries appear as fully qualified paths, and nonstandard installation paths can be used. Everything OK for now. Now, in my project, which depends on A and some other Boost component I do find_package(A) find_package(Boost REQUIRED COMPONENTS zzz) What happens is that since Boost was already found in A, the zzz component is not included in Boost_LIBRARIES. Has anybody found a successful way of dealing with this? TIA, Adolfo Hope this helps, Marcel Loose. On Thu, 2009-12-17 at 12:18 -0500, Roman Shtylman wrote: Is there an easy way to setup link dependencies between libraries not build using cmake? Lets say I have a system library A which depends on system library B. I then make an executable that uses code from A. I need to link against A and B, but as a user of just library A, I don't want to worry about that. Does cmake have a facility to define such a hierarchy/dependency chain so that I can just do target_link_libraries(target A) and have it figure out that it needs to link against B as well? Note that neither A nor B are built using cmake, they already exist. ~Roman ___ 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
Re: [CMake] third party library dependencies
On Fri, Dec 18, 2009 at 11:11 AM, Marcel Loose lo...@astron.nl wrote: Hi Adolfo, I cannot reproduce the problem you mention. I made the following CMakeLists.txt file: Hmm, I'll perform a check on my side. I noticed the issue quite some time ago so I might have missed some details in my previous email. Anyway, thanks for your test. Your output is definitely the expected behavior I want. I'll report back as soon as I have something. cmake_minimum_required(VERSION 2.6) project(MyBoost) find_package(Boost REQUIRED COMPONENTS date_time) message(STATUS Boost_FOUND=${Boost_FOUND}) message(STATUS Boost_LIBRARIES=${Boost_LIBRARIES}) find_package(Boost REQUIRED COMPONENTS regex) message(STATUS Boost_FOUND=${Boost_FOUND}) message(STATUS Boost_LIBRARIES=${Boost_LIBRARIES}) Running cmake (2.6.2) produces: -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Boost version: 1.36.0 -- Found the following Boost libraries: -- date_time -- Boost_FOUND=TRUE -- Boost_LIBRARIES=/usr/lib64/libboost_date_time-mt.so -- Boost version: 1.36.0 -- Found the following Boost libraries: -- regex -- Boost_FOUND=TRUE -- Boost_LIBRARIES=/usr/lib64/libboost_date_time-mt.so;/usr/lib64/libboost_regex-mt.so -- Configuring done -- Generating done So, in my case boost_regex is nicely added to boost_date_time. Best regards, Marcel Loose. On Fri, 2009-12-18 at 10:48 +0100, Adolfo Rodríguez Tsouroukdissian wrote: On Fri, Dec 18, 2009 at 10:19 AM, Marcel Loose lo...@astron.nl wrote: Hi Roman, Not in a portable way. I'm not too familiar with Windows, but on Linux you can do this when libA is a shared library that has its dependency on libB linked in (e.g. ldd libA.so will tell you this). When linking in static libraries you're out of luck. I would write a FindA.cmake file for this and let that macro set the variable A_LIBRARIES to contain both libA and libB. You can then use: find_package(A) target_link_libraries(${A_LIBRARIES}) I've had to deal with this issue and Marcel's proposal is what I do. There is one slight gotcha that I haven't resolved cleanly yet. Suppose that A_LIBRARIES depends on certain Boost components, so inside FindA.cmake I perform a find_package(Boost REQUIRED COMPONENTS xxx yyy) and append Boost_LIBRARIES to A_LIBRARIES. Note: I use find_package instead of hardcoding the library names so that libraries appear as fully qualified paths, and nonstandard installation paths can be used. Everything OK for now. Now, in my project, which depends on A and some other Boost component I do find_package(A) find_package(Boost REQUIRED COMPONENTS zzz) What happens is that since Boost was already found in A, the zzz component is not included in Boost_LIBRARIES. Has anybody found a successful way of dealing with this? TIA, Adolfo Hope this helps, Marcel Loose. On Thu, 2009-12-17 at 12:18 -0500, Roman Shtylman wrote: Is there an easy way to setup link dependencies between libraries not build using cmake? Lets say I have a system library A which depends on system library B. I then make an executable that uses code from A. I need to link against A and B, but as a user of just library A, I don't want to worry about that. Does cmake have a facility to define such a hierarchy/dependency chain so that I can just do target_link_libraries(target A) and have it figure out that it needs to link against B as well? Note that neither A nor B are built using cmake, they already exist. ~Roman ___ 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
[CMake] FIND_PACKAGE does not work
Hi all, i am trying to include OpenCV 2.0 (which is using CMake now) in our project. Therefore, I call FIND_PACKAGE(OpenCV 2 REQUIRED) in one of our CMake files with the following result: CMake Error at mitk/CMake/MITK_OpenCV_Config.cmake:2 (FIND_PACKAGE): Could not find module FindOpenCV.cmake or a configuration file for package OpenCV. Adjust CMAKE_MODULE_PATH to find FindOpenCV.cmake or set OpenCV_DIR to the directory containing a CMake configuration file for OpenCV. The file will have one of the following names: OpenCVConfig.cmake opencv-config.cmake ... The file OpenCVConfig.cmake exists and I provide an ENV variable OpenCV_DIR pointing to the correct dir which CMake should find. However, even if I set OpenCV_DIR manually in the cache, CMake keeps failing. Any ideas? Greets Michael ___ 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] FIND_PACKAGE does not work
On Fri, Dec 18, 2009 at 12:57 PM, Müller Michael michael.muel...@dkfz-heidelberg.de wrote: Hi all, i am trying to include OpenCV 2.0 (which is using CMake now) in our project. Therefore, I call FIND_PACKAGE(OpenCV 2 REQUIRED) in one of our CMake files with the following result: CMake Error at mitk/CMake/MITK_OpenCV_Config.cmake:2 (FIND_PACKAGE): Could not find module FindOpenCV.cmake or a configuration file for package OpenCV. Adjust CMAKE_MODULE_PATH to find FindOpenCV.cmake or set OpenCV_DIR to the directory containing a CMake configuration file for OpenCV. The file will have one of the following names: OpenCVConfig.cmake opencv-config.cmake ... The file OpenCVConfig.cmake exists and I provide an ENV variable OpenCV_DIR pointing to the correct dir which CMake should find. However, even if I set OpenCV_DIR manually in the cache, CMake keeps failing. Any ideas? As the error message says, you should use CMAKE_MODULE_PATH (and not OpenCV_DIR) to specify the path where OpenCVConfig.cmake is located. OpenCV_DIR is most probably used to specify where OpenCV is installed when a nonstandard path is used. HTH, Adolfo Greets Michael ___ 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 -- Adolfo Rodríguez Tsouroukdissian, Ph. D. Robotics engineer PAL ROBOTICS S.L http://www.pal-robotics.com Tel. +34.93.414.53.47 Fax.+34.93.209.11.09 AVISO DE CONFIDENCIALIDAD: Este mensaje y sus documentos adjuntos, pueden contener información privilegiada y/o confidencial que está dirigida exclusivamente a su destinatario. Si usted recibe este mensaje y no es el destinatario indicado, o el empleado encargado de su entrega a dicha persona, por favor, notifíquelo inmediatamente y remita el mensaje original a la dirección de correo electrónico indicada. Cualquier copia, uso o distribución no autorizados de esta comunicación queda estrictamente prohibida. CONFIDENTIALITY NOTICE: This e-mail and the accompanying document(s) may contain confidential information which is privileged and intended only for the individual or entity to whom they are addressed. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of this e-mail and/or accompanying document(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender at the above e-mail address. ___ 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] FIND_PACKAGE does not work
On 18. Dec, 2009, at 13:06 , Adolfo Rodríguez Tsouroukdissian wrote: On Fri, Dec 18, 2009 at 12:57 PM, Müller Michael michael.muel...@dkfz-heidelberg.de wrote: Hi all, i am trying to include OpenCV 2.0 (which is using CMake now) in our project. Therefore, I call FIND_PACKAGE(OpenCV 2 REQUIRED) in one of our CMake files with the following result: CMake Error at mitk/CMake/MITK_OpenCV_Config.cmake:2 (FIND_PACKAGE): Could not find module FindOpenCV.cmake or a configuration file for package OpenCV. Adjust CMAKE_MODULE_PATH to find FindOpenCV.cmake or set OpenCV_DIR to the directory containing a CMake configuration file for OpenCV. The file will have one of the following names: OpenCVConfig.cmake opencv-config.cmake ... The file OpenCVConfig.cmake exists and I provide an ENV variable OpenCV_DIR pointing to the correct dir which CMake should find. However, even if I set OpenCV_DIR manually in the cache, CMake keeps failing. Any ideas? As the error message says, you should use CMAKE_MODULE_PATH (and not OpenCV_DIR) to specify the path where OpenCVConfig.cmake is located. OpenCV_DIR is most probably used to specify where OpenCV is installed when a nonstandard path is used. HTH, Adolfo Greets Michael No, that's not accurate. If you read the documentation, you will see that CMAKE_MODULE_PATH is used for INCLUDE() and FindXXX.cmake stuff. Probably it will also find OpenCVConfig.cmake, but it really should work with OpenCV_DIR, as this is also documented in the FIND_PACKAGE documentation (however, most people ever read that far...). There must be something else going wrong here... Michael, have you tried it without the version number? Michael ___ 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 install overrode my PATH instead of appending to it
Hi David, My path at work is 1907 characters long right now. If I have some spare time soon, I'll try it again to see what happens. I don't know if PATH length is the key, it is just something I wondered about since that is a definite difference between home and work (though there are many other differences too). Mark On Mon, Dec 14, 2009 at 3:38 PM, David Cole david.c...@kitware.com wrote: FWIW: I made my user PATH value 302 characters long... as in: C:\a;C:\b;C:\c;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\dd;C:\ ...then I installed CMake 2.8.0 from this installer: http://www.cmake.org/files/v2.8/cmake-2.8.0-win32-x86.exe And it worked. It appended the CMake installation path at the end of my big long path, and then when I uninstalled it, it removed it and put my PATH back to its original value. If anybody has any additional details that would help me reproduce this problem, I would really be grateful. The installer should NEVER destroy any part of your PATH other than the component it adds itself for the CMake bin directory... If you can reproduce it, please add a note to this issue in the bug tracker: http://public.kitware.com/Bug/view.php?id=9878 Thanks, David On Sun, Dec 13, 2009 at 10:04 AM, David Cole david.c...@kitware.comwrote: Can you give exact steps to reproduce and tell me exactly how you are observing the replacement? i.e.: - set your user PATH to something that is N characters long with M semi-colon separated components - look at My Computer Properties Advanced Environment Variables user PATH value to see the new PATH value I will try this again on Monday with the installer you've pointed out. Any additional details you can provide would be helpful. Thanks, David On Sun, Dec 13, 2009 at 8:28 AM, Mark Jones mark.jones1...@gmail.comwrote: Hi David, I was using the latest installer that I downloaded from the cmake page: http://www.cmake.org/files/v2.8/cmake-2.8.0-win32-x86.exe I am using Windows XP SP3. I have a relatively long PATH already. Is your PATH very long on the system that you tried to reproduce this on? I wonder if that has anything to do with it (maybe Windows tells it that it cannot append to the PATH and so it replaces the PATH completely?). Mark On Sat, Dec 12, 2009 at 9:28 AM, David Cole david.c...@kitware.comwrote: There are bug reports about that, but I cannot reproduce that bug here... What CMake installer were you running? Where did you get it from? See these bugs for more details: http://public.kitware.com/Bug/view.php?id=9878 http://public.kitware.com/Bug/view.php?id=8959 If you have steps to reproduce this problem, please re-open one of these bugs and attach details. (Exactly what steps you took that produced the problem...) Thanks, David On Sat, Dec 12, 2009 at 7:31 AM, Mark Jones mark.jones1...@gmail.comwrote: I chose to add cmake to my PATH (on Win XP 32) during the installation. After it finished I noticed that it completely overrode my PATH instead of appending to it. Is this a known bug? Thanks, Mark ___ 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] XCode + GCC 4.2
Hai Nguyen wrote: I can't seem to get the combination of XCode and GCC 4.2 to be happy with CMaka. I've tried several different ways to set the compiler version. Setting the CMAKE_C/CXX_COMPILER doesn't seem to work. But if i set the environment variabes, CMake comes back and tells me something like this: Run Build Command:/usr/local/bin/cmakexbuild -project CMAKE_TRY_COMPILE.xcodeproj build -target cmTryCompileExec -configuration Debug 2009-12-18 00:50:45.858 xcodebuild[42636:331b] Warning: Couldn't discover the 'gcc-4.2' compiler's built-in search paths and preprocessor definitions for language dialect 'c'. This may lead to indexing issues. Compiler: /Developer/Library/Xcode/Plug-ins/GCC 4.0.xcplugin/Contents/Resources/gcc-4.2 Reason: sh: /Developer/Library/Xcode/Plug-ins/GCC 4.0.xcplugin/Contents/Resources/gcc-4.2: No such file or directory What am I missing with here...? CMake doesn't yet support choosing the Xcode compiler. http://www.cmake.org/Bug/view.php?id=9125 -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] XCode + GCC 4.2
Downer. Thanks! - Hai On Fri, Dec 18, 2009 at 5:58 AM, Brad King brad.k...@kitware.com wrote: Hai Nguyen wrote: I can't seem to get the combination of XCode and GCC 4.2 to be happy with CMaka. I've tried several different ways to set the compiler version. Setting the CMAKE_C/CXX_COMPILER doesn't seem to work. But if i set the environment variabes, CMake comes back and tells me something like this: Run Build Command:/usr/local/bin/cmakexbuild -project CMAKE_TRY_COMPILE.xcodeproj build -target cmTryCompileExec -configuration Debug 2009-12-18 00:50:45.858 xcodebuild[42636:331b] Warning: Couldn't discover the 'gcc-4.2' compiler's built-in search paths and preprocessor definitions for language dialect 'c'. This may lead to indexing issues. Compiler: /Developer/Library/Xcode/Plug-ins/GCC 4.0.xcplugin/Contents/Resources/gcc-4.2 Reason: sh: /Developer/Library/Xcode/Plug-ins/GCC 4.0.xcplugin/Contents/Resources/gcc-4.2: No such file or directory What am I missing with here...? CMake doesn't yet support choosing the Xcode compiler. http://www.cmake.org/Bug/view.php?id=9125 -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] XCode + GCC 4.2
Hai Nguyen wrote: Downer. Thanks! You should be able to build with the compiler if you use the makefile builds. -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] using cmake to install dlls into windows/system32
On Fri, Dec 18, 2009 at 3:09 AM, Eric Noulard eric.noul...@gmail.comwrote: 2009/12/18 James Zipperer james.zippe...@modsystems.com: After a lot of trial and error and some rtfm work, I figured out a way to do it. The UpgradeDLL macro I mentioned below appears to be out of date and the preferred method is now InstallLib. It appears to handle DLL versioning and usage counting. Note: I could be wrong, I’ve been at this problem for about a day now. Here’s the hack solution I came up with: 1. Modify NSIS.template.in to include Library.nsh: I would say that if you have a specific behavior which is not configurable with the CMake provided NSIS.template.in you'll better craft your own NSIS.template.in which may contain as much specificities as you need. I mean not only adding include Library.nsh but whatever other NSIS installer code you need. Then after that if the install driver DLL thing is of general interest may be you can report a bug and propose a generic modification of the mainstream NSIS.template.in provided with cmake. See my note attached to this bug for a way to use your own override of the NSIS.template.in file. (So you can do it on a per-project basis rather than modifying the main one in the CMake installation...) http://public.kitware.com/Bug/view.php?id=9148 Note copy/pasted here to save you the hunting time: Make your own copy of the NSIS.template.in file Put it in a directory named ${CMAKE_CURRENT_SOURCE_DIR}/CMake Make edits to your own NSIS.template.in file as needed Put this in your CMakeLists.txt file: set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH}) Voila. CPack will now use your NSIS.template.in file instead of the built-in one. HTH, David ___ 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] third party library dependencies
On Fri, 18 Dec 2009 10:19:05 +0100, Marcel Loose lo...@astron.nl wrote: Hi Roman, Not in a portable way. I'm not too familiar with Windows, but on Linux you can do this when libA is a shared library that has its dependency on libB linked in (e.g. ldd libA.so will tell you this). When linking in static libraries you're out of luck. With shared libraries, you need not and *should not* explicitly link recursive dependencies. If you have both static and shared libraries, the output of ldd could be used to find the recursive deps needed to link statically. This sucks and the logic to determine whether to put recursive deps in FOO_LIBRARIES ends up going in FindFoo.cmake which is insane. FWIW, pkg-config has Libs.private for this purpose. Finally, it would be nice to easily associate a symbol with a call to find_library. That is, suppose libA links to libB and libC, but libA never exposes libB or libC to users. To do the right thing (without abusing ldd), FindA.cmake needs to try linking with just -lA (which will work with all shared libs), then try with -lA -lB and -lA -lC before falling back to -lA -lB -lC (which is required when all libs are static). A better way which does not have exponential complexity would be to declare that the symbol B_Foo belongs with a libB and C_Bar belongs with a libC. So when linking with -lA fails, libB would be added exactly when B_Foo is undefined. Jed ___ 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] using cmake to install dlls into windows/system32
2009/12/18 David Cole david.c...@kitware.com: See my note attached to this bug for a way to use your own override of the NSIS.template.in file. (So you can do it on a per-project basis rather than modifying the main one in the CMake installation...) http://public.kitware.com/Bug/view.php?id=9148 David, If this kind of request is pop-in up again may be it would be worth to make the feature a builtin of the CPack NSIS generator. Eg. putting in the CMakeLists.txt something like: SET(CPACK_NSIS_USER_TEMPLATE /whatever/path/to/NSIS.template.user) would you find it worth a valuable feature request? -- 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
Re: [CMake] using cmake to install dlls into windows/system32
On Fri, Dec 18, 2009 at 12:10 PM, Eric Noulard eric.noul...@gmail.comwrote: 2009/12/18 David Cole david.c...@kitware.com: See my note attached to this bug for a way to use your own override of the NSIS.template.in file. (So you can do it on a per-project basis rather than modifying the main one in the CMake installation...) http://public.kitware.com/Bug/view.php?id=9148 David, If this kind of request is pop-in up again may be it would be worth to make the feature a builtin of the CPack NSIS generator. Eg. putting in the CMakeLists.txt something like: SET(CPACK_NSIS_USER_TEMPLATE /whatever/path/to/NSIS.template.user) would you find it worth a valuable feature request? But there's already a way to do it. Why add a variable if you can achieve the goal as is...? ___ 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 dependancy for modification time
Hi Is there a way to have CMake check dependencies for last modification time and only rebuild if it has changed ? like with makedepend ? but not just for header files but for static libraries also ? Regards Iwan Aucamp ___ 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] Check dependancy for modification time
Iwan Aucamp wrote: Hi Is there a way to have CMake check dependencies for last modification time and only rebuild if it has changed ? like with makedepend ? but not just for header files but for static libraries also ? It already does this... Perhaps you are not using full paths to static libraries? -Bill -- Bill Hoffman Kitware, Inc. 28 Corporate Drive Clifton Park, NY 12065 bill.hoff...@kitware.com http://www.kitware.com 518 881-4905 (Direct) 518 371-3971 x105 Fax (518) 371-4573 ___ 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] Check dependancy for modification time
Bill Hoffman wrote: Iwan Aucamp wrote: Is there a way to have CMake check dependencies for last modification time and only rebuild if it has changed ? like with makedepend ? but not just for header files but for static libraries also ? It already does this... Perhaps you are not using full paths to static libraries? Actually just tested for .h files - just noticed the .h file I changed was not actually included - tested and saw it works - for static libs and include files ___ 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] Order of operations in CMakeLists.txt file?
Hendrik Sattler wrote: Zitat von Eric LaFranchi eric.lafran...@voltage.com: I'm confused about the following documentation. The CMake FAQ section How do I use a different compiler? states: Set the appropriate CMAKE_FOO_COMPILER variable(s) to a valid compiler name or full path in a list file using set(). This must be done before any language is set (ie before any project() or enable_language() command). I want to conditionally choose the compiler based on platform. My CMakeList.txt contains code similar to the following: cmake_minimum_required (VERSION 2.6) if (CMAKE_SYSTEM_NAME STREQUAL Platform1) set (CMAKE_C_COMPILER cc1) set (CMAKE_C_FLAGS -XYZ1) elseif (CMAKE_SYSTEM_NAME STREQUAL platform2) set (CMAKE_C_COMPILER cc2) set (CMAKE_C_FLAGS -XYZ2) endif() project(test) ... However, before project() is called, the CMAKE_SYSTEM_NAME appears undefined. When is CMAKE_SYSTEM_NAME defined? Is another option available to switch on the system before project() is invoked? use project(test NONE) to not enable any language. Then CMAKE_SYSTEM_NAME should be defined. OTOH, you may want to think again about your approach of doing things. It makes it impossible to change compilers on a platform without changing the CMakeList.txt file. What exactly is your use-case for the above stuff? HS We build on multiple platforms and some of the platforms have more than one C/C++ compiler installed. In the CMakeLists.txt we set the compiler and flags for each platform by switching on the platform based on CMAKE_SYSTEM_NAME. Can you suggest other mechanisms for doing this type of operation? -- Eric ___ 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] third party library dependencies
In my setup I have statically linked libraries, thus the library dependencies are not automatically pulled in. I suppose I can do some things with ldd to determine which libraries are needed. Initially, to make things simple, if libA used libB and libC (all statically linked) then when linking an executable against libA I will want to also link against libB and C. On Fri, Dec 18, 2009 at 11:54 AM, Jed Brown j...@59a2.org wrote: On Fri, 18 Dec 2009 10:19:05 +0100, Marcel Loose lo...@astron.nl wrote: Hi Roman, Not in a portable way. I'm not too familiar with Windows, but on Linux you can do this when libA is a shared library that has its dependency on libB linked in (e.g. ldd libA.so will tell you this). When linking in static libraries you're out of luck. With shared libraries, you need not and *should not* explicitly link recursive dependencies. If you have both static and shared libraries, the output of ldd could be used to find the recursive deps needed to link statically. This sucks and the logic to determine whether to put recursive deps in FOO_LIBRARIES ends up going in FindFoo.cmake which is insane. FWIW, pkg-config has Libs.private for this purpose. Finally, it would be nice to easily associate a symbol with a call to find_library. That is, suppose libA links to libB and libC, but libA never exposes libB or libC to users. To do the right thing (without abusing ldd), FindA.cmake needs to try linking with just -lA (which will work with all shared libs), then try with -lA -lB and -lA -lC before falling back to -lA -lB -lC (which is required when all libs are static). A better way which does not have exponential complexity would be to declare that the symbol B_Foo belongs with a libB and C_Bar belongs with a libC. So when linking with -lA fails, libB would be added exactly when B_Foo is undefined. Jed ___ 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] third party library dependencies
Realistically, what I want to create is something that allows me to define a dependency chain for static libraries so that the final executable developer does not need to worry about the dependencies. I should be able to abstract this away into a module. On Fri, Dec 18, 2009 at 2:45 PM, Roman Shtylman shtyl...@gmail.com wrote: In my setup I have statically linked libraries, thus the library dependencies are not automatically pulled in. I suppose I can do some things with ldd to determine which libraries are needed. Initially, to make things simple, if libA used libB and libC (all statically linked) then when linking an executable against libA I will want to also link against libB and C. On Fri, Dec 18, 2009 at 11:54 AM, Jed Brown j...@59a2.org wrote: On Fri, 18 Dec 2009 10:19:05 +0100, Marcel Loose lo...@astron.nl wrote: Hi Roman, Not in a portable way. I'm not too familiar with Windows, but on Linux you can do this when libA is a shared library that has its dependency on libB linked in (e.g. ldd libA.so will tell you this). When linking in static libraries you're out of luck. With shared libraries, you need not and *should not* explicitly link recursive dependencies. If you have both static and shared libraries, the output of ldd could be used to find the recursive deps needed to link statically. This sucks and the logic to determine whether to put recursive deps in FOO_LIBRARIES ends up going in FindFoo.cmake which is insane. FWIW, pkg-config has Libs.private for this purpose. Finally, it would be nice to easily associate a symbol with a call to find_library. That is, suppose libA links to libB and libC, but libA never exposes libB or libC to users. To do the right thing (without abusing ldd), FindA.cmake needs to try linking with just -lA (which will work with all shared libs), then try with -lA -lB and -lA -lC before falling back to -lA -lB -lC (which is required when all libs are static). A better way which does not have exponential complexity would be to declare that the symbol B_Foo belongs with a libB and C_Bar belongs with a libC. So when linking with -lA fails, libB would be added exactly when B_Foo is undefined. Jed ___ 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] Order of operations in CMakeLists.txt file?
Am Freitag 18 Dezember 2009 19:34:12 schrieb Eric LaFranchi: use project(test NONE) to not enable any language. Then CMAKE_SYSTEM_NAME should be defined. OTOH, you may want to think again about your approach of doing things. It makes it impossible to change compilers on a platform without changing the CMakeList.txt file. What exactly is your use-case for the above stuff? HS We build on multiple platforms and some of the platforms have more than one C/C++ compiler installed. In the CMakeLists.txt we set the compiler and flags for each platform by switching on the platform based on CMAKE_SYSTEM_NAME. Can you suggest other mechanisms for doing this type of operation? You have several options: 1. before calling cmake, include a set of environment variables that are recognized by cmake to configure for that toolchain. This can be the same name on each architecture, e.g.: export CC=cc1 export CPPFLAGS=-DFOO_X export CFLAGS=-cc1flag_a bash$ source /some/path/default-toolchain.sh bash$ cmake ../myproject 2. use a toolchain specific wrapper for cmake. Like for (1), this script can have the same name on each platform, e.g. #!/bin/sh exec cmake -DCMAKE_C_COMPILER=cc1 $@ 3. a combination of (1) and (2) The good thing: (1) is already the default use case of cmake when using MSVC7/8/9/10. Additionally, keeping this information out of the CMakeLists.txt scales better, especially when you want to use different compilers for one platform. The flags to make the software compile for a specific compiler or platform still belongs to the CMakeLists.txt, though. HS ___ 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] search order of find_file when multiple names are given
On Tuesday 15 December 2009, James Zipperer wrote: I have a find_file command with multiple names supplied, like the following: find_file(SOMEVAR NAMES name1 name2 name3) I'm wondering what happens if name1, name2, and name3 all exist in the same directory. I think the order as you listed them will be used. Is it guaranteed that find_file will always return the full path to name1? Yes. 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] Cpack ignoring file installs
This is important that DESTINATION must not be absolute: install(... DESTINANATION bin ) - correct install(... DESTINANATION ${CMAKE_INSTALL_PREFIX}/bin ) - incorrect BR, Anatoly Daniel Stonier : This is my first shot at cpack, so I may be missing something entirely obvious here. I have two parts to the install on my project, one are the libs, the other are the headers. The libs are installed via the INSTALL(TARGET ...) command, whereas the headers are installed via the INSTALL(FILES ... ) command. A normal cmake install will install everything, but cpack, when run, will only pick up the libraries. I can't seem to find any information that seems to indicate that this is normal in the documentation, but neither can I find any information that say this is what it appears to be - broken. Any pointers? Cheers, Daniel. ___ 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] Cpack ignoring file installs
Oh, exactly! Cheers. Daniel Stonier. 2009/12/19 Anatoly Shirokov shiroko...@mail.ru This is important that DESTINATION must not be absolute: install(... DESTINANATION bin ) - correct install(... DESTINANATION ${CMAKE_INSTALL_PREFIX}/bin ) - incorrect BR, Anatoly Daniel Stonier : This is my first shot at cpack, so I may be missing something entirely obvious here. I have two parts to the install on my project, one are the libs, the other are the headers. The libs are installed via the INSTALL(TARGET ...) command, whereas the headers are installed via the INSTALL(FILES ... ) command. A normal cmake install will install everything, but cpack, when run, will only pick up the libraries. I can't seem to find any information that seems to indicate that this is normal in the documentation, but neither can I find any information that say this is what it appears to be - broken. Any pointers? Cheers, Daniel. -- ___ 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