aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cmake/cmake.d/03-macros.cmake14
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})