Re: [CMake] Collecting libraries for NSIS installer
Ok, apparently I'm the only person that can't figure out how generator expressions work but I worked around it using find_program to find the resultant executable in the source directory, which I think is a really bad way to do it, but it works. Then I use find_library to get the full path of the library because get_filename_component isn't working for me. Thanks, Richard -- 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] Collecting libraries for NSIS installer
Hi Richard, Generator expression won't work in install rules. Instead, I suggest you simply use install(TARGET ...) for regular targets. Hth Jc On Mon, Aug 25, 2014 at 5:02 PM, Richard Shaw hobbes1...@gmail.com wrote: Ok, apparently I'm the only person that can't figure out how generator expressions work but I worked around it using find_program to find the resultant executable in the source directory, which I think is a really bad way to do it, but it works. Then I use find_library to get the full path of the library because get_filename_component isn't working for me. Thanks, Richard -- 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 -- +1 919 869 8849 -- 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] Collecting libraries for NSIS installer
On Mon, Aug 25, 2014 at 4:10 PM, Jean-Christophe Fillion-Robin jchris.filli...@kitware.com wrote: Hi Richard, Generator expression won't work in install rules. Instead, I suggest you simply use install(TARGET ...) for regular targets. That explains that problem. I'm not sure if you followed the whole thread but what I'm trying to do is collect all the dependent DLL's for packaging into the NSIS installer. I don't think install(TARGET... will work here. I'm using the GetPrerequisites module which needs the absolute path to the binary/library to scan. I tried to use get_target_property but it complained that generator expressions should be used instead, which as you mention don't work for install rules. I use find_program to get the full location to the generated binary which I then pass to get_prerequisites(...) to get the required dll's. Then I used find_library to get the location to the library for installation purposes (win32 only). Thanks, Richard -- 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] Collecting libraries for NSIS installer
On Tue, Aug 19, 2014 at 11:40 AM, Hendrik Sattler p...@hendrik-sattler.de wrote: On 19. August 2014 16:36:14 MESZ, David Cole via CMake cmake@cmake.org wrote: Definitely getting warmer! It looks like that GetPrerequistes only works on an existing target so I'm thinking I would have to set this up as a super cmake project after the main project is already built? Right, or as a script that runs at install time. It requires an executable file to analyze, so it can come up with the required DLLs. Actually I wonder why this is needed? If all libraries are linked will full path or via imported targets (those that do it right on windows), why do the binaries have to be checked Yes, the more I look at this the more I realize it's not going to work. The script method is going to install the required libraries, in my case on win32 no one is going to run make install it's instead going to be make package. I guess what I need is a way to translate the import libraries into the runtime dll paths. The .a is easy enough to handle in regex, but in most cases the import library is in /usr/lib and the runtime library is in /usr/bin. Is there a property I can interrogate to get there? Thanks, Richard -- 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] Collecting libraries for NSIS installer
Yes, the more I look at this the more I realize it's not going to work. The script method is going to install the required libraries, in my case on win32 no one is going to run make install it's instead going to be make package. But make package typically runs make install under the hood... So if you get it to work with make install it should just work with make package. D -- 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] Collecting libraries for NSIS installer
Ok, that being the case I tried it out. There's two things I'm doing differently than the only example[1] I found: 1. Using install(CODE...) instead of install(SCRIPT...), shouldn't work any differently, right? 2. The example is from 2009 and uses: GET_TARGET_PROPERTY(MY_BINARY_LOCATION my_binary LOCATION) Which I get a policy warning about. I tried using $TARGET_FILE:freedv inside of get_but apparently I'm not getting how that's supposed to be used. Here's the whole code block: if(WIN32) install(CODE INCLUDE(GetPrerequisites) GET_PREREQUISITES($TARGET_FILE:freedv DEPENDENCIES 1 1 \\ \\) message(\Checking for dependencies in $TARGET_FILE:fredv\) message(\Dependencies: ${DEPENDENCIES}\) FOREACH(DEPENDENCY ${DEPENDENCIES}) GET_FILENAME_COMPONENT(DEPENDENCY_NAME \${DEPENDENCY}\ NAME) GET_FILENAME_COMPONENT(DEPENDENCY_ACTUAL \${DEPENDENCY}\ REALPATH) message(\DEPENDENCY_NAME: ${DEPENDENCY_NAME}\) message(\DEPENDENCY_ACTUAL: ${DEPENDENCY_ACTUAL}\) FILE(INSTALL DESTINATION bin TYPE EXECUTABLE RENAME \${DEPENDENCY_NAME}\ FILES \${DEPENDENCY_ACTUAL}\ ) ENDFOREACH() ) endif(WIN32) --- end --- Ideas? Thanks, Richard [1] http://www.cmake.org/pipermail/cmake/2009-June/029975.html -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Collecting libraries for NSIS installer
Ok, short answer to #1, no you can't use install(CODE because all your cmake variables we be evaluated now instead of later. Same problem though when I use install(SCRIPT... Run CPack packaging tool... CPack: Create package using NSIS CPack: Install projects CPack: - Run preinstall target for: FreeDV CPack: - Install project: FreeDV warning: target '$TARGET_FILE:freedv' is not absolute... warning: target '$TARGET_FILE:freedv' does not exist... C:/msys32/mingw32/bin/objdump.exe: '$TARGET_FILE:freedv': No such file Dependencies: Thanks, Richard -- 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] Collecting libraries for NSIS installer
I have a project where I currently have a dumb list of libraries to package with the NSIS installer so the program will work under win32. It really only works for one setup (currently Fedora mingw) with some prebuilt libraries downloaded, others provided through Fedora, and others I build myself. This is not very portable to say the least. Is there an easy way when after find_library(...) or find_package(...) to collect the appropriate libraries for the NSIS installer? Some of the dependencies might be static libraries which I need to ignore, but the others will be DLL's which I need to pull into the installer. Thanks, Richard -- 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] Collecting libraries for NSIS installer
Have you considered GetPrerequisites.cmake or BundleUtilities.cmake? http://www.cmake.org/cmake/help/v3.0/module/GetPrerequisites.html http://www.cmake.org/cmake/help/v3.0/module/BundleUtilities.html It sounds like exactly what you're asking for. HTH, David C. -- 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] Collecting libraries for NSIS installer
Definitely getting warmer! It looks like that GetPrerequistes only works on an existing target so I'm thinking I would have to set this up as a super cmake project after the main project is already built? Right, or as a script that runs at install time. It requires an executable file to analyze, so it can come up with the required DLLs. D -- 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] Collecting libraries for NSIS installer
On 19. August 2014 16:36:14 MESZ, David Cole via CMake cmake@cmake.org wrote: Definitely getting warmer! It looks like that GetPrerequistes only works on an existing target so I'm thinking I would have to set this up as a super cmake project after the main project is already built? Right, or as a script that runs at install time. It requires an executable file to analyze, so it can come up with the required DLLs. Actually I wonder why this is needed? If all libraries are linked will full path or via imported targets (those that do it right on windows), why do the binaries have to be checked? HS -- 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