[Cmake-commits] CMake branch, master, updated. v3.9.0-rc3-103-g7c5299a
Kitware Robot
kwrobot at kitware.com
Thu Jun 15 10:25:04 EDT 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, master has been updated
via 7c5299add429d4b4714a6070bc6f8186585e9a2f (commit)
via f3ffd18ab6ea78d6a13e83a4d890a619a5a2705c (commit)
via 2afc4bf60843872e7d9fa883c61427facdbb4cae (commit)
via 1c5471527e08b3a1c883889024773678741b77d0 (commit)
via 4e3483c0074e07efaffd5269a4b5fb1a38a2bc50 (commit)
via 76a0286b1d53ba35d6fa7cee152259bc040d80fb (commit)
via c90630c501fed40078b280fe940535ff9545c2c9 (commit)
from 41897b4665d49690200024eb18e083861730779b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7c5299add429d4b4714a6070bc6f8186585e9a2f
commit 7c5299add429d4b4714a6070bc6f8186585e9a2f
Merge: f3ffd18 1c54715
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Jun 15 14:23:34 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Jun 15 10:23:38 2017 -0400
Merge topic 'doc-test-layout'
1c547152 Tests: Document test directory layout in a README.rst
4e3483c0 Help/dev: Update source code guide to cover source tree layout
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !967
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f3ffd18ab6ea78d6a13e83a4d890a619a5a2705c
commit f3ffd18ab6ea78d6a13e83a4d890a619a5a2705c
Merge: 2afc4bf c90630c
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Jun 15 14:22:07 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Jun 15 10:22:12 2017 -0400
Merge topic 'vs_csharp_prop_for_all_extensions'
c90630c5 Vs: add support for VS_CSHARP_* target property for additional file extensions
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !961
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2afc4bf60843872e7d9fa883c61427facdbb4cae
commit 2afc4bf60843872e7d9fa883c61427facdbb4cae
Merge: 41897b4 76a0286
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Jun 15 14:20:04 2017 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Jun 15 10:20:08 2017 -0400
Merge topic 'UseSWIG-avoid-dllimport-repeat'
76a0286b UseSWIG: Add `-dllimport` only if not already specified
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !958
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1c5471527e08b3a1c883889024773678741b77d0
commit 1c5471527e08b3a1c883889024773678741b77d0
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Jun 14 15:04:19 2017 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Jun 14 15:04:19 2017 -0400
Tests: Document test directory layout in a README.rst
Cross-reference the CMake Source Code Guide document.
Also drop the outdated `Tests/README` file.
diff --git a/Help/dev/source.rst b/Help/dev/source.rst
index 0fa8d77..16a9252 100644
--- a/Help/dev/source.rst
+++ b/Help/dev/source.rst
@@ -93,7 +93,7 @@ The CMake source tree is organized as follows.
packagers, etc.
* ``Tests/``:
- The test suite.
+ The test suite. See `Tests/README.rst`_.
* ``Utilities/``:
Scripts, third-party source code.
@@ -103,3 +103,5 @@ The CMake source tree is organized as follows.
* ``Utilities/Release/``:
Scripts used to package CMake itself for distribution on ``cmake.org``.
+
+.. _`Tests/README.rst`: ../../Tests/README.rst
diff --git a/Tests/README b/Tests/README
deleted file mode 100644
index 8b2fda8..0000000
--- a/Tests/README
+++ /dev/null
@@ -1,39 +0,0 @@
-If you think about adding a new testcase then here is a small checklist you
-can run through to find a proper place for it. Go through the list from the
-beginning and stop once you find something that matches your tests needs,
-i.e. if you will test a module and only need the configure mode use the
-instructions from section 2, not 3.
-
-1. Your testcase can run in CMake script mode, i.e. "cmake -P something"
-
-Put your test in Tests/CMakeTests/ directory as a .cmake.in file. It will be
-put into the test binary directory by configure_file(... @ONLY) and run from
-there. Use the AddCMakeTest() macro in Tests/CMakeTests/CMakeLists.txt to add
-your test to the test runs.
-
-2. Your test needs CMake to run in configure mode, but will not build anything
-
-This includes tests that will build something using try_compile() and friends,
-but nothing that expects add_executable(), add_library(), or add_test() to run.
-
-If the test configures the project only once and it must succeed then put it
-into the Tests/CMakeOnly/ directory. Create a subdirectory named like your
-test and write the CMakeLists.txt you need into that subdirectory. Use the
-add_CMakeOnly_test() macro from Tests/CMakeOnly/CMakeLists.txt to add your
-test to the test runs.
-
-If the test configures the project with multiple variations and verifies
-success or failure each time then put it into the Tests/RunCMake/ directory.
-Read the instructions in Tests/RunCMake/CMakeLists.txt to add a test.
-
-3. If you are testing something from the Modules directory
-
-Put your test in the Tests/Modules/ directory. Create a subdirectory there
-named after your test. Use the ADD_TEST_MACRO macro from Tests/CMakeLists.txt
-to add your test to the test run. If you have put your stuff in
-Tests/Modules/Foo then you call it using ADD_TEST_MACRO(Module.Foo Foo).
-
-4. You are doing other stuff.
-
-Find a good place ;) In doubt mail to cmake-developers at cmake.org and ask for
-advise.
diff --git a/Tests/README.rst b/Tests/README.rst
new file mode 100644
index 0000000..3e98938
--- /dev/null
+++ b/Tests/README.rst
@@ -0,0 +1,31 @@
+CMake Tests Directory
+*********************
+
+This directory contains the CMake test suite.
+See also the `CMake Source Code Guide`_.
+
+.. _`CMake Source Code Guide`: ../Help/dev/source.rst
+
+Many tests exist as immediate subdirectories, but some tests
+are organized as follows.
+
+* ``CMakeLib/``:
+ Source code, used for tests, that links to the ``CMakeLib`` library
+ defined over in ``Source/``.
+
+* ``CMakeOnly/``:
+ Deprecated. Tests that run CMake to generate a project but not build it.
+ Superseded by ``Tests/RunCMake/``.
+
+* ``Find*/``:
+ Tests for specific find modules that can only be run on machines with
+ the corresponding packages installed. They are enabled in
+ ``CMakeLists.txt`` by undocumented options used on CI builds.
+
+* ``Module/``:
+ Tests for specific CMake modules.
+
+* ``RunCMake/``:
+ Tests that run CMake and/or other tools while precisely checking
+ their return code and stdout/stderr content. Useful for testing
+ error cases and diagnostic output.
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4e3483c0074e07efaffd5269a4b5fb1a38a2bc50
commit 4e3483c0074e07efaffd5269a4b5fb1a38a2bc50
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Jun 14 14:47:38 2017 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Wed Jun 14 15:03:50 2017 -0400
Help/dev: Update source code guide to cover source tree layout
diff --git a/Help/dev/source.rst b/Help/dev/source.rst
index 7e44995..0fa8d77 100644
--- a/Help/dev/source.rst
+++ b/Help/dev/source.rst
@@ -58,3 +58,48 @@ need to be handled with care:
When assigning the result of ``.size()`` on a container for example,
the result should be assigned to ``size_t`` not to ``std::size_t``,
``unsigned int`` or similar types.
+
+Source Tree Layout
+==================
+
+The CMake source tree is organized as follows.
+
+* ``Auxiliary/``:
+ Shell and editor integration files.
+
+* ``Help/``:
+ Documentation.
+
+ * ``Help/dev/``:
+ Developer documentation.
+
+ * ``Help/release/dev/``:
+ Release note snippets for development since last release.
+
+* ``Licenses/``:
+ License files for third-party libraries in binary distributions.
+
+* ``Modules/``:
+ CMake language modules installed with CMake.
+
+* ``Packaging/``:
+ Files used for packaging CMake itself for distribution.
+
+* ``Source/``:
+ Source code of CMake itself.
+
+* ``Templates/``:
+ Files distributed with CMake as implementation details for generators,
+ packagers, etc.
+
+* ``Tests/``:
+ The test suite.
+
+* ``Utilities/``:
+ Scripts, third-party source code.
+
+ * ``Utilities/Sphinx/``:
+ Sphinx configuration to build CMake user documentation.
+
+ * ``Utilities/Release/``:
+ Scripts used to package CMake itself for distribution on ``cmake.org``.
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=76a0286b1d53ba35d6fa7cee152259bc040d80fb
commit 76a0286b1d53ba35d6fa7cee152259bc040d80fb
Author: Robert Langlois <ezralanglois at gmail.com>
AuthorDate: Mon Jun 12 16:18:27 2017 -0400
Commit: Mona Lisa <rlanglois at illumina.com>
CommitDate: Tue Jun 13 18:07:32 2017 -0700
UseSWIG: Add `-dllimport` only if not already specified
SWIG fails with a redefined macro error when `-dllimport` is specified
more than once. One case where you would want to specify your own
dllimport is when using SWIG with netstandard2.0. .NET Core does not
search for shared library like Mono or .NET, so you need a fully
qualified shared library name.
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index bfe1a6f..456a6bd 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -82,10 +82,6 @@ macro(SWIG_MODULE_INITIALIZE name language)
set(SWIG_MODULE_${name}_REAL_NAME "_${name}")
elseif("x${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "xPERL")
set(SWIG_MODULE_${name}_EXTRA_FLAGS "-shadow")
- elseif("x${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "xCSHARP")
- # This makes sure that the name used in the generated DllImport
- # matches the library name created by CMake
- set(SWIG_MODULE_${name}_EXTRA_FLAGS "-dllimport;${name}")
endif()
endmacro()
@@ -192,6 +188,13 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
if(swig_source_file_cplusplus)
set(swig_special_flags ${swig_special_flags} "-c++")
endif()
+ if("x${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "xCSHARP")
+ if(NOT ";${swig_source_file_flags};${CMAKE_SWIG_FLAGS};" MATCHES ";-dllimport;")
+ # This makes sure that the name used in the generated DllImport
+ # matches the library name created by CMake
+ set(SWIG_MODULE_${name}_EXTRA_FLAGS "-dllimport;${name}")
+ endif()
+ endif()
set(swig_extra_flags)
if(SWIG_MODULE_${name}_EXTRA_FLAGS)
set(swig_extra_flags ${swig_extra_flags} ${SWIG_MODULE_${name}_EXTRA_FLAGS})
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c90630c501fed40078b280fe940535ff9545c2c9
commit c90630c501fed40078b280fe940535ff9545c2c9
Author: Michael Stürmer <michael.stuermer at schaeffler.com>
AuthorDate: Tue Jun 13 14:57:59 2017 +0200
Commit: Michael Stürmer <michael.stuermer at schaeffler.com>
CommitDate: Tue Jun 13 16:04:22 2017 +0200
Vs: add support for VS_CSHARP_* target property for additional file extensions
Fixes: #16726
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 46c2894..d935f21 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1565,6 +1565,10 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
toolHasSettings = true;
}
+ // Collect VS_CSHARP_* property values (if some are set)
+ std::map<std::string, std::string> sourceFileTags;
+ this->GetCSharpSourceProperties(sf, sourceFileTags);
+
if (this->NsightTegra) {
// Nsight Tegra needs specific file types to check up-to-dateness.
std::string name = cmSystemTools::LowerCase(sf->GetLocation().GetName());
@@ -1681,7 +1685,8 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
(*this->BuildFileStream) << cmVS10EscapeXML(includeInVsix)
<< "</IncludeInVSIX>\n";
}
-
+ // write source file specific tags
+ this->WriteCSharpSourceProperties(sourceFileTags);
this->WriteString("</", 2);
(*this->BuildFileStream) << tool << ">\n";
} else {
@@ -2017,34 +2022,13 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
sourceFileTags["Link"] = link;
}
}
- const cmPropertyMap& props = sf.GetProperties();
- for (cmPropertyMap::const_iterator p = props.begin(); p != props.end();
- ++p) {
- static const std::string propNamePrefix = "VS_CSHARP_";
- if (p->first.find(propNamePrefix.c_str()) == 0) {
- std::string tagName = p->first.substr(propNamePrefix.length());
- if (!tagName.empty()) {
- const std::string val = props.GetPropertyValue(p->first);
- if (!val.empty()) {
- sourceFileTags[tagName] = val;
- } else {
- sourceFileTags.erase(tagName);
- }
- }
- }
- }
+ this->GetCSharpSourceProperties(&sf, sourceFileTags);
// write source file specific tags
if (!sourceFileTags.empty()) {
hasFlags = true;
(*this->BuildFileStream) << firstString;
firstString = "";
- for (CsPropMap::const_iterator i = sourceFileTags.begin();
- i != sourceFileTags.end(); ++i) {
- this->WriteString("<", 3);
- (*this->BuildFileStream)
- << i->first << ">" << cmVS10EscapeXML(i->second) << "</" << i->first
- << ">\n";
- }
+ this->WriteCSharpSourceProperties(sourceFileTags);
}
}
@@ -4280,6 +4264,42 @@ bool cmVisualStudio10TargetGenerator::ForceOld(const std::string& source) const
return true;
}
+void cmVisualStudio10TargetGenerator::GetCSharpSourceProperties(
+ cmSourceFile const* sf, std::map<std::string, std::string>& tags)
+{
+ if (csproj == this->ProjectType) {
+ const cmPropertyMap& props = sf->GetProperties();
+ for (cmPropertyMap::const_iterator p = props.begin(); p != props.end();
+ ++p) {
+ static const std::string propNamePrefix = "VS_CSHARP_";
+ if (p->first.find(propNamePrefix.c_str()) == 0) {
+ std::string tagName = p->first.substr(propNamePrefix.length());
+ if (!tagName.empty()) {
+ const std::string val = props.GetPropertyValue(p->first);
+ if (!val.empty()) {
+ tags[tagName] = val;
+ } else {
+ tags.erase(tagName);
+ }
+ }
+ }
+ }
+ }
+}
+
+void cmVisualStudio10TargetGenerator::WriteCSharpSourceProperties(
+ const std::map<std::string, std::string>& tags)
+{
+ if (!tags.empty()) {
+ for (std::map<std::string, std::string>::const_iterator i = tags.begin();
+ i != tags.end(); ++i) {
+ this->WriteString("<", 3);
+ (*this->BuildFileStream) << i->first << ">" << cmVS10EscapeXML(i->second)
+ << "</" << i->first << ">\n";
+ }
+ }
+}
+
std::string cmVisualStudio10TargetGenerator::GetCMakeFilePath(
const char* relativeFilePath) const
{
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 6106615..9c10624 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -153,6 +153,11 @@ private:
bool ForceOld(const std::string& source) const;
+ void GetCSharpSourceProperties(cmSourceFile const* sf,
+ std::map<std::string, std::string>& tags);
+ void WriteCSharpSourceProperties(
+ const std::map<std::string, std::string>& tags);
+
private:
typedef cmVisualStudioGeneratorOptions Options;
typedef std::map<std::string, Options*> OptionsMap;
diff --git a/Tests/RunCMake/VS10Project/VsCSharpCustomTags-check.cmake b/Tests/RunCMake/VS10Project/VsCSharpCustomTags-check.cmake
index 70ea193..9eb4619 100644
--- a/Tests/RunCMake/VS10Project/VsCSharpCustomTags-check.cmake
+++ b/Tests/RunCMake/VS10Project/VsCSharpCustomTags-check.cmake
@@ -4,20 +4,31 @@ if(NOT EXISTS "${csProjectFile}")
return()
endif()
-set(tagFound FALSE)
+# test VS_CSHARP_* for the following extensions
+set(fileExtensions
+ "cs"
+ "png"
+ "jpg"
+ "xml"
+ "settings")
+#
set(tagName "MyCustomTag")
set(tagValue "MyCustomValue")
file(STRINGS "${csProjectFile}" lines)
-foreach(line IN LISTS lines)
- if(line MATCHES "^ *<${tagName}>${tagValue}</${tagName}>")
- message(STATUS "foo.csproj has tag ${tagName} with value ${tagValue} defined")
- set(tagFound TRUE)
+
+foreach(e ${fileExtensions})
+ string(TOUPPER ${e} eUC)
+ set(tagFound FALSE)
+ foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<${tagName}${eUC}>${tagValue}${eUC}</${tagName}${eUC}>")
+ message(STATUS "foo.csproj has tag ${tagName}${eUC} with value ${tagValue}${eUC} defined")
+ set(tagFound TRUE)
+ endif()
+ endforeach()
+ if(NOT tagFound)
+ set(RunCMake_TEST_FAILED "Source file tag ${tagName}${eUC} with value ${tagValue}${eUC} not found.")
+ return()
endif()
endforeach()
-
-if(NOT tagFound)
- set(RunCMake_TEST_FAILED "Source file tag ${tagName} with value ${tagValue} not found.")
- return()
-endif()
diff --git a/Tests/RunCMake/VS10Project/VsCSharpCustomTags.cmake b/Tests/RunCMake/VS10Project/VsCSharpCustomTags.cmake
index c51e9c3..45766a0 100644
--- a/Tests/RunCMake/VS10Project/VsCSharpCustomTags.cmake
+++ b/Tests/RunCMake/VS10Project/VsCSharpCustomTags.cmake
@@ -1,11 +1,27 @@
enable_language(CSharp)
-add_library(foo foo.cs)
-set(props_file "${CMAKE_CURRENT_SOURCE_DIR}/my.props")
+# test VS_CSHARP_* for the following extensions
+set(fileExtensions
+ "cs"
+ "png"
+ "jpg"
+ "xml"
+ "settings")
+#
set(tagName "MyCustomTag")
set(tagValue "MyCustomValue")
-set_source_files_properties(foo.cs
- PROPERTIES
- VS_CSHARP_${tagName} "${tagValue}")
+set(fileNames)
+foreach(e ${fileExtensions})
+ set(currentFile "${CMAKE_CURRENT_BINARY_DIR}/foo.${e}")
+ list(APPEND fileNames ${currentFile})
+ execute_process(COMMAND ${CMAKE_COMMAND} -E touch
+ "${currentFile}")
+ string(TOUPPER ${e} eUC)
+ set_source_files_properties("${currentFile}"
+ PROPERTIES
+ VS_CSHARP_${tagName}${eUC} "${tagValue}${eUC}")
+endforeach()
+
+add_library(foo ${fileNames})
-----------------------------------------------------------------------
Summary of changes:
Help/dev/source.rst | 47 ++++++++++++++
Modules/UseSWIG.cmake | 11 ++--
Source/cmVisualStudio10TargetGenerator.cxx | 68 +++++++++++++-------
Source/cmVisualStudio10TargetGenerator.h | 5 ++
Tests/README | 39 -----------
Tests/README.rst | 31 +++++++++
.../VS10Project/VsCSharpCustomTags-check.cmake | 31 ++++++---
.../RunCMake/VS10Project/VsCSharpCustomTags.cmake | 26 ++++++--
8 files changed, 176 insertions(+), 82 deletions(-)
delete mode 100644 Tests/README
create mode 100644 Tests/README.rst
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list