From 530ade6677ec2c12fe8f3db5f5d71ad0ffaa9e68 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Mon, 6 Sep 2010 12:06:43 -0400 Subject: Fix targets with . in the name for VS 10 IDE. --- Source/cmVisualStudio10TargetGenerator.cxx | 5 ++--- Tests/CxxOnly/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 70680ad762..477945b39d 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -838,10 +838,10 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() *this->BuildFileStream << intermediateDir << "\n"; this->WritePlatformConfigTag("TargetName", config->c_str(), 3); - *this->BuildFileStream << cmSystemTools::GetFilenameWithoutExtension( + *this->BuildFileStream + << cmSystemTools::GetFilenameWithoutLastExtension( targetNameFull.c_str()) << "\n"; - this->WritePlatformConfigTag("TargetExt", config->c_str(), 3); *this->BuildFileStream << cmSystemTools::GetFilenameLastExtension( targetNameFull.c_str()) @@ -849,7 +849,6 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() this->OutputLinkIncremental(*config); } this->WriteString("\n", 2); - } diff --git a/Tests/CxxOnly/CMakeLists.txt b/Tests/CxxOnly/CMakeLists.txt index 8258eb427f..0b2c1c5924 100644 --- a/Tests/CxxOnly/CMakeLists.txt +++ b/Tests/CxxOnly/CMakeLists.txt @@ -2,7 +2,7 @@ project (CxxOnly CXX) set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") -add_library(testcxx1 STATIC libcxx1.cxx test.CPP) +add_library(testcxx1.my STATIC libcxx1.cxx test.CPP) add_library(testcxx2 SHARED libcxx2.cxx) add_executable (CxxOnly cxxonly.cxx) -target_link_libraries(CxxOnly testcxx1 testcxx2) +target_link_libraries(CxxOnly testcxx1.my testcxx2) -- cgit v1.2.1 From e79e412e70cb439354df589d83d3878c4dbe62fc Mon Sep 17 00:00:00 2001 From: David Cole Date: Thu, 9 Sep 2010 16:21:57 -0400 Subject: VS2010: Honor PROJECT_LABEL target property (#10611) --- Source/cmVisualStudio10TargetGenerator.cxx | 7 +++++++ Tests/FunctionTest/CMakeLists.txt | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 477945b39d..b374579664 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -155,6 +155,13 @@ void cmVisualStudio10TargetGenerator::Generate() this->WriteString("Win32Proj\n", 2); this->WriteString("", 2); (*this->BuildFileStream) << this->Platform << "\n"; + const char* projLabel = this->Target->GetProperty("PROJECT_LABEL"); + if(!projLabel) + { + projLabel = this->Name.c_str(); + } + this->WriteString("", 2); + (*this->BuildFileStream) << projLabel << "\n"; this->WriteString("\n", 1); this->WriteString("\n", diff --git a/Tests/FunctionTest/CMakeLists.txt b/Tests/FunctionTest/CMakeLists.txt index ef55173491..5d4f42d4ae 100644 --- a/Tests/FunctionTest/CMakeLists.txt +++ b/Tests/FunctionTest/CMakeLists.txt @@ -166,3 +166,11 @@ ELSE(DEFINED SUBDIR_DEFINED) ENDIF(DEFINED SUBDIR_DEFINED) ADD_EXECUTABLE(FunctionTest functionTest.c) + +# Use the PROJECT_LABEL property: in IDEs, the project label should appear +# in the UI rather than the target name. If this were a good test of the +# property rather than just a smoke test, it would verify that the label +# actually appears in the UI of the IDE... Or at least that the text appears +# somewhere in the generated project files. +SET_PROPERTY(TARGET miniFunctionTest + PROPERTY PROJECT_LABEL "Test de Fonctionnement") -- cgit v1.2.1 From ed37fc3ea398b03bbba175ae337f14b6af58daee Mon Sep 17 00:00:00 2001 From: David Cole Date: Mon, 13 Sep 2010 13:29:10 -0400 Subject: VS2010: Set IntDir for utility and global targets. VS2010 uses IntDir as the location for writing log files for what happens during custom build steps. With no IntDir settings, all ExternalProject usage within the same CMakeLists.txt file would result in multiple utility targets all trying to use the same custom build log files. With parallel builds, they would try to use them simultaneously and result in file access errors, preventing the builds from completing successfully. Now each utility target has its own IntDir setting, and so, its own custom build rule log files. --- Source/cmVisualStudio10TargetGenerator.cxx | 73 ++++++++++++++++++------------ 1 file changed, 45 insertions(+), 28 deletions(-) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index b374579664..b290aed731 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -814,10 +814,12 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() { - if(this->Target->GetType() > cmTarget::MODULE_LIBRARY) + cmTarget::TargetType ttype = this->Target->GetType(); + if(ttype > cmTarget::GLOBAL_TARGET) { return; } + this->WriteString("\n", 2); this->WriteString("<_ProjectFileVersion>10.0.20506.1" "\n", 3); @@ -827,33 +829,48 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() for(std::vector::iterator config = configs->begin(); config != configs->end(); ++config) { - std::string targetNameFull = - this->Target->GetFullName(config->c_str()); - std::string intermediateDir = this->LocalGenerator-> - GetTargetDirectory(*this->Target); - intermediateDir += "/"; - intermediateDir += *config; - intermediateDir += "/"; - this->ConvertToWindowsSlash(intermediateDir); - std::string outDir = this->Target->GetDirectory(config->c_str()); - this->ConvertToWindowsSlash(outDir); - this->WritePlatformConfigTag("OutDir", config->c_str(), 3); - *this->BuildFileStream << outDir - << "\\" - << "\n"; - this->WritePlatformConfigTag("IntDir", config->c_str(), 3); - *this->BuildFileStream << intermediateDir - << "\n"; - this->WritePlatformConfigTag("TargetName", config->c_str(), 3); - *this->BuildFileStream - << cmSystemTools::GetFilenameWithoutLastExtension( - targetNameFull.c_str()) - << "\n"; - this->WritePlatformConfigTag("TargetExt", config->c_str(), 3); - *this->BuildFileStream << cmSystemTools::GetFilenameLastExtension( - targetNameFull.c_str()) - << "\n"; - this->OutputLinkIncremental(*config); + if(ttype >= cmTarget::UTILITY) + { + this->WritePlatformConfigTag("IntDir", config->c_str(), 3); + *this->BuildFileStream + << "$(Platform)\\$(Configuration)\\$(ProjectName)\\" + << "\n"; + } + else + { + std::string targetNameFull = + this->Target->GetFullName(config->c_str()); + std::string intermediateDir = this->LocalGenerator-> + GetTargetDirectory(*this->Target); + intermediateDir += "/"; + intermediateDir += *config; + intermediateDir += "/"; + this->ConvertToWindowsSlash(intermediateDir); + std::string outDir = this->Target->GetDirectory(config->c_str()); + this->ConvertToWindowsSlash(outDir); + + this->WritePlatformConfigTag("OutDir", config->c_str(), 3); + *this->BuildFileStream << outDir + << "\\" + << "\n"; + + this->WritePlatformConfigTag("IntDir", config->c_str(), 3); + *this->BuildFileStream << intermediateDir + << "\n"; + + this->WritePlatformConfigTag("TargetName", config->c_str(), 3); + *this->BuildFileStream + << cmSystemTools::GetFilenameWithoutLastExtension( + targetNameFull.c_str()) + << "\n"; + + this->WritePlatformConfigTag("TargetExt", config->c_str(), 3); + *this->BuildFileStream + << cmSystemTools::GetFilenameLastExtension(targetNameFull.c_str()) + << "\n"; + + this->OutputLinkIncremental(*config); + } } this->WriteString("\n", 2); } -- cgit v1.2.1