summaryrefslogtreecommitdiff
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorAdrien Destugues <pulkomandy@pulkomandy.tk>2013-10-05 16:31:36 +0200
committerBrad King <brad.king@kitware.com>2013-10-08 09:55:38 -0400
commit1dc61f814277744581bb36ae40c91893c1bef851 (patch)
tree47b16a4ddc6daf294f6556e0af2dbb69f1d75e28 /Source/cmFindPackageCommand.cxx
parent7ebc1cb2ff3f79724711247be1edade38a3ef0f4 (diff)
downloadcmake-1dc61f814277744581bb36ae40c91893c1bef851.tar.gz
Haiku: Remove use of B_COMMON_DIRECTORY
The common directory was removed in Haiku. Applications are now installed in the system directory. Applied-by: Rolf Eike Beer <eike@sf-mail.de>
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx18
1 files changed, 11 insertions, 7 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index aa3a73d26f..1d6530f2ae 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -19,7 +19,9 @@
#endif
#if defined(__HAIKU__)
-#include <StorageKit.h>
+#include <string.h>
+#include <FindDirectory.h>
+#include <StorageDefs.h>
#endif
void cmFindPackageNeedBackwardsCompatibility(const std::string& variable,
@@ -1584,12 +1586,14 @@ void cmFindPackageCommand::AddPrefixesUserRegistry()
#if defined(_WIN32) && !defined(__CYGWIN__)
this->LoadPackageRegistryWinUser();
#elif defined(__HAIKU__)
- BPath dir;
- if (find_directory(B_USER_SETTINGS_DIRECTORY, &dir) == B_OK)
- {
- dir.Append("cmake/packages");
- dir.Append(this->Name.c_str());
- this->LoadPackageRegistryDir(dir.Path());
+ char dir[B_PATH_NAME_LENGTH];
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, dir, sizeof(dir)) ==
+ B_OK)
+ {
+ std::string fname = dir;
+ fname += "/cmake/packages/";
+ fname += Name;
+ this->LoadPackageRegistryDir(fname);
}
#else
if(const char* home = cmSystemTools::GetEnv("HOME"))