diff options
Diffstat (limited to 'Source/cmake.h')
-rw-r--r-- | Source/cmake.h | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/Source/cmake.h b/Source/cmake.h index 4ddacf7..02c6cdb 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -3,11 +3,12 @@ #ifndef cmake_h #define cmake_h -#include "cmConfigure.h" +#include "cmConfigure.h" // IWYU pragma: keep #include <map> #include <set> #include <string> +#include <unordered_set> #include <vector> #include "cmInstalledFile.h" @@ -203,16 +204,16 @@ public: ///! Get the names of the current registered generators void GetRegisteredGenerators(std::vector<GeneratorInfo>& generators) const; - ///! Set the name of the selected generator-specific platform. - void SetGeneratorPlatform(std::string const& ts) + ///! Set the name of the selected generator-specific instance. + void SetGeneratorInstance(std::string const& instance) { - this->GeneratorPlatform = ts; + this->GeneratorInstance = instance; } - ///! Get the name of the selected generator-specific platform. - std::string const& GetGeneratorPlatform() const + ///! Set the name of the selected generator-specific platform. + void SetGeneratorPlatform(std::string const& ts) { - return this->GeneratorPlatform; + this->GeneratorPlatform = ts; } ///! Set the name of the selected generator-specific toolset. @@ -221,21 +222,31 @@ public: this->GeneratorToolset = ts; } - ///! Get the name of the selected generator-specific toolset. - std::string const& GetGeneratorToolset() const + const std::vector<std::string>& GetSourceExtensions() const { - return this->GeneratorToolset; + return this->SourceFileExtensions; } - const std::vector<std::string>& GetSourceExtensions() const + bool IsSourceExtension(const std::string& ext) const { - return this->SourceFileExtensions; + return this->SourceFileExtensionsSet.find(ext) != + this->SourceFileExtensionsSet.end(); } + const std::vector<std::string>& GetHeaderExtensions() const { return this->HeaderFileExtensions; } + bool IsHeaderExtension(const std::string& ext) const + { + return this->HeaderFileExtensionsSet.find(ext) != + this->HeaderFileExtensionsSet.end(); + } + + // Strips the extension (if present and known) from a filename + std::string StripExtension(const std::string& file) const; + /** * Given a variable name, return its value (as a string). */ @@ -268,8 +279,7 @@ public: * number provided may be negative in cases where a message is * to be displayed without any progress percentage. */ - void SetProgressCallback(ProgressCallbackType f, - void* clientData = CM_NULLPTR); + void SetProgressCallback(ProgressCallbackType f, void* clientData = nullptr); ///! this is called by generators to update the progress void UpdateProgress(const char* msg, float prog); @@ -414,6 +424,9 @@ public: const std::string& config, const std::vector<std::string>& nativeOptions, bool clean); + ///! run the --open option + bool Open(const std::string& dir, bool dryRun); + void UnwatchUnusedCli(const std::string& var); void WatchUnusedCli(const std::string& var); @@ -441,6 +454,7 @@ protected: cmGlobalGenerator* GlobalGenerator; std::map<std::string, DiagLevel> DiagLevels; + std::string GeneratorInstance; std::string GeneratorPlatform; std::string GeneratorToolset; @@ -489,7 +503,9 @@ private: std::string CheckStampList; std::string VSSolutionFile; std::vector<std::string> SourceFileExtensions; + std::unordered_set<std::string> SourceFileExtensionsSet; std::vector<std::string> HeaderFileExtensions; + std::unordered_set<std::string> HeaderFileExtensionsSet; bool ClearBuildSystem; bool DebugTryCompile; cmFileTimeComparison* FileComparison; |