summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-04-26 15:35:08 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-04-26 15:35:22 (GMT)
commit9d4a0f12fb983e88835059e9b74a18918ef08e7c (patch)
tree7631e53deedee4ea2763f794a41617893405a462
parent395e1d458ed7ec84b0393ca31064018dc0bef575 (diff)
parente3e005dbd8bcb64b20a0923078c3fed0e58cff2c (diff)
downloadCMake-9d4a0f12fb983e88835059e9b74a18918ef08e7c.zip
CMake-9d4a0f12fb983e88835059e9b74a18918ef08e7c.tar.gz
CMake-9d4a0f12fb983e88835059e9b74a18918ef08e7c.tar.bz2
Merge topic 'SWIG'
e3e005dbd8 UseSWIG: use swig dependencies for Xcode generator Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6042
-rw-r--r--Help/release/dev/UseSWIG-dependencies.rst6
-rw-r--r--Modules/UseSWIG.cmake23
-rw-r--r--Tests/UseSWIG/CMakeLists.txt3
3 files changed, 24 insertions, 8 deletions
diff --git a/Help/release/dev/UseSWIG-dependencies.rst b/Help/release/dev/UseSWIG-dependencies.rst
new file mode 100644
index 0000000..b5a38c3
--- /dev/null
+++ b/Help/release/dev/UseSWIG-dependencies.rst
@@ -0,0 +1,6 @@
+UseSWIG-dependencies
+--------------------
+
+* :module:`UseSWIG` module gained the capability, for
+ :generator:`Xcode` generator, to use `swig` tool to generate implicit
+ dependencies.
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index 8852df8..269fa98 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -191,8 +191,12 @@ ensure generated files will receive the required settings.
If set to ``TRUE``, implicit dependencies are generated by the ``swig`` tool
itself. This property is only meaningful for
- :ref:`Makefile <Makefile Generators>` and
- :ref:`Ninja <Ninja Generators>` generators. Default value is ``FALSE``.
+ :ref:`Makefile <Makefile Generators>`,
+ :ref:`Ninja <Ninja Generators>` and :generator:`Xcode` generators. Default
+ value is ``FALSE``.
+
+ .. versionadded:: 3.21
+ Added the support of :generator:`Xcode` generator.
``SWIG_MODULE_NAME``
Specify the actual import name of the module in the target language.
@@ -336,12 +340,17 @@ as well as ``SWIG``:
.. versionadded:: 3.20
If set to ``TRUE``, implicit dependencies are generated by the ``swig`` tool
- itself. This property is only meaningful for
- :ref:`Makefile <Makefile Generators>` and
- :ref:`Ninja <Ninja Generators>` generators. Default value is ``FALSE``.
+ itself. This variable is only meaningful for
+ :ref:`Makefile <Makefile Generators>`,
+ :ref:`Ninja <Ninja Generators>` and :generator:`Xcode` generators. Default
+ value is ``FALSE``.
Source file property ``USE_SWIG_DEPENDENCIES``, if not defined, will be
initialized with the value of this variable.
+
+ .. versionadded:: 3.21
+ Added the support of :generator:`Xcode` generator.
+
#]=======================================================================]
cmake_policy(PUSH)
@@ -506,7 +515,7 @@ function(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
endif()
set (use_swig_dependencies ${SWIG_USE_SWIG_DEPENDENCIES})
- if (CMAKE_GENERATOR MATCHES "Make|Ninja")
+ if (CMAKE_GENERATOR MATCHES "Make|Ninja|Xcode")
get_property(use_swig_dependencies_set SOURCE "${infile}" PROPERTY USE_SWIG_DEPENDENCIES SET)
if (use_swig_dependencies_set)
get_property(use_swig_dependencies SOURCE "${infile}" PROPERTY USE_SWIG_DEPENDENCIES)
@@ -831,7 +840,7 @@ function(SWIG_ADD_LIBRARY name)
set(SWIG_SOURCE_FILE_EXTENSIONS ".i")
endif()
- if (CMAKE_GENERATOR MATCHES "Make|Ninja")
+ if (CMAKE_GENERATOR MATCHES "Make|Ninja|Xcode")
# For Makefiles and Ninja generators, use SWIG generated dependencies
if (NOT DEFINED SWIG_USE_SWIG_DEPENDENCIES)
set (SWIG_USE_SWIG_DEPENDENCIES OFF)
diff --git a/Tests/UseSWIG/CMakeLists.txt b/Tests/UseSWIG/CMakeLists.txt
index d08c59c..f1b2f32 100644
--- a/Tests/UseSWIG/CMakeLists.txt
+++ b/Tests/UseSWIG/CMakeLists.txt
@@ -66,7 +66,8 @@ add_test(NAME UseSWIG.BasicPerl COMMAND
--build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
-if(SWIG_FOUND AND NOT SWIG_VERSION VERSION_LESS "4.0.2")
+if(SWIG_FOUND AND NOT SWIG_VERSION VERSION_LESS "4.0.2"
+ AND CMAKE_GENERATOR MATCHES "Make|Ninja|Xcode")
add_test(NAME UseSWIG.Depfile.BasicPython COMMAND
${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
--build-and-test