[Cmake-commits] CMake branch, next, updated. v3.7.0-rc2-856-g2b40bc2

Brad King brad.king at kitware.com
Tue Nov 1 10:18:30 EDT 2016


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  2b40bc240e51585f5184d057146d2e4da2fbed84 (commit)
       via  8444b984a29392c32a13521cc0e3d40788cc9530 (commit)
      from  97599787929fd197241dc3e4adcbf852bdf9f76d (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2b40bc240e51585f5184d057146d2e4da2fbed84
commit 2b40bc240e51585f5184d057146d2e4da2fbed84
Merge: 9759978 8444b98
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Nov 1 10:18:30 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Nov 1 10:18:30 2016 -0400

    Merge topic 'UseSWIG-SWIG_OUTFILE_DIR' into next
    
    8444b984 UseSWIG: Add option to specify swig output file directory


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8444b984a29392c32a13521cc0e3d40788cc9530
commit 8444b984a29392c32a13521cc0e3d40788cc9530
Author:     Cong Zhang <congzhangzh at gmail.com>
AuthorDate: Sun Oct 30 23:56:37 2016 +0800
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Nov 1 10:10:08 2016 -0400

    UseSWIG: Add option to specify swig output file directory
    
    `swig` has two output-related options:
    
    * `-o <outfile>`: Set name of C/C++ output file to <outfile>
    * `-outdir <dir>`: Set language-specific files output directory to <dir>
    
    We already have `CMAKE_SWIG_OUTDIR` for the latter.  Add a new
    `SWIG_OUTFILE_DIR` option for the former.

diff --git a/Help/release/dev/UseSWIG-SWIG_OUTFILE_DIR.rst b/Help/release/dev/UseSWIG-SWIG_OUTFILE_DIR.rst
new file mode 100644
index 0000000..c001a88
--- /dev/null
+++ b/Help/release/dev/UseSWIG-SWIG_OUTFILE_DIR.rst
@@ -0,0 +1,6 @@
+UseSWIG-SWIG_OUTFILE_DIR
+------------------------
+
+* The :module:`UseSWIG` module ``swig_add_source_to_module`` command
+  learned a new ``SWIG_OUTFILE_DIR`` option to control the output
+  file location (``swig -o``).
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index d242f87..2df0011 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -36,8 +36,11 @@
 #
 # 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)
+# CMAKE_SWIG_OUTDIR allows one to specify where to write
+# the language specific files (swig -outdir option).
+#
+# SWIG_OUTFILE_DIR allows one to specify where to write the output file
+# (swig -o option).  If not specified, CMAKE_SWIG_OUTDIR is used.
 #
 # The name-specific variable SWIG_MODULE_<name>_EXTRA_DEPS may be used to specify extra
 # dependencies for the generated modules.
@@ -142,6 +145,13 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
   else()
     set(swig_outdir ${CMAKE_CURRENT_BINARY_DIR})
   endif()
+
+  if(SWIG_OUTFILE_DIR)
+    set(swig_outfile_dir ${SWIG_OUTFILE_DIR})
+  else()
+    set(swig_outfile_dir ${swig_outdir})
+  endif()
+
   if (NOT SWIG_MODULE_${name}_NOPROXY)
     SWIG_GET_EXTRA_OUTPUT_FILES(${SWIG_MODULE_${name}_LANGUAGE}
       swig_extra_generated_files
@@ -149,7 +159,7 @@ macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
       "${swig_source_file_fullname}")
   endif()
   set(swig_generated_file_fullname
-    "${swig_outdir}/${swig_source_file_name_we}")
+    "${swig_outfile_dir}/${swig_source_file_name_we}")
   # add the language into the name of the file (i.e. TCL_wrap)
   # this allows for the same .i file to be wrapped into different languages
   string(APPEND swig_generated_file_fullname

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

Summary of changes:
 Help/release/dev/UseSWIG-SWIG_OUTFILE_DIR.rst |    6 ++++++
 Modules/UseSWIG.cmake                         |   16 +++++++++++++---
 2 files changed, 19 insertions(+), 3 deletions(-)
 create mode 100644 Help/release/dev/UseSWIG-SWIG_OUTFILE_DIR.rst


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list