svn commit: r1919799 - /subversion/branches/cmake/CMakeLists.txt

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <[email protected]>
Author: rinrab
Date: Sat Aug 10 19:25:38 2024
New Revision: 1919799

URL: http://svn.apache.org/viewvc?rev=1919799&view=rev
Log:
On the 'cmake' branch: Support compilation of Perl SWIG bindings.

For finding the Perl dev-kit, the FindPerlLibs.cmake built-in CMake module
will be utilized. This module doesn't actually create a target, so we will
do it manually and will just setup the external-perl target properties with
values from FindPerlLibs. The targets for the Perl SWIG bindings are already
created by gen-cmake while other Perl-specific options will be handled by the
UseSWIG module.

* CMakeLists.txt
  (swig.perl): Create the external-perl target for the Perl bindings.

Modified:
    subversion/branches/cmake/CMakeLists.txt

Modified: subversion/branches/cmake/CMakeLists.txt
URL: http://svn.apache.org/viewvc/subversion/branches/cmake/CMakeLists.txt?rev=1919799&r1=1919798&r2=1919799&view=diff
==============================================================================
--- subversion/branches/cmake/CMakeLists.txt (original)
+++ subversion/branches/cmake/CMakeLists.txt Sat Aug 10 19:25:38 2024
@@ -284,6 +284,21 @@ if(SVN_ENABLE_SWIG_PYTHON)
   )
 endif()
 
+if(SVN_ENABLE_SWIG_PERL)
+  find_package(Perl REQUIRED)
+  find_package(PerlLibs REQUIRED)
+
+  add_library(external-perl IMPORTED INTERFACE)
+  target_include_directories(external-perl INTERFACE
+    ${PERL_INCLUDE_PATH}
+    ${SWIG_INCLUDE_DIRECTORIES}
+    ${CMAKE_CURRENT_SOURCE_DIR}/subversion/bindings/swig/perl/libsvn_swig_perl
+  )
+  target_compile_definitions(external-perl INTERFACE "__inline__=__inline")
+  target_compile_options(external-perl INTERFACE ${PERL_EXTRA_C_FLAGS})
+  target_link_libraries(external-perl INTERFACE ${PERL_LIBRARY})
+endif()
+
 function(target_exports target_name)
   if (WIN32)
     set(def_file_path "${CMAKE_BINARY_DIR}/${target_name}.def")
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.