diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-10-04 11:18:47 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-10-04 11:18:47 +0200 |
commit | 637b244f181042698ecd8e2def04b276b0943062 (patch) | |
tree | 43e0e9e7dca0ab06f3ae4e88f37a3deccde5ad05 /cmake/cmake.d/03-macros.cmake | |
parent | cd0660512276d935b7e5e6f5ebae538f64e16f3f (diff) |
Control install destination directory
Either put all in a dedicated binding directory like a classic
widget install, either put all directly a CMAKE_INSTALL_PREFIX
root directory.
Change-Id: I54ebe8a680ea09af73c7fc9e6646fdd203fdeb98
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'cmake/cmake.d/03-macros.cmake')
-rw-r--r-- | cmake/cmake.d/03-macros.cmake | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/cmake/cmake.d/03-macros.cmake b/cmake/cmake.d/03-macros.cmake index fa4bd1f..6c87d95 100644 --- a/cmake/cmake.d/03-macros.cmake +++ b/cmake/cmake.d/03-macros.cmake @@ -238,10 +238,18 @@ macro(project_targets_populate) COMMAND mkdir -p ${PACKAGE_BINDIR} ${PACKAGE_ETCDIR} ${PACKAGE_LIBDIR} ${PACKAGE_HTTPDIR} ${PACKAGE_DATADIR}) add_custom_target(populate DEPENDS ${PACKAGE_BINDIR} ${PACKAGE_ETCDIR} ${PACKAGE_LIBDIR} ${PACKAGE_HTTPDIR} ${PACKAGE_DATADIR}) + # Dirty trick to define a default INSTALL command for app-templates handled + # targets INSTALL(CODE "execute_process(COMMAND make populate)") - INSTALL(DIRECTORY ${PROJECT_PKG_BUILD_DIR}/ - DESTINATION ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME} - ) + if(NO_DEDICATED_INSTALL_DIR) + INSTALL(DIRECTORY ${PROJECT_PKG_BUILD_DIR}/ + DESTINATION ${CMAKE_INSTALL_PREFIX} + ) + else() + INSTALL(DIRECTORY ${PROJECT_PKG_BUILD_DIR}/ + DESTINATION ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME} + ) + endif() get_property(PROJECT_TARGETS GLOBAL PROPERTY PROJECT_TARGETS) foreach(TARGET ${PROJECT_TARGETS}) |