summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
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 /Source/cmLocalGenerator.cxx
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 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 2faf647..0943c0c 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -75,10 +75,32 @@ void cmLocalGenerator::GenerateInstallRules()
const cmTargets &tgts = m_Makefile->GetTargets();
const char* prefix
= m_Makefile->GetDefinition("CMAKE_INSTALL_PREFIX");
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ std::string prefix_win32;
+ if(!prefix)
+ {
+ if(!cmSystemTools::GetEnv("SystemDrive", prefix_win32))
+ {
+ prefix_win32 = "C:";
+ }
+ const char* project_name = m_Makefile->GetDefinition("PROJECT_NAME");
+ if(project_name && project_name[0])
+ {
+ prefix_win32 += "/Program Files/";
+ prefix_win32 += project_name;
+ }
+ else
+ {
+ prefix_win32 += "/InstalledCMakeProject";
+ }
+ prefix = prefix_win32.c_str();
+ }
+#else
if (!prefix)
{
prefix = "/usr/local";
}
+#endif
std::string file = m_Makefile->GetStartOutputDirectory();
std::string homedir = m_Makefile->GetHomeOutputDirectory();