The existing UseSWIG.cmake file creates a MODULE and not a SHARED library. The module is unuseable by any program trying to load dynamic libraries (eg wrapped Java). The attached patch fixes this problem for our situations. Demonstrated on both Mac OS X Leopard and Ubuntu Jaunty.

Is this a known issue? I searched what I could of the list and the 'net, and couldn't find anything on this.
Stephen

<code>
-- UseSWIG.cmake-save   2009-03-19 16:04:20.000000000 -0400
+++ UseSWIG.cmake       2009-03-19 16:04:44.000000000 -0400
@@ -33,7 +33,7 @@
MESSAGE(FATAL_ERROR "SWIG Error: Language \"${language}\" not found")
   ENDIF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xUNKNOWNx$")

-  SET(SWIG_MODULE_${name}_REAL_NAME "${name}")
+  SET(SWIG_MODULE_${name}_REAL_NAME "lib${name}")
   IF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPYTHONx$")
     SET(SWIG_MODULE_${name}_REAL_NAME "_${name}")
   ENDIF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPYTHONx$")
@@ -187,7 +187,7 @@
   SET_DIRECTORY_PROPERTIES(PROPERTIES
ADDITIONAL_MAKE_CLEAN_FILES "${swig_extra_clean_files};$ {swig_generated_sources}")
   ADD_LIBRARY(${SWIG_MODULE_${name}_REAL_NAME}
-    MODULE
+    SHARED
     ${swig_generated_sources}
     ${swig_other_sources})
   SET_TARGET_PROPERTIES(${SWIG_MODULE_${name}_REAL_NAME}
</code>

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to