diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 21d1f349fd..d70d2afe42 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -619,6 +619,12 @@ bool cmGlobalVisualStudio10Generator::IsNsightTegra() const return !this->NsightTegraVersion.empty(); } +//---------------------------------------------------------------------------- +std::string cmGlobalVisualStudio10Generator::GetNsightTegraVersion() const +{ + return this->NsightTegraVersion; +} + //---------------------------------------------------------------------------- std::string cmGlobalVisualStudio10Generator::GetInstalledNsightTegraVersion() { diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 1df98e3bdb..3af7b51b69 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -61,6 +61,7 @@ public: /** Generating for Nsight Tegra VS plugin? */ bool IsNsightTegra() const; + std::string GetNsightTegraVersion() const; /** The toolset name for the target platform. */ const char* GetPlatformToolset() const; diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index b42bf90da3..8ac12dfe3c 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -181,6 +181,14 @@ cmVisualStudio10TargetGenerator(cmTarget* target, this->GUID = this->GlobalGenerator->GetGUID(this->Name.c_str()); this->Platform = gg->GetPlatformName(); this->NsightTegra = gg->IsNsightTegra(); + for(int i = + sscanf(gg->GetNsightTegraVersion().c_str(), "%u.%u.%u.%u", + &this->NsightTegraVersion[0], &this->NsightTegraVersion[1], + &this->NsightTegraVersion[2], &this->NsightTegraVersion[3]); + i < 4; ++i) + { + this->NsightTegraVersion[i] = 0; + } this->MSTools = !this->NsightTegra; this->TargetCompileAsWinRT = false; this->BuildFileStream = 0; @@ -316,9 +324,24 @@ void cmVisualStudio10TargetGenerator::Generate() if(this->NsightTegra) { this->WriteString("\n", 1); - this->WriteString("" - "7" - "\n", 2); + if(this->NsightTegraVersion[0] >= 2) + { + // Nsight Tegra 2.0 uses project revision 8. + this->WriteString("" + "8" + "\n", 2); + // Tell newer versions to upgrade silently when loading. + this->WriteString("" + "true" + "\n", 2); + } + else + { + // Require Nsight Tegra 1.6 for JCompile support. + this->WriteString("" + "7" + "\n", 2); + } this->WriteString("\n", 1); } diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h index 36155f9b34..a02dfa8450 100644 --- a/Source/cmVisualStudio10TargetGenerator.h +++ b/Source/cmVisualStudio10TargetGenerator.h @@ -142,6 +142,7 @@ private: std::string Name; bool MSTools; bool NsightTegra; + int NsightTegraVersion[4]; bool TargetCompileAsWinRT; cmGlobalVisualStudio10Generator* GlobalGenerator; cmGeneratedFileStream* BuildFileStream;