summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Bollo <jose.bollo@iot.bzh>2018-11-14 10:39:54 +0100
committerJose Bollo <jose.bollo@iot.bzh>2018-11-14 10:53:51 +0100
commitb895ea4a408bd2fd79468f0b5a6e0b71a7e10402 (patch)
tree1c1141d8e68e821b20160ea84ef991afb5fa16e4
parent742695d0946e0bf755204a5503603fd5285aa770 (diff)
Allow overwritting the installation directoryguppy_6.99.1guppy/6.99.16.99.1
At your own risks of course Change-Id: I1b613b9801a8b031f42321367148ae469f337af2 Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
-rw-r--r--CMakeLists.txt11
1 files changed, 8 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ebc3824..e9ca3f1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,9 +18,14 @@
cmake_minimum_required(VERSION 3.5)
+# compute the default install directory
include(GNUInstallDirs)
-
get_filename_component(CMAKE_DIR ${CMAKE_ROOT} NAME)
+set(DEFAULT_INSTALL_DIR ${CMAKE_INSTALL_DATADIR}/${CMAKE_DIR}/Modules)
+
+# set the install directory, allowing its overwriting
+set(INSTALL_DIR ${DEFAULT_INSTALL_DIR} CACHE PATH "Installation directory")
-INSTALL(FILES CMakeAfbTemplates.cmake DESTINATION ${CMAKE_INSTALL_DATADIR}/${CMAKE_DIR}/Modules)
-INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/ DESTINATION ${CMAKE_INSTALL_DATADIR}/${CMAKE_DIR}/Modules/CMakeAfbTemplates)
+# install the module
+INSTALL(FILES CMakeAfbTemplates.cmake DESTINATION ${INSTALL_DIR})
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/ DESTINATION ${INSTALL_DIR}/CMakeAfbTemplates)