diff options
author | Brad King <brad.king@kitware.com> | 2009-09-28 13:45:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-09-28 13:45:34 (GMT) |
commit | 6c59b924d2892191981f5fda94d8211d337d71c5 (patch) | |
tree | 43456d58ae67ffb46d7e4e1e07d68969bbe018ab /Source/cmFindPackageCommand.cxx | |
parent | f73c769dd666994ccbd2939faeca9b8d5ae6b186 (diff) | |
download | CMake-6c59b924d2892191981f5fda94d8211d337d71c5.zip CMake-6c59b924d2892191981f5fda94d8211d337d71c5.tar.gz CMake-6c59b924d2892191981f5fda94d8211d337d71c5.tar.bz2 |
Use BeAPI for per-user package registry on Haiku
Applications on Haiku are discouraged from storing their data in $HOME.
This teaches export(PACKAGE) and find_package() to use the BeAPI on
Haiku to store the package registry instead of using ~/.cmake/packages.
See issue #9603.
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index ff1d94c..3a791d9 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -23,6 +23,10 @@ #include "cmVariableWatch.h" #endif +#if defined(__HAIKU__) +#include <StorageKit.h> +#endif + void cmFindPackageNeedBackwardsCompatibility(const std::string& variable, int access_type, void*, const char* newValue, const cmMakefile*) @@ -1159,6 +1163,14 @@ void cmFindPackageCommand::AddPrefixesRegistry() #if defined(_WIN32) && !defined(__CYGWIN__) this->LoadPackageRegistryWin(); +#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()); + } #else if(const char* home = cmSystemTools::GetEnv("HOME")) { |