Search code examples
qtcmakensismingw32

How to tell cmake/cpack (NSIS) to deploy the required libs?


my program compiles and runs fine under Linux. Cross-compiling it for Windows also is no problem. But now I would like to tell CPack, that it should include all required libs (dlls) into the (NSIS) setup file.

For the Qt libs, I was successful:

IF (WIN32)
    INSTALL(FILES ${QT_LIBRARY_DIR}/libQtCore4.dll.a
                  ${QT_LIBRARY_DIR}/libQtGui4.dll.a
            DESTINATION bin)
ENDIF (WIN32)

But I don't know how to achieve this for, e.g., the libgcc, libstdc++ (without hard-coding the paths). Any hints on how to do this (using CMake 2.8.8)?


Solution

  • If you don't want to hardcode paths, then you should write your own CMake module, which finds those libraries and sets variables for you. Check out CMake Wiki.