MantisBT - CMake
View Issue Details
0008707CMakeCMakepublic2009-03-09 18:542013-10-21 11:22
Pau Garcia i Quiles 
David Cole 
normalfeatureN/A
closedfixed 
CMake-2-6 
CMake 2.8.6CMake 2.8.6 
0008707: Add support for global variables in Visual Studio generator
The attached patch against CVS adds support for SET_TARGET_PROPERTIES( thetarget PROPERTIES VS_GLOBAL_<variable> value ) in the Visual Studio generator. That creates this section in the .vcproj:

<Global
  Name="QtVersion"
  Value="4.5.0"
/>

It's useful for the Qt integration.
No tags attached.
related to 0013666closed  CMake fails to support existing custom VS_GLOBAL_* properties in VS10 (ProjectExtensions -> VisualStudio -> UserProperties) 
related to 0014493closed Brad King Document relationship of VS_KEYWORD and VS_GLOBAL_KEYWORD 
diff vs_global.diff (4,407) 2009-03-09 18:54
https://public.kitware.com/Bug/file/2114/vs_global.diff
diff vs_global_2.8.1rc1.diff (4,393) 2010-02-08 16:49
https://public.kitware.com/Bug/file/2851/vs_global_2.8.1rc1.diff
Issue History
2009-03-09 18:54Pau Garcia i QuilesNew Issue
2009-03-09 18:54Pau Garcia i QuilesFile Added: vs_global.diff
2009-03-09 19:08Pau Garcia i QuilesNote Added: 0015613
2009-11-23 09:17Pau Garcia i QuilesNote Added: 0018545
2010-02-08 16:49Pau Garcia i QuilesFile Added: vs_global_2.8.1rc1.diff
2010-02-08 16:50Pau Garcia i QuilesNote Added: 0019486
2010-12-14 15:36David ColeStatusnew => assigned
2010-12-14 15:36David ColeAssigned To => David Cole
2011-07-12 19:17Pau Garcia i QuilesNote Added: 0027033
2011-07-27 12:31David ColeNote Added: 0027079
2011-07-27 12:31David ColeTarget Version => CMake 2.8.6
2011-07-29 11:34David ColeNote Added: 0027115
2011-07-29 11:34David ColeStatusassigned => resolved
2011-07-29 11:34David ColeFixed in Version => CMake 2.8.6
2011-07-29 11:34David ColeResolutionopen => fixed
2012-01-02 15:56David ColeNote Added: 0028108
2012-01-02 15:56David ColeStatusresolved => closed
2012-11-09 08:18Brad KingRelationship addedrelated to 0013666
2013-10-21 11:22Brad KingRelationship addedrelated to 0014493

Notes
(0015613)
Pau Garcia i Quiles   
2009-03-09 19:08   
(copy and paste from my e-mail to the list)

I have created issue 0008707 in the bugtracker and attached the patch there. It's modelled after XCODE_ATTRIBUTE_<an-attribute>.

The patch adds support for:

 SET_TARGET_PROPERTIES( thetarget PROPERTIES VS_GLOBAL_<variable> value )

For instance:

SET_TARGET_PROPERTIES( thetarget PROPERTIES VS_GLOBAL_QtVersion ${QTVERSION} )

creates this section in the .vcproj:

<Global
  Name="QtVersion"
  Value="4.5.0"
/>

If I have understood correctly the XSD schema for vcproj files ( http://msdn.microsoft.com/en-us/library/y4sy8216.aspx [^] ), global variables with an empty name are allowed (it would probably be more correct to say they are not prohibited), so this patch allows them although I think that's just a mistake in the XSD and CMake should not create something like:

SET_TARGET_PROPERTIES( thetarget PROPERTIES VS_GLOBAL_ "blah" )

<Global
  Name=""
  Value="blah"
/>
(0018545)
Pau Garcia i Quiles   
2009-11-23 09:17   
What's the status on this? It's a fairly trivial patch but it makes a great difference when using CMake + Qt4 + Visual Studio
(0019486)
Pau Garcia i Quiles   
2010-02-08 16:50   
vs_global_2.8.1rc1.diff is the patch rebased to 2.8.1RC1. I don't know how to remove the old patch from the bug report.
(0027033)
Pau Garcia i Quiles   
2011-07-12 19:17   
Any chance this will ever be included in CMake?
(0027079)
David Cole   
2011-07-27 12:31   
Yes, there is a chance...
(0027115)
David Cole   
2011-07-29 11:34   
This commit, now in CMake 'next', resolves this issue:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=df9577259ca5a30f5c79baee038fe42e25b4a1e5 [^]

Thanks for your long-suffering patience on this one...
(0028108)
David Cole   
2012-01-02 15:56   
Closing resolved issues that have not been updated in more than 4 months.