[CMake] distribute third party libs with NSIS

Michaël Presseau presseaum at amdinc.ca
Mon May 17 14:41:21 EDT 2010


Hi, I have an application and I need to create an installer. I use CPack with NSIS. For now, I'm using :
find_package(Boost COMPONENTS thread date_time filesystem REQUIRED)

This give me le .lib associate to the dll file. This is compiling and working on computer with Boost already install.

My problems occurs when I need to install the application on computer that doesn't have boost already install. What is the right way to do this.

I have the same problems with another third party libs called orocos. Here is what I've tried:
        add_library(orocos-rtt-win32 SHARED IMPORTED)

        get_filename_component(OROCOS_RTT_LIBRARY_DIR ${OROCOS_RTT_LIBRARY} PATH)

        set_target_properties( orocos-rtt-win32 PROPERTIES
                                                   IMPORTED_LOCATION "${OROCOS_RTT_LIBRARY_DIR}"
                                                   IMPORTED_IMPLIB ${OROCOS_RTT_LIBRARY}
                                                   IMPORT_SUFFIX ".dll"
                                                   IMPORT_PREFIX ""
        )

        install (TARGETS orocos-rtt-win32
               RUNTIME DESTINATION ./
                 LIBRARY DESTINATION ./
                 ARCHIVE DESTINATION ./
        )

And I've got the following message: CMake Error at MainGUI/CMakeLists.txt:50 (install):
  install TARGETS given target "orocos-rtt-win32" which does not exist in
  this directory.
If I remove the install command of orocos-rtt-win32, the orocos-rtt-win32.lib is add correctely to the project. But this isn't a way to do it with Boost because of the version tag in the names. So maybe this isn't a right way to do it.

How I am supposed to do install and distribute my third party libs (not in CMake project)?

Thank for the help!


Michael

AUTOMATION MACHINE DESIGN RC INC
Site Internet :www.amdinc.ca





More information about the CMake mailing list