svn commit: r1919754 - in /subversion/branches/cmake: CMakeLists.txt build/generator/templates/targets.cmake.ezt

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <[email protected]>
Author: rinrab
Date: Thu Aug  8 17:06:51 2024
New Revision: 1919754

URL: http://svn.apache.org/viewvc?rev=1919754&view=rev
Log:
On the 'cmake' branch: Setup include directories for SWIG bindings (which
were added using the swig_add_library() command).

For changing the SWIG include directories and for include directories while
later compilation of native files. We could use the SWIG_INCLUDE_DIRECTORIES
and INCLUDE_DIRECTORIES target properties for this. Additionally, it is
required to add the include directories to a variable
(SWIG_INCLUDE_DIRECTORIES in this case) before.

* build/generator/templates/targets.cmake.ezt
  (swig): Use the set_target_properties() command to setup the
   SWIG_INCLUDE_DIRECTORIES and INCLUDE_DIRECTORIES.

* CMakeLists.txt
  (swig): Initialize the SWIG_INCLUDE_DIRECTORIES variable.

Modified:
    subversion/branches/cmake/CMakeLists.txt
    subversion/branches/cmake/build/generator/templates/targets.cmake.ezt

Modified: subversion/branches/cmake/CMakeLists.txt
URL: http://svn.apache.org/viewvc/subversion/branches/cmake/CMakeLists.txt?rev=1919754&r1=1919753&r2=1919754&view=diff
==============================================================================
--- subversion/branches/cmake/CMakeLists.txt (original)
+++ subversion/branches/cmake/CMakeLists.txt Thu Aug  8 17:06:51 2024
@@ -247,6 +247,14 @@ find_package(Python COMPONENTS Interpret
 if(SVN_ENABLE_SWIG_PERL OR SVN_ENABLE_SWIG_PYTHON OR SVN_ENABLE_SWIG_RUBY)
   find_package(SWIG REQUIRED)
   include(${SWIG_USE_FILE})
+
+  set(SWIG_INCLUDE_DIRECTORIES
+    ${CMAKE_CURRENT_SOURCE_DIR}/subversion/bindings/swig/include
+    ${CMAKE_CURRENT_SOURCE_DIR}/subversion/bindings/swig/proxy
+    ${CMAKE_CURRENT_SOURCE_DIR}/subversion/bindings/swig
+    ${CMAKE_CURRENT_SOURCE_DIR}/subversion/include
+    ${CMAKE_CURRENT_BINARY_DIR}
+  )
 endif()
 
 function(target_exports target_name)

Modified: subversion/branches/cmake/build/generator/templates/targets.cmake.ezt
URL: http://svn.apache.org/viewvc/subversion/branches/cmake/build/generator/templates/targets.cmake.ezt?rev=1919754&r1=1919753&r2=1919754&view=diff
==============================================================================
--- subversion/branches/cmake/build/generator/templates/targets.cmake.ezt (original)
+++ subversion/branches/cmake/build/generator/templates/targets.cmake.ezt Thu Aug  8 17:06:51 2024
@@ -25,6 +25,10 @@ if ([targets.enable_condition])[is targe
   swig_add_library([targets.name]
     LANGUAGE [targets.swig_lang]
     SOURCES[for targets.sources] [targets.sources][end]
+  )
+  set_target_properties([targets.name] PROPERTIES
+    SWIG_INCLUDE_DIRECTORIES "${SWIG_INCLUDE_DIRECTORIES}"
+    INCLUDE_DIRECTORIES "${SWIG_INCLUDE_DIRECTORIES}"
   )[else][is targets.type "lib"]
   add_library([targets.name][if-any targets.build_type] [targets.build_type][end][for targets.sources]
     [targets.sources][end]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.