View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0012184CMakeModulespublic2011-05-11 16:442014-06-02 08:39
Reporterwheat 
Assigned Tojschueller 
PrioritynormalSeveritytweakReproducibilityalways
StatusclosedResolutionfixed 
PlatformAppleOSMac OS XOS VersionSnow Leopard
Product VersionCMake 2.8.4 
Target VersionFixed in VersionCMake 3.0 
Summary0012184: SWIG_ADD_MODULE generates wrong file name for Ruby under Mac OS X
DescriptionRuby requires the extension to be named as "foo.bundle", but SWIG_ADD_MODULE generates the target as "libfoo.so".
TagsNo tags attached.
Attached Filespatch file icon 0001-UseSWIG-adjust-module-name-for-ruby.patch [^] (4,807 bytes) 2012-04-02 16:03 [Show Content]

 Relationships

  Notes
(0029060)
Felix Schwitzer (reporter)
2012-04-02 16:11

The problem exists not only on Mac OSX, but also on linux and windows (cygwin and mingw).
I dug into ruby's own build system and makefile generator (generate_makefile in mkmf.rb) and found, that the name for the extension module is
"$(TARGET).#{CONFIG['DLEXT']}", so the library name is the module name
without prefix and the extension(suffix) is platform dependent
(.so on linux/cygwin/wingw, .bundle on mac).
I believe the best is to ask the ruby-interpreter for the extension, like
FindRuby.cmake it does for RUBY_ARCH and others.

I implemented this approach in the attached patch.
The patch generates a dependency to FindRuby, but when building a ruby extension
the assumption that a ruby interpreter is installed on the build machine is
reasonable, or isn't it?
(0034607)
jschueller (developer)
2013-11-28 04:28

Here is a more naive approach:
http://cmake.org/gitweb?p=stage/cmake.git;a=commitdiff;h=74f5545d0aa0a4ba6856b1280782b2c23185a6e1 [^]
(0034612)
Felix Schwitzer (reporter)
2013-11-28 16:16

Great. I tested your patch and it works fine for me, thanks.
I checked also the naming convention for ruby 2.0 and it seems that nothing
changed here.

Maybe my initial approach was a little bit too intrusive...
(0034680)
jschueller (developer)
2013-12-02 13:06

http://cmake.org/gitweb?p=stage/cmake.git;a=commitdiff;h=f3a10191e714e39965c43b704ac17024968bbf31;hp=406635fd6c35e046a2f8b5647c49beae6c7f5f00 [^]
(0036097)
Robert Maynard (manager)
2014-06-02 08:39

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2011-05-11 16:44 wheat New Issue
2012-02-11 11:55 Rolf Eike Beer Assigned To => Mathieu Malaterre
2012-02-11 11:55 Rolf Eike Beer Status new => assigned
2012-02-11 11:55 Rolf Eike Beer Category CMake => Modules
2012-04-02 16:03 Felix Schwitzer File Added: 0001-UseSWIG-adjust-module-name-for-ruby.patch
2012-04-02 16:11 Felix Schwitzer Note Added: 0029060
2013-11-28 04:27 jschueller Assigned To Mathieu Malaterre => jschueller
2013-11-28 04:28 jschueller Note Added: 0034607
2013-11-28 16:16 Felix Schwitzer Note Added: 0034612
2013-12-02 13:06 jschueller Note Added: 0034680
2013-12-02 13:06 jschueller Status assigned => resolved
2013-12-02 13:06 jschueller Fixed in Version => CMake 3.0
2013-12-02 13:06 jschueller Resolution open => fixed
2014-06-02 08:39 Robert Maynard Note Added: 0036097
2014-06-02 08:39 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team