[CMake] Recommended style for multiple CPack generator folder structures

Harry Mallon Harry at codexdigital.com
Tue May 24 07:40:17 EDT 2016


In answer to my own question. One way to do it which seems quite neat is as follows. Using multiple installs:

install(TARGETS bar
    COMPONENT bar
    DESTINATION "Applications/Foo"
)

install(TARGETS bar
    COMPONENT bar-standalone
    DESTINATION "./" # This must be "./" not "/" as it has to be a relative path
)

This in your CPACK_PROJECT_CONFIG_FILE:

if (CPACK_GENERATOR STREQUAL DragNDrop)
    set(CPACK_COMPONENTS_ALL bar-standalone)
endif()

Harry

Harry Mallon
CODEX | Software Engineer
60 Poland Street | London | England | W1F 7NT
E harry at codexdigital.com | T +44 203 7000 989


More information about the CMake mailing list