[Cmake-commits] CMake branch, master, updated. v3.14.3-863-g1820c7e
Kitware Robot
kwrobot at kitware.com
Mon May 6 09:23:05 EDT 2019
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 1820c7e780e827a509a340835229d7075f5d1d1e (commit)
via b9ee95fe5e621037f415de675eb378504170a056 (commit)
via e3919bae17d3442e18b5ec1f4a1ae994c87c455b (commit)
via 541f079bd7ba7f141218ed93177af4d848e516fa (commit)
from 0f27e7d165c96f2c3ada1695df4f6cfaa44afe51 (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=1820c7e780e827a509a340835229d7075f5d1d1e
commit 1820c7e780e827a509a340835229d7075f5d1d1e
Merge: b9ee95f e3919ba
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon May 6 13:18:21 2019 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon May 6 09:19:38 2019 -0400
Merge topic 'SWIG'
e3919bae17 UseSWIG: Manage alternate library name
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !3241
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b9ee95fe5e621037f415de675eb378504170a056
commit b9ee95fe5e621037f415de675eb378504170a056
Merge: 0f27e7d 541f079
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon May 6 13:18:02 2019 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon May 6 09:18:28 2019 -0400
Merge topic 'findice-clang-cl'
541f079bd7 FindIce: Support clang-cl by checking CMAKE_CXX_SIMULATE_ID
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !3284
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e3919bae17d3442e18b5ec1f4a1ae994c87c455b
commit e3919bae17d3442e18b5ec1f4a1ae994c87c455b
Author: Marc Chevrier <marc.chevrier at gmail.com>
AuthorDate: Wed Apr 17 12:23:15 2019 +0200
Commit: Marc Chevrier <marc.chevrier at gmail.com>
CommitDate: Fri May 3 18:20:17 2019 +0200
UseSWIG: Manage alternate library name
Manage alternate library name by passing -interface <library_name>
for python language or -dllimport <library_name> for CSharp language
to the SWIG compiler.
Fixes: #18771
diff --git a/Help/release/dev/UseSWIG-alternate-library-name.rst b/Help/release/dev/UseSWIG-alternate-library-name.rst
new file mode 100644
index 0000000..8e58b8d
--- /dev/null
+++ b/Help/release/dev/UseSWIG-alternate-library-name.rst
@@ -0,0 +1,7 @@
+UseSWIG-alternate-library-name
+------------------------------
+
+* The :module:`UseSWIG` module learned to manage alternate library names by
+ passing ``-interface <library_name>`` for ``python`` language or
+ ``-dllimport <library_name>`` for ``CSharp`` language to the ``SWIG``
+ compiler.
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index 18ea55c..c136b05 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -466,7 +466,14 @@ function(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
if(NOT ("-dllimport" IN_LIST swig_source_file_flags OR "-dllimport" IN_LIST SWIG_MODULE_${name}_EXTRA_FLAGS))
# This makes sure that the name used in the generated DllImport
# matches the library name created by CMake
- list (APPEND SWIG_MODULE_${name}_EXTRA_FLAGS "-dllimport" "${name}")
+ list (APPEND SWIG_MODULE_${name}_EXTRA_FLAGS "-dllimport" "$<TARGET_FILE_PREFIX:${target_name}>$<TARGET_FILE_BASE_NAME:${target_name}>")
+ endif()
+ endif()
+ if (SWIG_MODULE_${name}_LANGUAGE STREQUAL "PYTHON" AND NOT SWIG_MODULE_${name}_NOPROXY)
+ if(NOT ("-interface" IN_LIST swig_source_file_flags OR "-interface" IN_LIST SWIG_MODULE_${name}_EXTRA_FLAGS))
+ # This makes sure that the name used in the proxy code
+ # matches the library name created by CMake
+ list (APPEND SWIG_MODULE_${name}_EXTRA_FLAGS "-interface" "$<TARGET_FILE_PREFIX:${target_name}>$<TARGET_FILE_BASE_NAME:${target_name}>")
endif()
endif()
list (APPEND swig_extra_flags ${SWIG_MODULE_${name}_EXTRA_FLAGS})
diff --git a/Tests/UseSWIG/AlternateLibraryName/CMakeLists.txt b/Tests/UseSWIG/AlternateLibraryName/CMakeLists.txt
new file mode 100644
index 0000000..a2c239c
--- /dev/null
+++ b/Tests/UseSWIG/AlternateLibraryName/CMakeLists.txt
@@ -0,0 +1,35 @@
+cmake_minimum_required(VERSION 3.14...3.15)
+
+project(TestAlternateLibraryName CXX)
+
+include(CTest)
+
+find_package(SWIG REQUIRED)
+include(${SWIG_USE_FILE})
+
+find_package(Python2 REQUIRED COMPONENTS Interpreter Development)
+
+# Path separator
+if (WIN32)
+ set (PS "$<SEMICOLON>")
+else()
+ set (PS ":")
+endif()
+
+unset(CMAKE_SWIG_FLAGS)
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/../example.i" PROPERTY CPLUSPLUS ON)
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/../example.i" PROPERTY COMPILE_OPTIONS -includeall)
+
+swig_add_library(example_python
+ LANGUAGE python
+ SOURCES ../example.i ../example.cxx)
+set_target_properties (example_python PROPERTIES
+ INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/.."
+ SWIG_USE_TARGET_INCLUDE_DIRECTORIES TRUE)
+target_link_libraries(example_python PRIVATE Python2::Python)
+
+
+add_test (NAME AlternateLibraryName.example1
+ COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}${PS}$<TARGET_FILE_DIR:example_python>"
+ "${Python2_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/../runme.py")
diff --git a/Tests/UseSWIG/CMakeLists.txt b/Tests/UseSWIG/CMakeLists.txt
index 434895e..3cc910f 100644
--- a/Tests/UseSWIG/CMakeLists.txt
+++ b/Tests/UseSWIG/CMakeLists.txt
@@ -123,3 +123,15 @@ add_test(NAME UseSWIG.SwigSrcFileExtension COMMAND
--build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
+
+
+add_test(NAME UseSWIG.AlternateLibraryName COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/UseSWIG/AlternateLibraryName"
+ "${CMake_BINARY_DIR}/Tests/UseSWIG/AlternateLibraryName"
+ ${build_generator_args}
+ --build-project TestAlternateLibraryName
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=541f079bd7ba7f141218ed93177af4d848e516fa
commit 541f079bd7ba7f141218ed93177af4d848e516fa
Author: jspam <5172-jspam at users.noreply.gitlab.kitware.com>
AuthorDate: Fri May 3 01:32:14 2019 -0400
Commit: jspam <5172-jspam at users.noreply.gitlab.kitware.com>
CommitDate: Fri May 3 01:32:14 2019 -0400
FindIce: Support clang-cl by checking CMAKE_CXX_SIMULATE_ID
This applies commit d48bf97f, which does the same for FindBoost, to FindIce.
diff --git a/Modules/FindIce.cmake b/Modules/FindIce.cmake
index 1e0f0b8..5ce2b42 100644
--- a/Modules/FindIce.cmake
+++ b/Modules/FindIce.cmake
@@ -259,7 +259,7 @@ function(_Ice_FIND)
endif()
unset(vcvers)
- if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
if(MSVC_TOOLSET_VERSION GREATER_EQUAL 141)
set(vcvers "141;140")
elseif(MSVC_TOOLSET_VERSION GREATER_EQUAL 100)
@@ -435,7 +435,7 @@ function(_Ice_FIND)
set(component_library "${component}")
unset(component_library_release_names)
unset(component_library_debug_names)
- if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC")
string(REGEX MATCH ".+\\+\\+11$" component_library_cpp11 "${component_library}")
if(component_library_cpp11)
string(REGEX REPLACE "^(.+)(\\+\\+11)$" "\\1" component_library "${component_library}")
-----------------------------------------------------------------------
Summary of changes:
.../release/dev/UseSWIG-alternate-library-name.rst | 7 +++++
Modules/FindIce.cmake | 4 +--
Modules/UseSWIG.cmake | 9 +++++-
Tests/UseSWIG/AlternateLibraryName/CMakeLists.txt | 35 ++++++++++++++++++++++
Tests/UseSWIG/CMakeLists.txt | 12 ++++++++
5 files changed, 64 insertions(+), 3 deletions(-)
create mode 100644 Help/release/dev/UseSWIG-alternate-library-name.rst
create mode 100644 Tests/UseSWIG/AlternateLibraryName/CMakeLists.txt
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list