summaryrefslogtreecommitdiff
path: root/Source/cmFindCommon.h
diff options
context:
space:
mode:
authorChuck Atkins <chuck.atkins@kitware.com>2014-10-15 16:36:42 -0400
committerChuck Atkins <chuck.atkins@kitware.com>2014-11-11 13:39:51 -0500
commit2a9ac4bd83f7247539616545ef0772fea1f4a1fc (patch)
treea8b99f4caa8522d130b93727a9a345865f2ac35f /Source/cmFindCommon.h
parent32922840e7ea8a0536fec393352ede5b75087543 (diff)
downloadcmake-2a9ac4bd83f7247539616545ef0772fea1f4a1fc.tar.gz
Encapsulate search path manipulation functions into a seperate class.
The functions for adding the various different types of paths have been factored out into a new class, cmSearchPath. It is to be used as a helper container class for the various find_* commands.
Diffstat (limited to 'Source/cmFindCommon.h')
-rw-r--r--Source/cmFindCommon.h45
1 files changed, 18 insertions, 27 deletions
diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h
index dfb942ff43..8102392310 100644
--- a/Source/cmFindCommon.h
+++ b/Source/cmFindCommon.h
@@ -13,6 +13,7 @@
#define cmFindCommon_h
#include "cmCommand.h"
+#include "cmSearchPath.h"
/** \class cmFindCommon
* \brief Base class for FIND_XXX implementations.
@@ -29,15 +30,11 @@ public:
cmTypeMacro(cmFindCommon, cmCommand);
protected:
+ friend class cmSearchPath;
- enum RootPathMode { RootPathModeBoth,
- RootPathModeOnlyRootPath,
- RootPathModeNoRootPath };
-
- enum PathType { FullPath, CMakePath, EnvPath };
-
- /** Generate a full path based on the particular path type */
- std::string MakeFullPath(const std::string& path, PathType pathType);
+ enum RootPathMode { RootPathModeNever,
+ RootPathModeOnly,
+ RootPathModeBoth };
/** Place a set of search paths under the search roots. */
void RerootPaths(std::vector<std::string>& paths);
@@ -60,21 +57,15 @@ protected:
/** Compute the current default bundle/framework search policy. */
void SelectDefaultMacMode();
+ // Path arguments prior to path manipulation routines
+ std::vector<std::string> UserHintsArgs;
+ std::vector<std::string> UserGuessArgs;
+
std::string CMakePathName;
RootPathMode FindRootPathMode;
bool CheckCommonArgument(std::string const& arg);
void AddPathSuffix(std::string const& arg);
- void AddUserPath(std::string const& p,
- std::vector<std::string>& outPaths);
- void AddCMakePath(const std::string& variable,
- std::vector<std::string>& outPaths);
- void AddEnvPath(const char* variable, std::vector<std::string>& outPaths);
- void AddPathsInternal(std::vector<std::string> const& inPaths,
- PathType pathType, std::vector<std::string>& outPaths);
- void AddPathInternal(std::string const& inPath,
- std::vector<std::string>& outPaths);
-
void SetMakefile(cmMakefile* makefile);
bool NoDefaultPath;
@@ -84,15 +75,15 @@ protected:
bool NoCMakeSystemPath;
std::vector<std::string> SearchPathSuffixes;
- std::vector<std::string> CMakeVariablePaths;
- std::vector<std::string> CMakeEnvironmentPaths;
- std::vector<std::string> UserHintsPaths;
- std::vector<std::string> SystemEnvironmentPaths;
- std::vector<std::string> UserRegistryPaths;
- std::vector<std::string> BuildPaths;
- std::vector<std::string> CMakeSystemVariablePaths;
- std::vector<std::string> SystemRegistryPaths;
- std::vector<std::string> UserGuessPaths;
+ cmSearchPath CMakeVariablePaths;
+ cmSearchPath CMakeEnvironmentPaths;
+ cmSearchPath UserHintsPaths;
+ cmSearchPath SystemEnvironmentPaths;
+ cmSearchPath UserRegistryPaths;
+ cmSearchPath BuildPaths;
+ cmSearchPath CMakeSystemVariablePaths;
+ cmSearchPath SystemRegistryPaths;
+ cmSearchPath UserGuessPaths;
std::vector<std::string> SearchPaths;
std::set<std::string> SearchPathsEmitted;