summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-12-02 17:06:50 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-12-02 17:06:50 (GMT)
commit406635fd6c35e046a2f8b5647c49beae6c7f5f00 (patch)
treed9039c64cf463ad9d0d755fc690174081b856eed
parent9d51c764f73175664cc18acab755e6a11233656e (diff)
parenta87c06328c4c836918216863c475beabf10d6c2d (diff)
downloadCMake-406635fd6c35e046a2f8b5647c49beae6c7f5f00.zip
CMake-406635fd6c35e046a2f8b5647c49beae6c7f5f00.tar.gz
CMake-406635fd6c35e046a2f8b5647c49beae6c7f5f00.tar.bz2
Merge topic 'UseSWIG-fix13318'
a87c063 UseSWIG: Name python module according to swig flags (#13318)
-rw-r--r--Modules/UseSWIG.cmake11
1 files changed, 7 insertions, 4 deletions
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index 28d5ff0..44e1bb9 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -59,12 +59,15 @@ macro(SWIG_MODULE_INITIALIZE name language)
set(SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG "${swig_lowercase_language}")
set(SWIG_MODULE_${name}_REAL_NAME "${name}")
+ if (CMAKE_SWIG_FLAGS MATCHES "-noproxy")
+ set (SWIG_MODULE_${name}_NOPROXY TRUE)
+ endif ()
if("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "UNKNOWN")
message(FATAL_ERROR "SWIG Error: Language \"${language}\" not found")
- elseif("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PYTHON")
- # when swig is used without the -interface it will produce in the module.py
- # a 'import _modulename' statement, which implies having a corresponding
- # _modulename.so (*NIX), _modulename.pyd (Win32).
+ elseif("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PYTHON" AND NOT SWIG_MODULE_${name}_NOPROXY)
+ # swig will produce a module.py containing an 'import _modulename' statement,
+ # which implies having a corresponding _modulename.so (*NIX), _modulename.pyd (Win32),
+ # unless the -noproxy flag is used
set(SWIG_MODULE_${name}_REAL_NAME "_${name}")
elseif("${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "PERL")
set(SWIG_MODULE_${name}_EXTRA_FLAGS "-shadow")