[Cmake-commits] CMake branch, next, updated. v3.0.0-rc3-2298-g3d607ae

Julien Schueller schueller at phimeca.com
Mon Apr 14 10:33:04 EDT 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  3d607aeed2d53775f7fa096374257cc8a8d021b0 (commit)
       via  6962c231167a0194827a7da4061e2b61af2ca1af (commit)
       via  6ec927430bd566d74f2c2a216daafb161a4ea9ee (commit)
       via  63ebb1f111999a113707100ed7c6402b5e7a5d9e (commit)
      from  9c229880e9de7980606a294f69e7e79a9c8d0869 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3d607aeed2d53775f7fa096374257cc8a8d021b0
commit 3d607aeed2d53775f7fa096374257cc8a8d021b0
Merge: 9c22988 6962c23
Author:     Julien Schueller <schueller at phimeca.com>
AuthorDate: Mon Apr 14 10:33:03 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Apr 14 10:33:03 2014 -0400

    Merge topic 'UseSWIG-guess_module_name' into next
    
    6962c231 Added some documentation on SWIG_MODULE_NAME
    6ec92743 allow digits and underscores
    63ebb1f1 UseSWIG: guess module name from interface file (fixes #0010080)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6962c231167a0194827a7da4061e2b61af2ca1af
commit 6962c231167a0194827a7da4061e2b61af2ca1af
Author:     Julien Schueller <schueller at phimeca.com>
AuthorDate: Thu Apr 3 08:28:10 2014 +0200
Commit:     Julien Schueller <schueller at phimeca.com>
CommitDate: Thu Apr 3 08:28:10 2014 +0200

    Added some documentation on SWIG_MODULE_NAME

diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index c6481c6..c7bfc1d 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -13,10 +13,13 @@
 #    SWIG_LINK_LIBRARIES(name [ libraries ])
 #      - Link libraries to swig module
 #
-# All other macros are for internal use only.  To get the actual name of
-# the swig module, use: ${SWIG_MODULE_${name}_REAL_NAME}.  Set Source
-# files properties such as CPLUSPLUS and SWIG_FLAGS to specify special
-# behavior of SWIG.  Also global CMAKE_SWIG_FLAGS can be used to add
+# All other macros are for internal use only.
+# Set source files properties such as CPLUSPLUS and SWIG_FLAGS to specify
+# special behavior of SWIG.
+# The property SWIG_MODULE_NAME can be used to specify the actual import name of the module
+# in the target language if it cannot be parsed or different from the module file basename.
+# To get the name of the swig module target library, use: ${SWIG_MODULE_${name}_REAL_NAME}.
+# Also global CMAKE_SWIG_FLAGS can be used to add
 # special flags to all swig calls.  Another special variable is
 # CMAKE_SWIG_OUTDIR, it allows one to specify where to write all the
 # swig generated module (swig -outdir option) The name-specific variable

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6ec927430bd566d74f2c2a216daafb161a4ea9ee
commit 6ec927430bd566d74f2c2a216daafb161a4ea9ee
Author:     Julien Schueller <schueller at phimeca.com>
AuthorDate: Tue Apr 1 14:23:49 2014 +0200
Commit:     Julien Schueller <schueller at phimeca.com>
CommitDate: Tue Apr 1 14:23:49 2014 +0200

    allow digits and underscores

diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index 56cb4b7..c6481c6 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -88,16 +88,16 @@ macro(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
   if(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND")
 
     # try to get module name from "%module foo" syntax
-    file ( STRINGS "${infile}" _MODULE_NAME REGEX "[ ]*%module[ ]*[a-zA-Z]+.*" )
+    file ( STRINGS "${infile}" _MODULE_NAME REGEX "[ ]*%module[ ]*[a-zA-Z0-9_]+.*" )
     if ( _MODULE_NAME )
-      string ( REGEX REPLACE "[ ]*%module[ ]*([a-zA-Z]+).*" "\\1" _MODULE_NAME "${_MODULE_NAME}" )
+      string ( REGEX REPLACE "[ ]*%module[ ]*([a-zA-Z0-9_]+).*" "\\1" _MODULE_NAME "${_MODULE_NAME}" )
       set(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${_MODULE_NAME}")
 
     else ()
       # try to get module name from "%module (options=...) foo" syntax
-      file ( STRINGS "${infile}" _MODULE_NAME REGEX "[ ]*%module[ ]*\\(.*\\)[ ]*[a-zA-Z]+.*" )
+      file ( STRINGS "${infile}" _MODULE_NAME REGEX "[ ]*%module[ ]*\\(.*\\)[ ]*[a-zA-Z0-9_]+.*" )
       if ( _MODULE_NAME )
-        string ( REGEX REPLACE "[ ]*%module[ ]*\\(.*\\)[ ]*([a-zA-Z]+).*" "\\1" _MODULE_NAME "${_MODULE_NAME}" )
+        string ( REGEX REPLACE "[ ]*%module[ ]*\\(.*\\)[ ]*([a-zA-Z0-9_]+).*" "\\1" _MODULE_NAME "${_MODULE_NAME}" )
         set(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${_MODULE_NAME}")
 
       else ()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=63ebb1f111999a113707100ed7c6402b5e7a5d9e
commit 63ebb1f111999a113707100ed7c6402b5e7a5d9e
Author:     Julien Schueller <schueller at phimeca.com>
AuthorDate: Tue Apr 1 12:12:52 2014 +0200
Commit:     Julien Schueller <schueller at phimeca.com>
CommitDate: Tue Apr 1 12:12:52 2014 +0200

    UseSWIG: guess module name from interface file (fixes #0010080)

diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index 11ca205..56cb4b7 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -86,7 +86,26 @@ macro(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
   get_source_file_property(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename
     ${infile} SWIG_MODULE_NAME)
   if(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND")
-    get_filename_component(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${infile}" NAME_WE)
+
+    # try to get module name from "%module foo" syntax
+    file ( STRINGS "${infile}" _MODULE_NAME REGEX "[ ]*%module[ ]*[a-zA-Z]+.*" )
+    if ( _MODULE_NAME )
+      string ( REGEX REPLACE "[ ]*%module[ ]*([a-zA-Z]+).*" "\\1" _MODULE_NAME "${_MODULE_NAME}" )
+      set(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${_MODULE_NAME}")
+
+    else ()
+      # try to get module name from "%module (options=...) foo" syntax
+      file ( STRINGS "${infile}" _MODULE_NAME REGEX "[ ]*%module[ ]*\\(.*\\)[ ]*[a-zA-Z]+.*" )
+      if ( _MODULE_NAME )
+        string ( REGEX REPLACE "[ ]*%module[ ]*\\(.*\\)[ ]*([a-zA-Z]+).*" "\\1" _MODULE_NAME "${_MODULE_NAME}" )
+        set(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${_MODULE_NAME}")
+
+      else ()
+        # fallback to file basename
+        get_filename_component(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${infile}" NAME_WE)
+      endif ()
+    endif ()
+
   endif()
   foreach(it ${SWIG_${language}_EXTRA_FILE_EXTENSION})
     set(${outfiles} ${${outfiles}}

-----------------------------------------------------------------------

Summary of changes:
 Modules/UseSWIG.cmake |   32 +++++++++++++++++++++++++++-----
 1 file changed, 27 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list