summaryrefslogtreecommitdiffstats
path: root/Source/cmExportCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-09-28 13:45:34 (GMT)
committerBrad King <brad.king@kitware.com>2009-09-28 13:45:34 (GMT)
commit6c59b924d2892191981f5fda94d8211d337d71c5 (patch)
tree43456d58ae67ffb46d7e4e1e07d68969bbe018ab /Source/cmExportCommand.cxx
parentf73c769dd666994ccbd2939faeca9b8d5ae6b186 (diff)
downloadCMake-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/cmExportCommand.cxx')
-rw-r--r--Source/cmExportCommand.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 945cfee..56cb0d0 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -24,6 +24,10 @@
#include "cmExportBuildFileGenerator.h"
+#if defined(__HAIKU__)
+#include <StorageKit.h>
+#endif
+
cmExportCommand::cmExportCommand()
:cmCommand()
,ArgumentGroup()
@@ -303,6 +307,16 @@ void cmExportCommand::StorePackageRegistryDir(std::string const& package,
const char* content,
const char* hash)
{
+#if defined(__HAIKU__)
+ BPath dir;
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, &dir) != B_OK)
+ {
+ return;
+ }
+ dir.Append("cmake/packages");
+ dir.Append(package.c_str());
+ std::string fname = dir.Path();
+#else
const char* home = cmSystemTools::GetEnv("HOME");
if(!home)
{
@@ -312,6 +326,7 @@ void cmExportCommand::StorePackageRegistryDir(std::string const& package,
cmSystemTools::ConvertToUnixSlashes(fname);
fname += "/.cmake/packages/";
fname += package;
+#endif
cmSystemTools::MakeDirectory(fname.c_str());
fname += "/";
fname += hash;