[Cmake-commits] [cmake-commits] king committed cmExportCommand.cxx 1.12 1.13 cmFindPackageCommand.cxx 1.62 1.63

cmake-commits at cmake.org cmake-commits at cmake.org
Mon Sep 28 09:45:37 EDT 2009


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv7214/Source

Modified Files:
	cmExportCommand.cxx cmFindPackageCommand.cxx 
Log Message:
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.


Index: cmExportCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmExportCommand.cxx,v
retrieving revision 1.12
retrieving revision 1.13
diff -C 2 -d -r1.12 -r1.13
*** cmExportCommand.cxx	1 Sep 2009 18:04:53 -0000	1.12
--- cmExportCommand.cxx	28 Sep 2009 13:45:33 -0000	1.13
***************
*** 25,28 ****
--- 25,32 ----
  #include "cmExportBuildFileGenerator.h"
  
+ #if defined(__HAIKU__)
+ #include <StorageKit.h>
+ #endif
+ 
  cmExportCommand::cmExportCommand()
  :cmCommand()
***************
*** 304,307 ****
--- 308,321 ----
                                                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)
***************
*** 313,316 ****
--- 327,331 ----
    fname += "/.cmake/packages/";
    fname += package;
+ #endif
    cmSystemTools::MakeDirectory(fname.c_str());
    fname += "/";

Index: cmFindPackageCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFindPackageCommand.cxx,v
retrieving revision 1.62
retrieving revision 1.63
diff -C 2 -d -r1.62 -r1.63
*** cmFindPackageCommand.cxx	11 Sep 2009 12:18:07 -0000	1.62
--- cmFindPackageCommand.cxx	28 Sep 2009 13:45:34 -0000	1.63
***************
*** 24,27 ****
--- 24,31 ----
  #endif
  
+ #if defined(__HAIKU__)
+ #include <StorageKit.h>
+ #endif
+ 
  void cmFindPackageNeedBackwardsCompatibility(const std::string& variable,
    int access_type, void*, const char* newValue,
***************
*** 1160,1163 ****
--- 1164,1175 ----
  #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"))



More information about the Cmake-commits mailing list