[CMake] CMake and swig problem

Judicaël Bedouet j.bedouet at infonie.fr
Wed Jun 18 11:41:57 EDT 2008


Hello,

I have a problem with Swig libraries generated by CMake and I find a
mail from 2006 which describes the same problem.

To summarize, SWIG libraries for Java must be generated with a lib
prefix under Linux and CMake generates without prefix because some
languages like Python don't need a lib prefix.

In 2008, with JDK 1.6 (1.6.0_06) and CMake 2.6.0, we always have to
preprend 'lib' for Unix platforms.

Is there no way that CMake preprend automatically lib for Java modules
on Unix platforms, in fact keep default naming convention ?

Thanks,

J. Bedouet

P.S. For the moment, I do this after swig_add_module and swig_link_libraries.
set_target_properties (myjavalib PROPERTIES PREFIX lib)


>I am trying to load the swig generated lib into the java java gen'ed
>layer so I think pretty std usage.
>
>The JDK I am using - 1.4.2_06 - completely fails to see MyJNI.so on
>solaris/linux, when using loadLibrary("MyJNI") - if I rename the lib
>libMyJNI.so it works fine.
>
>I think there was some discussion in java circles of trying to load the
>library without the lib prefix if the system dep name mapping failed but
>doesn't look like that is implemented in my jdk version.
>
>Fair point about the loadable modules tho - sometimes have a bit of c++
>centric view.
>
>Ian
>
>-----Original Message-----
>From: cmake-bounces+ian.appru=ubs.com at cmake.org
>[mailto:cmake-bounces+ian.appru=ubs.com at cmake.org] On Behalf Of William
>A. Hoffman
>Sent: 24 February 2006 14:31
>To: Appru, Ian; brad.king at kitware.com
>Cc: cmake at cmake.org
>Subject: RE: [CMake] CMake and swig problem
>
>At 09:06 AM 2/24/2006, Ian.Appru at ubs.com wrote:
>>Thanks for your reply Brad,
>>
>>I did (eventually) spot this line in the SWIG_ADD_MODULE macro.
>>
>>As I mentioned in conversation with Bill - think the thread
>>accidentally went private there - I have decided to use my own
>>UseSWIG-Java module and just remove this line.
>>
>>This is because I would like to use all the cmake logic in this area
>>rather than override the PREFIX property with values relevant to all
>>the platforms I am using (solaris/linux/XP).
>>
>>Not sure it is the swig convention to generate unix libs with no 'lib'
>>prefix since it is the target language which controls this platform
>>specific requirement - java, python etc
>Well, on some systems loadable modules are not libraries, and can not
>even be linked to.
>
>Does the java stuff with the load not work without the lib prefix?
>Or are you trying to link to the swig module for something else?
>
>-Bill
>
>_______________________________________________
>CMake mailing list
>CMake at cmake.org
>http://www.cmake.org/mailman/listinfo/cmake
>
>Visit our website at http://www.ubs.com
>
>This message contains confidential information and is intended only
>for the individual named.  If you are not the named addressee you
>should not disseminate, distribute or copy this e-mail.  Please
>notify the sender immediately by e-mail if you have received this
>e-mail by mistake and delete this e-mail from your system.
>
>E-mail transmission cannot be guaranteed to be secure or error-free
>as information could be intercepted, corrupted, lost, destroyed,
>arrive late or incomplete, or contain viruses.  The sender therefore
>does not accept liability for any errors or omissions in the contents
>of this message which arise as a result of e-mail transmission.  If
>verification is required please request a hard-copy version.  This
>message is provided for informational purposes and should not be
>construed as a solicitation or offer to buy or sell any securities or
>related financial instruments.


More information about the CMake mailing list