summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-09-14 15:07:23 -0400
committerCMake Topic Stage <kwrobot@kitware.com>2010-09-14 15:07:23 -0400
commit4c06e233071bac7821e27fece0c4d597c12798eb (patch)
tree81e2bdc3c3be5c51b1a0969bd2b46f641ac0d941
parent6580f5de996e99e090ccf9fefa5a2c5d14694478 (diff)
parenteccc7d5d267d7dc4eab027fab54ef4e7a63c8d4f (diff)
downloadcmake-4c06e233071bac7821e27fece0c4d597c12798eb.tar.gz
Merge topic 'resolve/fix_target_name_with_dot_vs10/allow_upper_case_cpp_and_others'
eccc7d5 Merge branch 'allow_upper_case_cpp_and_others' into resolve/fix_target_name_with_dot_vs10/allow_upper_case_cpp_and_others ed37fc3 VS2010: Set IntDir for utility and global targets. e79e412 VS2010: Honor PROJECT_LABEL target property (#10611) 530ade6 Fix targets with . in the name for VS 10 IDE.
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx81
-rw-r--r--Tests/CxxOnly/CMakeLists.txt4
-rw-r--r--Tests/FunctionTest/CMakeLists.txt8
3 files changed, 62 insertions, 31 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 70680ad762..b290aed731 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -155,6 +155,13 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteString("<Keyword>Win32Proj</Keyword>\n", 2);
this->WriteString("<Platform>", 2);
(*this->BuildFileStream) << this->Platform << "</Platform>\n";
+ const char* projLabel = this->Target->GetProperty("PROJECT_LABEL");
+ if(!projLabel)
+ {
+ projLabel = this->Name.c_str();
+ }
+ this->WriteString("<ProjectName>", 2);
+ (*this->BuildFileStream) << projLabel << "</ProjectName>\n";
this->WriteString("</PropertyGroup>\n", 1);
this->WriteString("<Import Project="
"\"$(VCTargetsPath)\\Microsoft.Cpp.Default.props\" />\n",
@@ -807,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("<PropertyGroup>\n", 2);
this->WriteString("<_ProjectFileVersion>10.0.20506.1"
"</_ProjectFileVersion>\n", 3);
@@ -820,36 +829,50 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions()
for(std::vector<std::string>::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
- << "\\"
- << "</OutDir>\n";
- this->WritePlatformConfigTag("IntDir", config->c_str(), 3);
- *this->BuildFileStream << intermediateDir
- << "</IntDir>\n";
- this->WritePlatformConfigTag("TargetName", config->c_str(), 3);
- *this->BuildFileStream << cmSystemTools::GetFilenameWithoutExtension(
- targetNameFull.c_str())
- << "</TargetName>\n";
-
- this->WritePlatformConfigTag("TargetExt", config->c_str(), 3);
- *this->BuildFileStream << cmSystemTools::GetFilenameLastExtension(
- targetNameFull.c_str())
- << "</TargetExt>\n";
- this->OutputLinkIncremental(*config);
+ if(ttype >= cmTarget::UTILITY)
+ {
+ this->WritePlatformConfigTag("IntDir", config->c_str(), 3);
+ *this->BuildFileStream
+ << "$(Platform)\\$(Configuration)\\$(ProjectName)\\"
+ << "</IntDir>\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
+ << "\\"
+ << "</OutDir>\n";
+
+ this->WritePlatformConfigTag("IntDir", config->c_str(), 3);
+ *this->BuildFileStream << intermediateDir
+ << "</IntDir>\n";
+
+ this->WritePlatformConfigTag("TargetName", config->c_str(), 3);
+ *this->BuildFileStream
+ << cmSystemTools::GetFilenameWithoutLastExtension(
+ targetNameFull.c_str())
+ << "</TargetName>\n";
+
+ this->WritePlatformConfigTag("TargetExt", config->c_str(), 3);
+ *this->BuildFileStream
+ << cmSystemTools::GetFilenameLastExtension(targetNameFull.c_str())
+ << "</TargetExt>\n";
+
+ this->OutputLinkIncremental(*config);
+ }
}
this->WriteString("</PropertyGroup>\n", 2);
-
}
diff --git a/Tests/CxxOnly/CMakeLists.txt b/Tests/CxxOnly/CMakeLists.txt
index d621499cc7..5d278906c0 100644
--- a/Tests/CxxOnly/CMakeLists.txt
+++ b/Tests/CxxOnly/CMakeLists.txt
@@ -5,7 +5,7 @@ set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix")
if(WIN32)
set(EXTRA_SRCS test.CPP)
endif()
-add_library(testcxx1 STATIC libcxx1.cxx ${EXTRA_SRCS})
+add_library(testcxx1.my STATIC libcxx1.cxx ${EXTRA_SRCS})
add_library(testcxx2 SHARED libcxx2.cxx)
add_executable (CxxOnly cxxonly.cxx)
-target_link_libraries(CxxOnly testcxx1 testcxx2)
+target_link_libraries(CxxOnly testcxx1.my testcxx2)
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")