diff options
Diffstat (limited to 'cmake/cmake.d')
-rw-r--r-- | cmake/cmake.d/03-macros.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/cmake.d/03-macros.cmake b/cmake/cmake.d/03-macros.cmake index 085c249..0d24a40 100644 --- a/cmake/cmake.d/03-macros.cmake +++ b/cmake/cmake.d/03-macros.cmake @@ -108,6 +108,13 @@ ENDMACRO(LIST_FILTER) # Generic useful macro # ----------------------- +macro(set_install_prefix) + if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND INSTALL_PREFIX) + message(STATUS "-- Overwrite the CMAKE default install prefix with ${INSTALL_PREFIX}") + set(CMAKE_INSTALL_PREFIX ${INSTALL_PREFIX} CACHE PATH "Install prefix" FORCE) + endif() +endmacro() + macro(PROJECT_TARGET_ADD TARGET_NAME) set_property(GLOBAL APPEND PROPERTY PROJECT_TARGETS ${TARGET_NAME}) set(TARGET_NAME ${TARGET_NAME}) |