diff options
author | Brad King <brad.king@kitware.com> | 2009-09-30 12:31:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-09-30 12:31:53 (GMT) |
commit | f40406ed6bbb47e2b68e20cb7dd623a7961b090b (patch) | |
tree | 096425cfe6c1e8a6e0c96cddfb8069fe7a50da68 /Source | |
parent | 27c04be03a2fe47ee57a6bac339abb7f42aedfeb (diff) | |
download | CMake-f40406ed6bbb47e2b68e20cb7dd623a7961b090b.zip CMake-f40406ed6bbb47e2b68e20cb7dd623a7961b090b.tar.gz CMake-f40406ed6bbb47e2b68e20cb7dd623a7961b090b.tar.bz2 |
Fix default install prefix on Haiku
Since Haiku does not have /usr (and therefore /usr/local), this commit
changes the default install prefix to the equivalent directory of
/boot/common.
See issue #9607.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CPack/cmCPackGenerator.cxx | 14 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 17 |
2 files changed, 31 insertions, 0 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index e2961dc..7c8405e 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -25,6 +25,10 @@ #include <cmsys/Glob.hxx> #include <memory> // auto_ptr +#if defined(__HAIKU__) +#include <StorageKit.h> +#endif + //---------------------------------------------------------------------- cmCPackGenerator::cmCPackGenerator() { @@ -1020,6 +1024,16 @@ const char* cmCPackGenerator::GetInstallPath() this->InstallPath += this->GetOption("CPACK_PACKAGE_NAME"); this->InstallPath += "-"; this->InstallPath += this->GetOption("CPACK_PACKAGE_VERSION"); +#elif defined(__HAIKU__) + BPath dir; + if (find_directory(B_COMMON_DIRECTORY, &dir) == B_OK) + { + this->InstallPath = dir.Path(); + } + else + { + this->InstallPath = "/boot/common"; + } #else this->InstallPath = "/usr/local/"; #endif diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 1cdcafc..ee55957 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -36,6 +36,10 @@ #include <assert.h> +#if defined(__HAIKU__) +#include <StorageKit.h> +#endif + cmLocalGenerator::cmLocalGenerator() { this->Makefile = 0; // moved to after set on global @@ -357,6 +361,19 @@ void cmLocalGenerator::GenerateInstallRules() } prefix = prefix_win32.c_str(); } +#elif defined(__HAIKU__) + if (!prefix) + { + BPath dir; + if (find_directory(B_COMMON_DIRECTORY, &dir) == B_OK) + { + prefix = dir.Path(); + } + else + { + prefix = "/boot/common"; + } + } #else if (!prefix) { |