diff options
author | Brad King <brad.king@kitware.com> | 2013-11-15 15:41:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-11-18 16:30:50 (GMT) |
commit | 558c74d0abfe4f4fc8563ba615b7329083d232bc (patch) | |
tree | 31b9d14dc5f90065b28543890a1ab38716bfa571 /Source | |
parent | 5229f2df63369af1734783ee190cbfc7c41fac8f (diff) | |
download | CMake-558c74d0abfe4f4fc8563ba615b7329083d232bc.zip CMake-558c74d0abfe4f4fc8563ba615b7329083d232bc.tar.gz CMake-558c74d0abfe4f4fc8563ba615b7329083d232bc.tar.bz2 |
VS: Switch to internal CMAKE_MAKE_PROGRAM lookup by generators
Drop the "Modules/CMakeVS*FindMake.cmake" files. Override the
cmGlobalGenerator::FindMakeProgram method for VS generators to use their
internal APIs to locate the build tool. Set the CMAKE_MAKE_PROGRAM as a
normal variable for use by project code, but do not cache it. This will
allow CMake and CTest to select the proper tool at build time.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 1 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.h | 1 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio11Generator.cxx | 1 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio12Generator.cxx | 1 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio6Generator.cxx | 1 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio6Generator.h | 1 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio71Generator.cxx | 1 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 1 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.h | 1 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 1 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio9Generator.cxx | 1 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.cxx | 13 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.h | 3 |
14 files changed, 20 insertions, 9 deletions
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 74d88f3..6e93609 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -203,7 +203,7 @@ public: /* * Determine what program to use for building the project. */ - void FindMakeProgram(cmMakefile*); + virtual void FindMakeProgram(cmMakefile*); ///! Find a target by name by searching the local generators. cmTarget* FindTarget(const char* project, const char* name, diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 741d591..29401c6 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -92,7 +92,6 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator( : cmGlobalVisualStudio8Generator(name, platformName, additionalPlatformDefinition) { - this->FindMakeProgramFile = "CMakeVS10FindMake.cmake"; std::string vc10Express; this->ExpressEdition = cmSystemTools::ReadRegistryValue( "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0\\Setup\\VC;" diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index ad0aa6d..66440ea 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -118,5 +118,6 @@ private: bool MSBuildCommandInitialized; virtual std::string FindMSBuildCommand(); virtual std::string FindDevEnvCommand(); + virtual std::string GetVSMakeProgram() { return this->GetMSBuildCommand(); } }; #endif diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index d968c6d..f1d7312 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -112,7 +112,6 @@ cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator( : cmGlobalVisualStudio10Generator(name, platformName, additionalPlatformDefinition) { - this->FindMakeProgramFile = "CMakeVS11FindMake.cmake"; std::string vc11Express; this->ExpressEdition = cmSystemTools::ReadRegistryValue( "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\11.0\\Setup\\VC;" diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index f3806df..edd5567 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -87,7 +87,6 @@ cmGlobalVisualStudio12Generator::cmGlobalVisualStudio12Generator( : cmGlobalVisualStudio11Generator(name, platformName, additionalPlatformDefinition) { - this->FindMakeProgramFile = "CMakeVS12FindMake.cmake"; std::string vc12Express; this->ExpressEdition = cmSystemTools::ReadRegistryValue( "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\12.0\\Setup\\VC;" diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index 08ea249..8651da7 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/Source/cmGlobalVisualStudio6Generator.cxx @@ -32,7 +32,6 @@ std::string GetVS6TargetName(const std::string& targetName) cmGlobalVisualStudio6Generator::cmGlobalVisualStudio6Generator() { - this->FindMakeProgramFile = "CMakeVS6FindMake.cmake"; this->MSDevCommandInitialized = false; } diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h index 24f46b3..8fe5792 100644 --- a/Source/cmGlobalVisualStudio6Generator.h +++ b/Source/cmGlobalVisualStudio6Generator.h @@ -92,6 +92,7 @@ public: protected: virtual const char* GetIDEVersion() { return "6.0"; } private: + virtual std::string GetVSMakeProgram() { return this->GetMSDevCommand(); } void GenerateConfigurations(cmMakefile* mf); void WriteDSWFile(std::ostream& fout); void WriteDSWHeader(std::ostream& fout); diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 2643719..61d3c4c 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -19,7 +19,6 @@ cmGlobalVisualStudio71Generator::cmGlobalVisualStudio71Generator( const char* platformName) : cmGlobalVisualStudio7Generator(platformName) { - this->FindMakeProgramFile = "CMakeVS71FindMake.cmake"; this->ProjectConfigurationSectionName = "ProjectConfiguration"; } diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 08eff31..3d939f3 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -20,7 +20,6 @@ cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator( const char* platformName) { - this->FindMakeProgramFile = "CMakeVS7FindMake.cmake"; this->IntelProjectVersion = 0; this->DevEnvCommandInitialized = false; diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index d272fa0..c7b0081 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -173,6 +173,7 @@ private: char* IntelProjectVersion; std::string DevEnvCommand; bool DevEnvCommandInitialized; + virtual std::string GetVSMakeProgram() { return this->GetDevEnvCommand(); } }; #define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK" diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 949dd1b..69b0a7a 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -94,7 +94,6 @@ cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator( const char* additionalPlatformDefinition) : cmGlobalVisualStudio71Generator(platformName) { - this->FindMakeProgramFile = "CMakeVS8FindMake.cmake"; this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; this->Name = name; diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx index aadf982..ccc27ad 100644 --- a/Source/cmGlobalVisualStudio9Generator.cxx +++ b/Source/cmGlobalVisualStudio9Generator.cxx @@ -101,7 +101,6 @@ cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator( : cmGlobalVisualStudio8Generator(name, platformName, additionalPlatformDefinition) { - this->FindMakeProgramFile = "CMakeVS9FindMake.cmake"; } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index af80070..7afcfa7 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -500,6 +500,19 @@ void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target) } //---------------------------------------------------------------------------- +void cmGlobalVisualStudioGenerator::FindMakeProgram(cmMakefile* mf) +{ + // Visual Studio generators know how to lookup their build tool + // directly instead of needing a helper module to do it, so we + // do not actually need to put CMAKE_MAKE_PROGRAM into the cache. + if(cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) + { + mf->AddDefinition("CMAKE_MAKE_PROGRAM", + this->GetVSMakeProgram().c_str()); + } +} + +//---------------------------------------------------------------------------- void cmGlobalVisualStudioGenerator::AddPlatformDefinitions(cmMakefile* mf) { if(this->AdditionalPlatformDefinition) diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index ce03a0e..da2d021 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -82,6 +82,8 @@ public: }; class OrderedTargetDependSet; + virtual void FindMakeProgram(cmMakefile*); + protected: // Does this VS version link targets to each other if there are // dependencies in the SLN file? This was done for VS versions @@ -107,6 +109,7 @@ protected: const char* AdditionalPlatformDefinition; private: + virtual std::string GetVSMakeProgram() = 0; void PrintCompilerAdvice(std::ostream&, std::string, const char*) {} void ComputeTargetObjects(cmGeneratorTarget* gt) const; |