summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-02-22 20:22:40 (GMT)
committerBrad King <brad.king@kitware.com>2005-02-22 20:22:40 (GMT)
commit7c7b173042106c630fe625d62a82d8235577a1f5 (patch)
tree8c80f705f204b490d1bae6875b78eb54b3eb74f6 /Modules
parentec497c7a233d4196e227110604267b922da292b4 (diff)
downloadCMake-7c7b173042106c630fe625d62a82d8235577a1f5.zip
CMake-7c7b173042106c630fe625d62a82d8235577a1f5.tar.gz
CMake-7c7b173042106c630fe625d62a82d8235577a1f5.tar.bz2
ENH: Added better default install location for windows builds. The previous default /usr/local did not make much sense. Now "%SystemDrive%/Program Files/PROJECT_NAME" is used, which is the windows equivalent to /usr/local.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeGenericSystem.cmake23
1 files changed, 17 insertions, 6 deletions
diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake
index 167f148..004a98a 100644
--- a/Modules/CMakeGenericSystem.cmake
+++ b/Modules/CMakeGenericSystem.cmake
@@ -23,16 +23,27 @@ ENDIF(CMAKE_COMPILER_IS_GNUCXX)
SET (CMAKE_SKIP_RPATH "NO" CACHE BOOL
"If set, runtime paths are not added when using shared libraries.")
-SET (CMAKE_INSTALL_PREFIX /usr/local CACHE PATH
- "Install path prefix, prepended onto install directories.")
+
+# Choose a default install prefix for this platform.
+IF(UNIX)
+ SET(CMAKE_INSTALL_PREFIX "/usr/local"
+ CACHE PATH "Install path prefix, prepended onto install directories.")
+ELSE(UNIX)
+ IF("$ENV{SystemDrive}" MATCHES "^$")
+ SET(CMAKE_GENERIC_SYSTEM_DRIVE "C:")
+ ELSE("$ENV{SystemDrive}" MATCHES "^$")
+ SET(CMAKE_GENERIC_SYSTEM_DRIVE "$ENV{SystemDrive}")
+ ENDIF("$ENV{SystemDrive}" MATCHES "^$")
+ SET(CMAKE_INSTALL_PREFIX
+ "${CMAKE_GENERIC_SYSTEM_DRIVE}/Program Files/${PROJECT_NAME}"
+ CACHE PATH "Install path prefix, prepended onto install directories.")
+ SET(CMAKE_GENERIC_SYSTEM_DRIVE)
+ MARK_AS_ADVANCED(CMAKE_INSTALL_PREFIX)
+ENDIF(UNIX)
MARK_AS_ADVANCED(
CMAKE_SKIP_RPATH
)
-IF(NOT UNIX)
- MARK_AS_ADVANCED(CMAKE_INSTALL_PREFIX)
-ENDIF(NOT UNIX)
-
# always include the gcc compiler information
INCLUDE(Platform/gcc)