Author: rinrab
Date: Wed Jul 3 14:26:41 2024
New Revision: 1918878
URL: http://svn.apache.org/viewvc?rev=1918878&view=rev
Log:
On the 'cmake' branch: Inline `options.cmake`, `dependencies.cmake`, and
`extractor.cmake` files.
These files are no longer needs to be in theirs files, because CMakeLists.txt
is now included into the repository and is not generated, so the separation
and later including of these files is not required and only complicates the
development and usage.
* build/cmake/dependencies.cmake,
build/cmake/extractor.cmake,
* build/cmake/options.cmake: Delete these files.
* CMakeLists.txt
(): Replace includes of the following files with theirs content.
Removed:
subversion/branches/cmake/build/cmake/dependencies.cmake
subversion/branches/cmake/build/cmake/extractor.cmake
subversion/branches/cmake/build/cmake/options.cmake
Modified:
subversion/branches/cmake/CMakeLists.txt
Modified: subversion/branches/cmake/CMakeLists.txt
URL:
http://svn.apache.org/viewvc/subversion/branches/cmake/CMakeLists.txt?rev=1918878&r1=1918877&r2=1918878&view=diff
==============================================================================
--- subversion/branches/cmake/CMakeLists.txt (original)
+++ subversion/branches/cmake/CMakeLists.txt Wed Jul 3 14:26:41 2024
@@ -23,11 +23,155 @@ cmake_minimum_required(VERSION 3.12)
project("Subversion")
-include("build/cmake/dependencies.cmake")
+configure_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/subversion/svn_private_config.hc"
+ "${CMAKE_CURRENT_BINARY_DIR}/svn_private_config.h"
+)
-include("build/cmake/options.cmake")
+option(SVN_BUILD_RA_LOCAL "Build Subversion Local Repository Access Library"
ON)
+if (SVN_BUILD_RA_LOCAL)
+ add_compile_definitions("SVN_LIBSVN_RA_LINKS_RA_LOCAL")
+endif()
-include("build/cmake/extractor.cmake")
+# TODO:
+# option(SVN_BUILD_RA_SERF "Build Subversion HTTP/WebDAV Protocol Repository
Access Library" OFF)
+# if (SVN_BUILD_RA_SERF)
+# add_compile_definitions("SVN_LIBSVN_RA_LINKS_RA_SERF")
+# endif()
+
+option(SVN_BUILD_RA_SVN "Build Subversion SVN Protocol Repository Access
Library" ON)
+if (SVN_BUILD_RA_SVN)
+ add_compile_definitions("SVN_LIBSVN_RA_LINKS_RA_SVN")
+endif()
+
+option(SVN_BUILD_FS_FS "Build Subversion FSFS Repository Filesystem Library"
ON)
+if (SVN_BUILD_FS_FS)
+ add_compile_definitions("SVN_LIBSVN_FS_LINKS_FS_FS")
+endif()
+
+option(SVN_BUILD_FS_X "Build Subversion FSX Repository Filesystem Library" ON)
+if (SVN_BUILD_FS_X)
+ add_compile_definitions("SVN_LIBSVN_FS_LINKS_FS_X")
+endif()
+
+option(SVN_BUILD_PROGRAMS "Build Subversion programs (such as svn.exe)" ON)
+option(SVN_BUILD_TOOLS "Build Subversion tools" OFF)
+option(SVN_BUILD_TEST "Build Subversion test-suite" OFF)
+
+option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
+
+option(SVN_BUILD_SHARED_FS "Build shared FS modules" ${BUILD_SHARED_LIBS})
+if(SVN_BUILD_SHARED_FS)
+ set(SVN_FS_BUILD_TYPE SHARED)
+else()
+ set(SVN_FS_BUILD_TYPE STATIC)
+endif()
+
+option(SVN_BUILD_SHARED_RA "Build shared RA modules" OFF)
+if(SVN_BUILD_SHARED_RA)
+ set(SVN_RA_BUILD_TYPE SHARED)
+else()
+ set(SVN_RA_BUILD_TYPE STATIC)
+endif()
+
+if(SVN_BUILD_SHARED_RA)
+ message(FATAL_ERROR "SVN_BUILD_SHARED_RA not yet supported")
+endif()
+
+# Setup modules path
+
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake")
+
+### APR
+
+find_package(APR REQUIRED)
+add_library(external-apr ALIAS apr::apr)
+
+### APR-Util
+
+find_package(APRUtil REQUIRED)
+add_library(external-aprutil ALIAS apr::aprutil)
+
+### ZLIB
+
+find_package(ZLIB)
+add_library(external-zlib ALIAS ZLIB::ZLIB)
+
+### EXPAT
+
+find_package(EXPAT MODULE REQUIRED)
+add_library(external-xml ALIAS EXPAT::EXPAT)
+
+### LZ4
+
+option(SVN_USE_INTERNAL_LZ4 "Use internal version of lz4" ON)
+
+if(SVN_USE_INTERNAL_LZ4)
+ add_library(external-lz4 STATIC "build/win32/empty.c")
+ target_compile_definitions(external-lz4 PUBLIC "SVN_INTERNAL_LZ4")
+else()
+ find_package(lz4 CONFIG REQUIRED)
+ add_library(external-lz4 ALIAS lz4::lz4)
+endif()
+
+### UTF8PROC
+
+option(SVN_USE_INTERNAL_UTF8PROC "Use internal version of utf8proc" ON)
+
+if(SVN_USE_INTERNAL_UTF8PROC)
+ add_library(external-utf8proc STATIC "build/win32/empty.c")
+ target_compile_definitions(external-utf8proc PUBLIC "SVN_INTERNAL_UTF8PROC")
+else()
+ message(FATAL_ERROR "TODO:")
+ # find_package(utf8proc CONFIG REQUIRED)
+ # add_library(external-utf8proc ALIAS utf8proc)
+endif()
+
+### SQLite3
+
+option(SVN_SQLITE_USE_AMALGAMATION "Use sqlite amalgamation" ON)
+set(SVN_SQLITE_AMALGAMATION_ROOT "${CMAKE_SOURCE_DIR}/sqlite-amalgamation"
+ CACHE STRING "Directory with sqlite amalgamation"
+)
+
+if(SVN_SQLITE_USE_AMALGAMATION)
+ add_library(external-sqlite STATIC "build/win32/empty.c")
+ find_path(SVN_SQLITE_AMALGAMATION_DIR
+ NAMES sqlite3.c
+ PATHS ${SVN_SQLITE_AMALGAMATION_ROOT}
+ )
+ target_include_directories(external-sqlite PUBLIC
${SVN_SQLITE_AMALGAMATION_DIR})
+ target_compile_definitions(external-sqlite PUBLIC SVN_SQLITE_INLINE)
+else()
+ find_package(SQLite3 REQUIRED)
+ add_library(external-sqlite ALIAS SQLite::SQLite3)
+endif()
+
+find_package(Python COMPONENTS Interpreter REQUIRED)
+
+function(target_exports target_name)
+ if (WIN32)
+ set(def_file_path "${CMAKE_BINARY_DIR}/${target_name}.def")
+
+ add_custom_command(
+ WORKING_DIRECTORY
+ "${CMAKE_SOURCE_DIR}"
+ COMMAND
+ "${Python_EXECUTABLE}"
+ ARGS
+ "build/generator/extractor.py"
+ ${ARGN}
+ ">${def_file_path}"
+ OUTPUT
+ "${def_file_path}"
+ DEPENDS
+ "build/generator/extractor.py"
+ ${ARGN}
+ )
+
+ target_sources("${target_name}" PRIVATE "${def_file_path}")
+ endif()
+endfunction()
set(SVN_INCLUDE_DIRECTORIES
"${CMAKE_CURRENT_SOURCE_DIR}/subversion/include"