[Cmake-commits] CMake branch, next, updated. v3.0.0-rc3-2477-gf84ac3b

Julien Schueller schueller at phimeca.com
Fri Apr 18 08:45:51 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  f84ac3b2e89cf31590f8dc1daf861ff053e5035c (commit)
       via  d8b206748d66e7dec7e8c42585f2d00b57547cbf (commit)
      from  938b69bc28dcd6de2ca439d39b13671744005f2e (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=f84ac3b2e89cf31590f8dc1daf861ff053e5035c
commit f84ac3b2e89cf31590f8dc1daf861ff053e5035c
Merge: 938b69b d8b2067
Author:     Julien Schueller <schueller at phimeca.com>
AuthorDate: Fri Apr 18 08:45:51 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Apr 18 08:45:51 2014 -0400

    Merge topic 'UseSWIG-guess_module_name' into next
    
    d8b20674 Do not call file[STRINGS] if the module is generated


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d8b206748d66e7dec7e8c42585f2d00b57547cbf
commit d8b206748d66e7dec7e8c42585f2d00b57547cbf
Author:     Julien Schueller <schueller at phimeca.com>
AuthorDate: Fri Apr 18 14:44:37 2014 +0200
Commit:     Julien Schueller <schueller at phimeca.com>
CommitDate: Fri Apr 18 14:44:37 2014 +0200

    Do not call file[STRINGS] if the module is generated

diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index c7bfc1d..1a76fe3 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -91,21 +91,25 @@ 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-Z0-9_]+.*" )
+    if ( EXISTS ${infile} )
+      file ( STRINGS ${infile} _MODULE_NAME REGEX "[ ]*%module[ ]*[a-zA-Z0-9_]+.*" )
+    endif ()
     if ( _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-Z0-9_]+.*" )
+      if ( EXISTS ${infile} )
+        file ( STRINGS ${infile} _MODULE_NAME REGEX "[ ]*%module[ ]*\\(.*\\)[ ]*[a-zA-Z0-9_]+.*" )
+      endif ()
       if ( _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 ()
         # fallback to file basename
-        get_filename_component(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${infile}" NAME_WE)
+        get_filename_component(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename ${infile} NAME_WE)
       endif ()
     endif ()
 

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

Summary of changes:
 Modules/UseSWIG.cmake |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list