MantisBT - CMake |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0014493 | CMake | CMake | public | 2013-10-18 08:45 | 2014-06-02 08:39 |
|
Reporter | mar-na | |
Assigned To | Brad King | |
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | | OS | | OS Version | |
Product Version | | |
Target Version | CMake 3.0 | Fixed in Version | CMake 3.0 | |
|
Summary | 0014493: Document relationship of VS_KEYWORD and VS_GLOBAL_KEYWORD |
Description | I want set the Visual Studio project keyword for a managed project to ManagedCProj. I use VS 2008.
I found the target property VS_GLOBAL_KEYWORD. It was added in Issue 0012586. But this only works for VS 2010 and not for VS 2008.
In the source code is this only added in cmVisualStudio10TargetGenerator.
Is cmLocalVisualStudio7Generator the right place to fix it?
There I found VS_KEYWORD. Is this the same?
cmLocalVisualStudio7Generator:
const char* keyword = target.GetProperty("VS_KEYWORD");
if(!keyword)
{
keyword = "Win32Proj";
}
from cmVisualStudio10TargetGenerator:
const char* vsGlobalKeyword =
this->Target->GetProperty("VS_GLOBAL_KEYWORD");
if(!vsGlobalKeyword)
{
this->WriteString("<Keyword>Win32Proj</Keyword>\n", 2);
}
else
{
this->WriteString("<Keyword>", 2);
(*this->BuildFileStream) << cmVS10EscapeXML(vsGlobalKeyword) <<
"</Keyword>\n";
} |
Steps To Reproduce | set_target_properties(myTarget PROPERTIES VS_GLOBAL_KEYWORD "ManagedCProj") |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | 0012586 | closed | Brad King | [patch] CMake does not support Visual Studio projects types or dotnet references with managed C++ | related to | 0008707 | closed | David Cole | Add support for global variables in Visual Studio generator |
|
Attached Files | Fix-target-property-for-visual-Studio-project-keyword.patch (2,692) 2013-10-21 05:22 https://public.kitware.com/Bug/file/4911/Fix-target-property-for-visual-Studio-project-keyword.patch
vs2008-managed_cpp_dotnet_2.vcproj (5,346) 2013-10-21 11:17 https://public.kitware.com/Bug/file/4916/vs2008-managed_cpp_dotnet_2.vcproj |
|
Issue History |
Date Modified | Username | Field | Change |
2013-10-18 08:45 | mar-na | New Issue | |
2013-10-18 09:08 | Brad King | Relationship added | related to 0012586 |
2013-10-18 09:13 | Brad King | Note Added: 0034151 | |
2013-10-18 09:15 | Brad King | Note Added: 0034152 | |
2013-10-21 05:22 | mar-na | File Added: Fix-target-property-for-visual-Studio-project-keyword.patch | |
2013-10-21 05:22 | mar-na | Note Added: 0034177 | |
2013-10-21 10:04 | Brad King | Note Added: 0034189 | |
2013-10-21 10:23 | Brad King | Note Added: 0034191 | |
2013-10-21 10:23 | Brad King | Assigned To | => Brad King |
2013-10-21 10:23 | Brad King | Status | new => resolved |
2013-10-21 10:23 | Brad King | Resolution | open => fixed |
2013-10-21 10:23 | Brad King | Fixed in Version | => CMake 3.0 |
2013-10-21 10:23 | Brad King | Target Version | => CMake 3.0 |
2013-10-21 10:23 | Brad King | Summary | Could not set Visual Studio project keyword with VS_GLOBAL_KEYWORD and VS 2008 => Document relationship of VS_KEYWORD and VS_GLOBAL_KEYWORD |
2013-10-21 10:49 | mar-na | Note Added: 0034200 | |
2013-10-21 10:49 | mar-na | Status | resolved => feedback |
2013-10-21 10:49 | mar-na | Resolution | fixed => reopened |
2013-10-21 10:54 | Brad King | Note Added: 0034202 | |
2013-10-21 10:55 | Brad King | Status | feedback => resolved |
2013-10-21 10:55 | Brad King | Resolution | reopened => fixed |
2013-10-21 11:16 | mar-na | Note Added: 0034206 | |
2013-10-21 11:16 | mar-na | Status | resolved => feedback |
2013-10-21 11:16 | mar-na | Resolution | fixed => reopened |
2013-10-21 11:17 | mar-na | File Added: vs2008-managed_cpp_dotnet_2.vcproj | |
2013-10-21 11:19 | Brad King | Note Added: 0034207 | |
2013-10-21 11:21 | Brad King | Relationship added | related to 0008787 |
2013-10-21 11:22 | Brad King | Relationship deleted | related to 0008787 |
2013-10-21 11:22 | Brad King | Relationship added | related to 0008708 |
2013-10-21 11:22 | Brad King | Relationship deleted | related to 0008708 |
2013-10-21 11:22 | mar-na | Note Added: 0034208 | |
2013-10-21 11:22 | mar-na | Status | feedback => assigned |
2013-10-21 11:22 | Brad King | Relationship added | related to 0008707 |
2013-10-21 11:23 | mar-na | Note Added: 0034209 | |
2013-10-21 11:25 | Brad King | Note Added: 0034210 | |
2014-01-27 13:51 | Brad King | Status | assigned => resolved |
2014-01-27 13:51 | Brad King | Resolution | reopened => fixed |
2014-06-02 08:39 | Robert Maynard | Note Added: 0036094 | |
2014-06-02 08:39 | Robert Maynard | Status | resolved => closed |
Notes |
|
(0034151)
|
Brad King
|
2013-10-18 09:13
|
|
|
|
(0034152)
|
Brad King
|
2013-10-18 09:15
|
|
It looks like VS_KEYWORD also has meaning for Fortran targets when generating the .vfproj files for the Intel Fortran VS plugin. |
|
|
(0034177)
|
mar-na
|
2013-10-21 05:22
|
|
Try to resolve: Fix-target-property-for-visual-Studio-project-keyword.patch
Tested with VS 2008 and VS 2010.
Marked VS_GLOBAL_KEYWORD as obsolete.
for VS <= 2008:
unchanged
for VS >= 2010:
Use VS_KEYWORD instead of VS_GLOBAL_KEYWORD.
If VS_GLOBAL_KEYWORD was found then use the value for VS_KEYWORD. (for Backward compatibility) |
|
|
(0034189)
|
Brad King
|
2013-10-21 10:04
|
|
The current behavior has been status-quo since 2.8.7 which is almost two years old now. I like the name VS_GLOBAL_KEYWORD better for VS 10 because it is grouped with other Global values in the msbuild project file set by VS_GLOBAL_* properties. I think it is better to just document the current behavior (which is for which version). |
|
|
(0034191)
|
Brad King
|
2013-10-21 10:23
|
|
|
|
(0034200)
|
mar-na
|
2013-10-21 10:49
|
|
Only a question. (Sorry if it is not allowed to reopen it for additional questions)
Should I allways added this in me CMakeList.txt files:
# sets the "keyword" attribute in the project file
if(MSVC_VERSION LESS 1600) # For < VS 2010
set_target_properties(MyTarget PROPERTIES VS_KEYWORD "ManagedCProj")
else() # For >= VS 2010
set_target_properties(MyTarget PROPERTIES VS_GLOBAL_KEYWORD "ManagedCProj") |
|
|
(0034202)
|
Brad King
|
2013-10-21 10:54
|
|
There is no reason not to set a property that will not be used so you can do just
set_target_properties(MyTarget PROPERTIES
VS_KEYWORD "ManagedCProj" # < VS 2010
VS_GLOBAL_KEYWORD "ManagedCProj" # >= VS 2010
) |
|
|
(0034206)
|
mar-na
|
2013-10-21 11:16
|
|
Sorry again
If I set VS_GLOBAL_KEYWORD in a VS 2008 project then I get it additional in the section global. But is this right?
When I create I Managed C++ Project direct with VS 2008 then it set only the Key attribut but do not added it to the global section.
<Globals>
</Globals> |
|
|
(0034207)
|
Brad King
|
2013-10-21 11:19
|
|
|
|
(0034208)
|
mar-na
|
2013-10-21 11:22
|
|
Add file wich was self generated with VS 2008.
When it was generated with CMake. I get this:
<Globals>
<Global
Name="KEYWORD"
Value="ManagedCProj"
/>
</Globals> |
|
|
(0034209)
|
mar-na
|
2013-10-21 11:23
|
|
Sorry. It was auto assign. How could I revert this?? |
|
|
(0034210)
|
Brad King
|
2013-10-21 11:25
|
|
This is a long-existing conflict between the old VS 2008 generator feature and the new VS 2010 VS_GLOBAL_* properties. Does the extra Global hurt anything? |
|
|
(0036094)
|
Robert Maynard
|
2014-06-02 08:39
|
|
Closing resolved issues that have not been updated in more than 4 months. |
|