diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-10-04 11:18:47 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-10-15 18:22:47 +0200 |
commit | d4924d768c59de64c359764081bdd380d577ae17 (patch) | |
tree | 0732babbe6930ddee7c54645887b6d524785765c /cmake/cmake.d/03-macros.cmake | |
parent | 6b810ae67935e332cb8427fa41bc2ccbc374d448 (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}) |