summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Schueller <schueller@phimeca.com>2013-11-28 09:26:14 (GMT)
committerJulien Schueller <schueller@phimeca.com>2013-11-28 09:26:14 (GMT)
commit74f5545d0aa0a4ba6856b1280782b2c23185a6e1 (patch)
treed920c3a0dbed522899ebdc294432617561f0f185
parent93d2322e890fdcba37519a174e2c25144e9150c4 (diff)
downloadCMake-74f5545d0aa0a4ba6856b1280782b2c23185a6e1.zip
CMake-74f5545d0aa0a4ba6856b1280782b2c23185a6e1.tar.gz
CMake-74f5545d0aa0a4ba6856b1280782b2c23185a6e1.tar.bz2
UseSWIG: set .bundle ext on OSX and no prefix (#12184)
-rw-r--r--Modules/UseSWIG.cmake14
1 files changed, 12 insertions, 2 deletions
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index 28d5ff0..3123aea 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -210,8 +210,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"
@@ -225,6 +224,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()