diff options
author | Brad King <brad.king@kitware.com> | 2013-12-02 17:06:57 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-12-02 17:06:57 (GMT) |
commit | f3a10191e714e39965c43b704ac17024968bbf31 (patch) | |
tree | bfc56f55b4bef978e3e05bbd7f94f17710d973aa /Modules/UseSWIG.cmake | |
parent | 406635fd6c35e046a2f8b5647c49beae6c7f5f00 (diff) | |
parent | 74f5545d0aa0a4ba6856b1280782b2c23185a6e1 (diff) | |
download | CMake-f3a10191e714e39965c43b704ac17024968bbf31.zip CMake-f3a10191e714e39965c43b704ac17024968bbf31.tar.gz CMake-f3a10191e714e39965c43b704ac17024968bbf31.tar.bz2 |
Merge topic 'UseSWIG-fix12184'
74f5545 UseSWIG: set .bundle ext on OSX and no prefix (#12184)
Diffstat (limited to 'Modules/UseSWIG.cmake')
-rw-r--r-- | Modules/UseSWIG.cmake | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake index 44e1bb9..84aa741 100644 --- a/Modules/UseSWIG.cmake +++ b/Modules/UseSWIG.cmake @@ -213,8 +213,7 @@ macro(SWIG_ADD_MODULE name language) # Linux : libLIBRARY.so set_target_properties (${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".jnilib") endif () - endif () - if ("${swig_lowercase_language}" STREQUAL "python") + elseif ("${swig_lowercase_language}" STREQUAL "python") # this is only needed for the python case where a _modulename.so is generated set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "") # Python extension modules on Windows must have the extension ".pyd" @@ -228,6 +227,17 @@ macro(SWIG_ADD_MODULE name language) if(WIN32 AND NOT CYGWIN) set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".pyd") endif() + elseif ("${swig_lowercase_language}" STREQUAL "ruby") + # In ruby you want: + # require 'LIBRARY' + # then ruby will look for a library whose name is platform dependent, namely + # MacOS : LIBRARY.bundle + # Windows: LIBRARY.dll + # Linux : LIBRARY.so + set_target_properties (${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "") + if (APPLE) + set_target_properties (${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".bundle") + endif () endif () endmacro() |