diff options
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index ff1d94c..165dbc2 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -1,19 +1,14 @@ -/*========================================================================= +/*============================================================================ + CMake - Cross Platform Makefile Generator + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: CMake - Cross-Platform Makefile Generator - Module: $RCSfile$ - Language: C++ - Date: $Date$ - Version: $Revision$ + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + This software is distributed WITHOUT ANY WARRANTY; without even the + implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the License for more information. +============================================================================*/ #include "cmFindPackageCommand.h" #include <cmsys/Directory.hxx> @@ -23,6 +18,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*) @@ -330,15 +329,11 @@ bool cmFindPackageCommand this->DebugMode = this->Makefile->IsOn("CMAKE_FIND_DEBUG_MODE"); // Lookup whether lib64 paths should be used. - if(const char* sizeof_dptr = - this->Makefile->GetDefinition("CMAKE_SIZEOF_VOID_P")) + if(this->Makefile->PlatformIs64Bit() && + this->Makefile->GetCMakeInstance() + ->GetPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS")) { - if(atoi(sizeof_dptr) == 8 && - this->Makefile->GetCMakeInstance() - ->GetPropertyAsBool("FIND_LIBRARY_USE_LIB64_PATHS")) - { - this->UseLib64Paths = true; - } + this->UseLib64Paths = true; } // Find the current root path mode. @@ -1159,6 +1154,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")) { |