2003-01-22 01:15:22 +03:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
Program: CMake - Cross-Platform Makefile Generator
|
|
|
|
Module: $RCSfile$
|
|
|
|
Language: C++
|
|
|
|
Date: $Date$
|
|
|
|
Version: $Revision$
|
|
|
|
|
|
|
|
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
|
|
|
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
|
|
|
|
2007-12-15 22:17:21 +03:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
2003-01-22 01:15:22 +03:00
|
|
|
PURPOSE. See the above copyright notices for more information.
|
|
|
|
|
|
|
|
=========================================================================*/
|
|
|
|
#ifndef cmFindPackageCommand_h
|
|
|
|
#define cmFindPackageCommand_h
|
|
|
|
|
2008-01-17 17:02:31 +03:00
|
|
|
#include "cmFindCommon.h"
|
|
|
|
|
|
|
|
class cmFindPackageFileList;
|
2003-01-22 01:15:22 +03:00
|
|
|
|
|
|
|
/** \class cmFindPackageCommand
|
|
|
|
* \brief Load settings from an external project.
|
|
|
|
*
|
|
|
|
* cmFindPackageCommand
|
|
|
|
*/
|
2008-01-17 17:02:31 +03:00
|
|
|
class cmFindPackageCommand : public cmFindCommon
|
2003-01-22 01:15:22 +03:00
|
|
|
{
|
|
|
|
public:
|
2008-01-17 17:02:31 +03:00
|
|
|
cmFindPackageCommand();
|
|
|
|
|
2003-01-22 01:15:22 +03:00
|
|
|
/**
|
|
|
|
* This is a virtual constructor for the command.
|
|
|
|
*/
|
2007-12-15 22:17:21 +03:00
|
|
|
virtual cmCommand* Clone()
|
2003-01-22 01:15:22 +03:00
|
|
|
{
|
|
|
|
return new cmFindPackageCommand;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is called when the command is first encountered in
|
|
|
|
* the CMakeLists.txt file.
|
|
|
|
*/
|
|
|
|
virtual bool InitialPass(std::vector<std::string> const& args);
|
|
|
|
|
2005-12-07 19:39:08 +03:00
|
|
|
/**
|
|
|
|
* This determines if the command is invoked when in script mode.
|
|
|
|
*/
|
|
|
|
virtual bool IsScriptable() { return true; }
|
|
|
|
|
2003-01-22 01:15:22 +03:00
|
|
|
/**
|
|
|
|
* The name of the command as specified in CMakeList.txt.
|
|
|
|
*/
|
2007-10-10 19:47:43 +04:00
|
|
|
virtual const char* GetName() { return "find_package";}
|
2003-01-22 01:15:22 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Succinct documentation.
|
|
|
|
*/
|
2007-12-15 22:17:21 +03:00
|
|
|
virtual const char* GetTerseDocumentation()
|
2003-01-22 01:15:22 +03:00
|
|
|
{
|
|
|
|
return "Load settings for an external project.";
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* More documentation.
|
|
|
|
*/
|
2008-01-17 17:02:31 +03:00
|
|
|
virtual const char* GetFullDocumentation();
|
2007-12-15 22:17:21 +03:00
|
|
|
|
2008-01-17 17:02:31 +03:00
|
|
|
cmTypeMacro(cmFindPackageCommand, cmFindCommon);
|
2003-01-22 01:15:22 +03:00
|
|
|
private:
|
2008-01-17 17:02:31 +03:00
|
|
|
void AppendSuccessInformation();
|
2007-08-08 00:26:59 +04:00
|
|
|
void AppendToProperty(const char* propertyName);
|
2008-01-17 17:02:31 +03:00
|
|
|
bool FindModule(bool& found);
|
|
|
|
bool HandlePackageMode();
|
|
|
|
void FindConfig();
|
|
|
|
bool FindPrefixedConfig();
|
|
|
|
bool FindFrameworkConfig();
|
|
|
|
bool FindAppBundleConfig();
|
2003-01-22 01:15:22 +03:00
|
|
|
bool ReadListFile(const char* f);
|
|
|
|
|
2008-01-17 17:02:31 +03:00
|
|
|
void AddUserPath(std::string const& p);
|
|
|
|
void ComputePrefixes();
|
|
|
|
bool SearchDirectory(std::string const& dir);
|
|
|
|
bool CheckDirectory(std::string const& dir);
|
|
|
|
bool FindConfigFile(std::string const& dir, std::string& file);
|
|
|
|
bool SearchPrefix(std::string const& prefix);
|
|
|
|
bool SearchFrameworkPrefix(std::string const& prefix_in);
|
|
|
|
bool SearchAppBundlePrefix(std::string const& prefix_in);
|
|
|
|
|
|
|
|
friend class cmFindPackageFileList;
|
|
|
|
|
|
|
|
std::string CommandDocumentation;
|
2003-01-22 01:15:22 +03:00
|
|
|
cmStdString Name;
|
|
|
|
cmStdString Variable;
|
2008-01-17 17:02:31 +03:00
|
|
|
cmStdString FileFound;
|
|
|
|
bool Quiet;
|
|
|
|
bool Required;
|
|
|
|
bool Compatibility_1_6;
|
|
|
|
bool NoModule;
|
|
|
|
bool NoBuilds;
|
|
|
|
bool DebugMode;
|
|
|
|
std::vector<std::string> Names;
|
|
|
|
std::vector<std::string> Configs;
|
|
|
|
std::vector<std::string> Prefixes;
|
|
|
|
std::vector<std::string> UserPaths;
|
2003-01-22 01:15:22 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|