summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeGenericSystem.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-10-16 17:58:17 (GMT)
committerBrad King <brad.king@kitware.com>2006-10-16 17:58:17 (GMT)
commite55ff937487fe68772963b82f5b21857153ff225 (patch)
treeeffbbf712ee12716d971cb48d6c2f19b5061ebbc /Modules/CMakeGenericSystem.cmake
parent3a0b94131d423385996be34a1367431eec496f88 (diff)
downloadCMake-e55ff937487fe68772963b82f5b21857153ff225.zip
CMake-e55ff937487fe68772963b82f5b21857153ff225.tar.gz
CMake-e55ff937487fe68772963b82f5b21857153ff225.tar.bz2
ENH: Allow user project code to distinguish between an install prefix set on the command line and one set by CMake as a default. This is useful for changing the default prefix while still allowing the user to override it.
Diffstat (limited to 'Modules/CMakeGenericSystem.cmake')
-rw-r--r--Modules/CMakeGenericSystem.cmake8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake
index efa6f2b..47c84fc 100644
--- a/Modules/CMakeGenericSystem.cmake
+++ b/Modules/CMakeGenericSystem.cmake
@@ -41,6 +41,14 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles")
MARK_AS_ADVANCED(CMAKE_COLOR_MAKEFILE)
ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
+# Set a variable to indicate whether the value of CMAKE_INSTALL_PREFIX
+# was initialized by the block below. This is useful for user
+# projects to change the default prefix while still allowing the
+# command line to override it.
+IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
+ SET(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
+ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
+
# Choose a default install prefix for this platform.
IF(UNIX)
SET(CMAKE_INSTALL_PREFIX "/usr/local"