diff options
author | Brad King <brad.king@kitware.com> | 2019-05-06 13:18:21 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-05-06 13:19:38 (GMT) |
commit | 1820c7e780e827a509a340835229d7075f5d1d1e (patch) | |
tree | be99d854ba51794b5cc2f7acf89b860c35c5b845 /Modules | |
parent | b9ee95fe5e621037f415de675eb378504170a056 (diff) | |
parent | e3919bae17d3442e18b5ec1f4a1ae994c87c455b (diff) | |
download | CMake-1820c7e780e827a509a340835229d7075f5d1d1e.zip CMake-1820c7e780e827a509a340835229d7075f5d1d1e.tar.gz CMake-1820c7e780e827a509a340835229d7075f5d1d1e.tar.bz2 |
Merge topic 'SWIG'
e3919bae17 UseSWIG: Manage alternate library name
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3241
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/UseSWIG.cmake | 9 |
1 files changed, 8 insertions, 1 deletions
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}) |