aboutsummaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-05-29 02:02:59 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-05-29 02:02:59 +0200
commit8ca8aa2c6182de0980956d4dbab68750e85ca58f (patch)
tree8b55bf76ca5f6898d7897b4ad0e082e663caaa4c /cmake
parent67979984ee8be9b96bf600d5191ab9df303ba73e (diff)
Overload CMAKE_INSTALL_PREFIX if custom defined
Change-Id: I327d6af1862b4732f91d78abe26c7ffd6d2fbe51 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/common.cmake8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmake/common.cmake b/cmake/common.cmake
index d23614f..fa7b369 100644
--- a/cmake/common.cmake
+++ b/cmake/common.cmake
@@ -310,7 +310,13 @@ set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -ggdb -Wp,-U_FORTIFY_SOURCE")
set(CMAKE_CXX_FLAGS_RELEASE "-g -O2")
set(CMAKE_CXX_FLAGS_CCOV "-g -O2 --coverage")
-set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/Install" CACHE PATH "The path where to install")
+# Env variable overload default
+if(DEFINED ENV{INSTALL_PREFIX})
+ set (INSTALL_PREFIX $ENV{INSTALL_PREFIX})
+else()
+ set(INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/Install" CACHE PATH "The path where to install")
+endif()
+set(CMAKE_INSTALL_PREFIX ${INSTALL_PREFIX} CACHE STRING "Installation Prefix" FORCE)
# (BUG!!!) as PKG_CONFIG_PATH does not work [should be en env variable]
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON CACHE BOOLEAN "Flag for using prefix path")