summaryrefslogtreecommitdiffstats
path: root/Source/cmFindCommon.h
diff options
context:
space:
mode:
authorChuck Atkins <chuck.atkins@kitware.com>2014-10-17 17:07:26 (GMT)
committerChuck Atkins <chuck.atkins@kitware.com>2014-11-12 13:21:46 (GMT)
commit1abd7cd930022ba045c3c0cd34406cbe19db84d3 (patch)
tree9514de06c2c7c9a072991560597139357510063d /Source/cmFindCommon.h
parent2a9ac4bd83f7247539616545ef0772fea1f4a1fc (diff)
downloadCMake-1abd7cd930022ba045c3c0cd34406cbe19db84d3.zip
CMake-1abd7cd930022ba045c3c0cd34406cbe19db84d3.tar.gz
CMake-1abd7cd930022ba045c3c0cd34406cbe19db84d3.tar.bz2
Use containers of labeled search paths instead of individual members
Manage classes of search paths in labeled containers. This removes the need to have a seperate member variable for each type of search path, but also allows path types to be grouped togethor in various different ways and manipulated as subsets of the full set of search paths.
Diffstat (limited to 'Source/cmFindCommon.h')
-rw-r--r--Source/cmFindCommon.h50
1 files changed, 41 insertions, 9 deletions
diff --git a/Source/cmFindCommon.h b/Source/cmFindCommon.h
index 8102392..e65b2fc 100644
--- a/Source/cmFindCommon.h
+++ b/Source/cmFindCommon.h
@@ -14,6 +14,7 @@
#include "cmCommand.h"
#include "cmSearchPath.h"
+#include "cmPathLabel.h"
/** \class cmFindCommon
* \brief Base class for FIND_XXX implementations.
@@ -32,10 +33,45 @@ public:
protected:
friend class cmSearchPath;
+/* VS6 is broken and can't pass protected class definitions to child classes */
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+public:
+#endif
+ /** Used to define groups of path labels */
+ class PathGroup : public cmPathLabel
+ {
+ protected:
+ PathGroup();
+ public:
+ PathGroup(const std::string& label) : cmPathLabel(label) { }
+ static PathGroup All;
+ };
+
+ /* Individual path types */
+ class PathLabel : public cmPathLabel
+ {
+ protected:
+ PathLabel();
+ public:
+ PathLabel(const std::string& label) : cmPathLabel(label) { }
+ static PathLabel CMake;
+ static PathLabel CMakeEnvironment;
+ static PathLabel Hints;
+ static PathLabel SystemEnvironment;
+ static PathLabel CMakeSystem;
+ static PathLabel Guess;
+ };
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+protected:
+#endif
+
enum RootPathMode { RootPathModeNever,
RootPathModeOnly,
RootPathModeBoth };
+ /** Construct the various path groups and labels */
+ void InitializeSearchPathGroups();
+
/** Place a set of search paths under the search roots. */
void RerootPaths(std::vector<std::string>& paths);
@@ -75,15 +111,11 @@ protected:
bool NoCMakeSystemPath;
std::vector<std::string> SearchPathSuffixes;
- cmSearchPath CMakeVariablePaths;
- cmSearchPath CMakeEnvironmentPaths;
- cmSearchPath UserHintsPaths;
- cmSearchPath SystemEnvironmentPaths;
- cmSearchPath UserRegistryPaths;
- cmSearchPath BuildPaths;
- cmSearchPath CMakeSystemVariablePaths;
- cmSearchPath SystemRegistryPaths;
- cmSearchPath UserGuessPaths;
+
+ std::map<PathGroup, std::vector<PathLabel> > PathGroupLabelMap;
+ std::vector<PathGroup> PathGroupOrder;
+ std::map<std::string, PathLabel> PathLabelStringMap;
+ std::map<PathLabel, cmSearchPath> LabeledPaths;
std::vector<std::string> SearchPaths;
std::set<std::string> SearchPathsEmitted;