InstallElsaModule.cmake 1.16 KB
Newer Older
Tobias Lasser's avatar
Tobias Lasser committed
1
2
3
# install an elsa module

function(InstallElsaModule ELSA_MODULE_NAME ELSA_MODULE_TARGET_NAME ELSA_MODULE_EXPORT_TARGET)
David Frank's avatar
David Frank committed
4
    if(ELSA_INSTALL)
5
        # This is required so that the exported target has the name core and not elsa_core
6
        set_target_properties(${ELSA_MODULE_TARGET_NAME} PROPERTIES EXPORT_NAME ${ELSA_MODULE_NAME})
Tobias Lasser's avatar
Tobias Lasser committed
7

8
9
10
11
12
13
14
15
16
17
18
        include(GNUInstallDirs)
        # install the module
        install(TARGETS ${ELSA_MODULE_TARGET_NAME}
                EXPORT ${ELSA_MODULE_EXPORT_TARGET}
                INCLUDES DESTINATION include
                LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
                ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
                RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
        )
        # install the header files
        install(FILES ${MODULE_HEADERS}
19
                DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/elsa/${ELSA_MODULE_NAME}
20
21
22
23
24
25
26
        )
        # create the config file for the module
        install(EXPORT ${ELSA_MODULE_EXPORT_TARGET}
                FILE ${ELSA_MODULE_EXPORT_TARGET}.cmake
                NAMESPACE elsa::
                DESTINATION ${INSTALL_CONFIG_DIR}
        )
David Frank's avatar
David Frank committed
27
    endif(ELSA_INSTALL)
Tobias Lasser's avatar
Tobias Lasser committed
28
endfunction()