diff options
author | Brad King <brad.king@kitware.com> | 2008-06-05 22:20:16 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-06-05 22:20:16 (GMT) |
commit | 789c167b6f4d7cc630be4baa78d14a8688722ddd (patch) | |
tree | a22d09e3030b1a301cdd957751bd31c732f6fe94 /Source/cmFindBase.h | |
parent | 3ecfb5f7e8e57d4c273d25eeaaecffea2cf51d09 (diff) | |
download | CMake-789c167b6f4d7cc630be4baa78d14a8688722ddd.zip CMake-789c167b6f4d7cc630be4baa78d14a8688722ddd.tar.gz CMake-789c167b6f4d7cc630be4baa78d14a8688722ddd.tar.bz2 |
ENH: Refactor cmFindCommon, cmFindBase, and cmFindPackageCommand
- Add each part of the search order in a separate method.
- Collect added paths in an ivar in cmFindCommon.
- Move user path storage up to cmFindCommon and share
between cmFindBase and cmFindPackageCommand.
- Expand user path registry values up in cmFindCommon
- Enables 32-/64-bit registry view for find_package
- Disables registry expansion for paths not specified
with the PATHS argument, which is not expected.
Diffstat (limited to 'Source/cmFindBase.h')
-rw-r--r-- | Source/cmFindBase.h | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/Source/cmFindBase.h b/Source/cmFindBase.h index 86a76f7..a678ccf 100644 --- a/Source/cmFindBase.h +++ b/Source/cmFindBase.h @@ -41,19 +41,9 @@ public: protected: void PrintFindStuff(); - void ExpandPaths(std::vector<std::string> userPaths); + void ExpandPaths(); + void AddPathSuffixes(); - // add to the SearchPaths - void AddPaths(std::vector<std::string>& paths); - void AddFrameWorkPaths(); - void AddAppBundlePaths(); - void AddEnvironmentVariables(); - void AddFindPrefix(std::vector<std::string>& dest, - const std::vector<std::string>& src); - void AddCMakeVariables(); - void AddSystemEnvironmentVariables(); - void AddCMakeSystemVariables(); - void ExpandRegistryAndCleanPath(std::vector<std::string>& paths); // see if the VariableName is already set in the cache, // also copy the documentation from the cache to VariableDocumentation // if it has documentation in the cache @@ -64,13 +54,27 @@ protected: cmStdString VariableDocumentation; cmStdString VariableName; std::vector<std::string> Names; - std::vector<std::string> SearchPaths; // CMAKE_*_PATH CMAKE_SYSTEM_*_PATH FRAMEWORK|LIBRARY|INCLUDE|PROGRAM cmStdString EnvironmentPath; // LIB,INCLUDE bool AlreadyInCache; bool AlreadyInCacheWithoutMetaInfo; +private: + // Add pieces of the search. + void AddFrameworkPath(); + void AddAppBundlePath(); + void AddCMakeEnvironmentPath(); + void AddCMakeVariablePath(); + void AddSystemEnvironmentPath(); + void AddCMakeSystemVariablePath(); + + // Helpers. + void AddMacPath(const char* var, const char* sysvar); + void AddCMakePrefixPath(const char* variable); + void AddEnvPrefixPath(const char* variable); + void AddPrefixPaths(std::vector<std::string> const& in_paths, + PathType pathType); }; |