Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CMake
CMake
Commits
c42c039d
Commit
c42c039d
authored
Jul 11, 2017
by
Brad King
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'vs-2017-sln-guid' into release-3.9
parents
7638c6ea
5cf9c3d0
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
37 additions
and
12 deletions
+37
-12
Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst
Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst
+3
-1
Source/cmGlobalVisualStudio7Generator.cxx
Source/cmGlobalVisualStudio7Generator.cxx
+16
-4
Tests/RunCMake/VSSolution/MorePost-check.cmake
Tests/RunCMake/VSSolution/MorePost-check.cmake
+1
-1
Tests/RunCMake/VSSolution/MorePre-check.cmake
Tests/RunCMake/VSSolution/MorePre-check.cmake
+1
-1
Tests/RunCMake/VSSolution/OnePost-check.cmake
Tests/RunCMake/VSSolution/OnePost-check.cmake
+1
-1
Tests/RunCMake/VSSolution/OnePre-check.cmake
Tests/RunCMake/VSSolution/OnePre-check.cmake
+1
-1
Tests/RunCMake/VSSolution/Override1-check.cmake
Tests/RunCMake/VSSolution/Override1-check.cmake
+1
-1
Tests/RunCMake/VSSolution/Override2-check.cmake
Tests/RunCMake/VSSolution/Override2-check.cmake
+1
-1
Tests/RunCMake/VSSolution/Override3-check.cmake
Tests/RunCMake/VSSolution/Override3-check.cmake
+3
-0
Tests/RunCMake/VSSolution/Override3.cmake
Tests/RunCMake/VSSolution/Override3.cmake
+4
-0
Tests/RunCMake/VSSolution/PrePost-check.cmake
Tests/RunCMake/VSSolution/PrePost-check.cmake
+1
-1
Tests/RunCMake/VSSolution/RunCMakeTest.cmake
Tests/RunCMake/VSSolution/RunCMakeTest.cmake
+1
-0
Tests/RunCMake/VSSolution/solution_parsing.cmake
Tests/RunCMake/VSSolution/solution_parsing.cmake
+3
-0
No files found.
Help/prop_dir/VS_GLOBAL_SECTION_POST_section.rst
View file @
c42c039d
...
...
@@ -26,4 +26,6 @@ and ExtensibilityAddIns by default. If you set the corresponding
property, it will override the default section. For example, setting
VS_GLOBAL_SECTION_POST_ExtensibilityGlobals will override the default
contents of the ExtensibilityGlobals section, while keeping
ExtensibilityAddIns on its default.
ExtensibilityAddIns on its default. However, CMake will always
add a ``SolutionGuid`` to the ``ExtensibilityGlobals`` section
if it is not specified explicitly.
Source/cmGlobalVisualStudio7Generator.cxx
View file @
c42c039d
...
...
@@ -520,6 +520,7 @@ std::string cmGlobalVisualStudio7Generator::ConvertToSolutionPath(
void
cmGlobalVisualStudio7Generator
::
WriteSLNGlobalSections
(
std
::
ostream
&
fout
,
cmLocalGenerator
*
root
)
{
std
::
string
const
guid
=
this
->
GetGUID
(
root
->
GetProjectName
()
+
".sln"
);
bool
extensibilityGlobalsOverridden
=
false
;
bool
extensibilityAddInsOverridden
=
false
;
const
std
::
vector
<
std
::
string
>
propKeys
=
...
...
@@ -538,11 +539,14 @@ void cmGlobalVisualStudio7Generator::WriteSLNGlobalSections(
}
else
continue
;
if
(
!
name
.
empty
())
{
if
(
name
==
"ExtensibilityGlobals"
&&
sectionType
==
"postSolution"
)
bool
addGuid
=
false
;
if
(
name
==
"ExtensibilityGlobals"
&&
sectionType
==
"postSolution"
)
{
addGuid
=
true
;
extensibilityGlobalsOverridden
=
true
;
else
if
(
name
==
"ExtensibilityAddIns"
&&
sectionType
==
"postSolution"
)
}
else
if
(
name
==
"ExtensibilityAddIns"
&&
sectionType
==
"postSolution"
)
{
extensibilityAddInsOverridden
=
true
;
}
fout
<<
"
\t
GlobalSection("
<<
name
<<
") = "
<<
sectionType
<<
"
\n
"
;
std
::
vector
<
std
::
string
>
keyValuePairs
;
cmSystemTools
::
ExpandListArgument
(
...
...
@@ -557,15 +561,23 @@ void cmGlobalVisualStudio7Generator::WriteSLNGlobalSections(
const
std
::
string
value
=
cmSystemTools
::
TrimWhitespace
(
itPair
->
substr
(
posEqual
+
1
));
fout
<<
"
\t\t
"
<<
key
<<
" = "
<<
value
<<
"
\n
"
;
if
(
key
==
"SolutionGuid"
)
{
addGuid
=
false
;
}
}
}
if
(
addGuid
)
{
fout
<<
"
\t\t
SolutionGuid = {"
<<
guid
<<
"}
\n
"
;
}
fout
<<
"
\t
EndGlobalSection
\n
"
;
}
}
}
if
(
!
extensibilityGlobalsOverridden
)
if
(
!
extensibilityGlobalsOverridden
)
{
fout
<<
"
\t
GlobalSection(ExtensibilityGlobals) = postSolution
\n
"
<<
"
\t\t
SolutionGuid = {"
<<
guid
<<
"}
\n
"
<<
"
\t
EndGlobalSection
\n
"
;
}
if
(
!
extensibilityAddInsOverridden
)
fout
<<
"
\t
GlobalSection(ExtensibilityAddIns) = postSolution
\n
"
<<
"
\t
EndGlobalSection
\n
"
;
...
...
Tests/RunCMake/VSSolution/MorePost-check.cmake
View file @
c42c039d
parseGlobalSections
(
pre post MorePost
)
testGlobalSection
(
post TestSec2 Key1=Value1
"Key2=Value with spaces"
)
testGlobalSection
(
post TestSec4 Key6=Value1
"Key7=Value with spaces"
Key8=ValueWithoutSpaces
)
testGlobalSection
(
post ExtensibilityGlobals
)
testGlobalSection
(
post ExtensibilityGlobals
"SolutionGuid={00000000-0000-0000-0000-000000000000}"
)
testGlobalSection
(
post ExtensibilityAddIns
)
Tests/RunCMake/VSSolution/MorePre-check.cmake
View file @
c42c039d
parseGlobalSections
(
pre post MorePre
)
testGlobalSection
(
pre TestSec1 Key1=Value1
"Key2=Value with spaces"
)
testGlobalSection
(
pre TestSec3 Key3=Value1
"Key4=Value with spaces"
Key5=ValueWithoutSpaces
)
testGlobalSection
(
post ExtensibilityGlobals
)
testGlobalSection
(
post ExtensibilityGlobals
"SolutionGuid={00000000-0000-0000-0000-000000000000}"
)
testGlobalSection
(
post ExtensibilityAddIns
)
Tests/RunCMake/VSSolution/OnePost-check.cmake
View file @
c42c039d
parseGlobalSections
(
pre post OnePost
)
testGlobalSection
(
post TestSec2 Key1=Value1
"Key2=Value with spaces"
)
testGlobalSection
(
post ExtensibilityGlobals
)
testGlobalSection
(
post ExtensibilityGlobals
"SolutionGuid={00000000-0000-0000-0000-000000000000}"
)
testGlobalSection
(
post ExtensibilityAddIns
)
Tests/RunCMake/VSSolution/OnePre-check.cmake
View file @
c42c039d
parseGlobalSections
(
pre post OnePre
)
testGlobalSection
(
pre TestSec1 Key1=Value1
"Key2=Value with spaces"
)
testGlobalSection
(
post ExtensibilityGlobals
)
testGlobalSection
(
post ExtensibilityGlobals
"SolutionGuid={00000000-0000-0000-0000-000000000000}"
)
testGlobalSection
(
post ExtensibilityAddIns
)
Tests/RunCMake/VSSolution/Override1-check.cmake
View file @
c42c039d
parseGlobalSections
(
pre post Override1
)
testGlobalSection
(
post TestSec Key2=Value2 Key3=Value3
)
testGlobalSection
(
post ExtensibilityGlobals Key1=Value1
)
testGlobalSection
(
post ExtensibilityGlobals Key1=Value1
"SolutionGuid={00000000-0000-0000-0000-000000000000}"
)
testGlobalSection
(
post ExtensibilityAddIns
)
Tests/RunCMake/VSSolution/Override2-check.cmake
View file @
c42c039d
parseGlobalSections
(
pre post Override2
)
testGlobalSection
(
pre TestSec Key2=Value2 Key3=Value3
)
testGlobalSection
(
post ExtensibilityGlobals
)
testGlobalSection
(
post ExtensibilityGlobals
"SolutionGuid={00000000-0000-0000-0000-000000000000}"
)
testGlobalSection
(
post ExtensibilityAddIns Key1=Value1
)
Tests/RunCMake/VSSolution/Override3-check.cmake
0 → 100644
View file @
c42c039d
parseGlobalSections
(
pre post Override3
)
testGlobalSection
(
post ExtensibilityGlobals Key1=Value1
"SolutionGuid={custom-guid}"
)
testGlobalSection
(
post ExtensibilityAddIns
)
Tests/RunCMake/VSSolution/Override3.cmake
0 → 100644
View file @
c42c039d
set_property
(
DIRECTORY PROPERTY VS_GLOBAL_SECTION_POST_ExtensibilityGlobals
Key1=Value1
SolutionGuid={custom-guid}
)
Tests/RunCMake/VSSolution/PrePost-check.cmake
View file @
c42c039d
...
...
@@ -2,5 +2,5 @@ parseGlobalSections(pre post PrePost)
testGlobalSection
(
post Postsec Key1=Value2
)
testGlobalSection
(
pre Presec Key1=Value1
"Key2=Value with some spaces"
)
testGlobalSection
(
post Emptysec
)
testGlobalSection
(
post ExtensibilityGlobals
)
testGlobalSection
(
post ExtensibilityGlobals
"SolutionGuid={00000000-0000-0000-0000-000000000000}"
)
testGlobalSection
(
post ExtensibilityAddIns
)
Tests/RunCMake/VSSolution/RunCMakeTest.cmake
View file @
c42c039d
...
...
@@ -8,6 +8,7 @@ run_cmake(MorePost)
run_cmake
(
PrePost
)
run_cmake
(
Override1
)
run_cmake
(
Override2
)
run_cmake
(
Override3
)
run_cmake
(
StartupProject
)
run_cmake
(
StartupProjectMissing
)
run_cmake
(
AddPackageToDefault
)
...
...
Tests/RunCMake/VSSolution/solution_parsing.cmake
View file @
c42c039d
...
...
@@ -44,6 +44,9 @@ macro(parseGlobalSections arg_out_pre arg_out_post testName)
endif
()
string
(
STRIP
"
${
CMAKE_MATCH_1
}
"
key
)
string
(
STRIP
"
${
CMAKE_MATCH_2
}
"
value
)
if
(
key STREQUAL
"SolutionGuid"
AND value MATCHES
"^{[0-9A-F-]+}$"
)
set
(
value
"{00000000-0000-0000-0000-000000000000}"
)
endif
()
list
(
APPEND
${
out_
${
sectionType
}}
_
${
sectionName
}
"
${
key
}
=
${
value
}
"
)
endif
()
endforeach
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment