Hi, On Tue, Jun 11, 2024 at 5:40 AM Timofey Zhakov <t...@chemodax.net> wrote: > > On Sat, Jun 8, 2024 at 4:10 PM Timofey Zhakov <t...@chemodax.net> wrote: > > > > Hi all! > > > > When I was starting using and developing Subversion, I had a big > > challenge to build it for the first time, especially because > > Subversion itself and its dependencies have different build systems, > > so this is a very complicated process. > > > > The build process can be improved by adding a generator for the CMake > > build system. This can be easily implemented due to the extensibility > > of the Subversion's gen-make. > > > > Some advantages of using CMake in Subversion: > > - CMake is used by some Subversion dependencies, so there is nothing > > else to learn. > > - Great Visual Studio integration for build and tests. In addition, > > there is a VSCode extension for CMake. > > - CMake provides a very useful and simple system for finding dependencies. > > - Better for build scripts and reproducibility of the build. > > > > The commands that would be needed to build Subversion, if you have all > > dependencies installed: > > > > ``` > > $ .\gen-make.py -t cmake > > $ cmake -B out -DCMAKE_INSTALL_PREFIX=/path/to/deps > > $ cmake --build out > > ``` > > > > Additionally, there is a great tool, vcpkg, which can be used to build > > dependencies. It is integrated with CMake. The following command can > > be used to install dependencies: > > > > ``` > > git clone https://github.com/microsoft/vcpkg > > cd vcpkg > > .\bootstrap-vcpkg.bat -disableMetrics > > .\vcpkg.exe install apr apr-util expat zlib > > ``` > > > > I am attaching a draft patch with the implementation of the CMake generator. > > > > What do you think? > > Hello, > > I'm updating the patch with improved dependency searching, related to > APR and APR Util, and some minor improvements. > > Additionally, I realized that I didn't implement the SQL header > generation. I didn't notice it earlier because I had the headers > after using the vcnet project files. I'll do it soon. > > > -- > Timofei Zhakov
1. The setargv.obj is added to all executables at last of CMakeLists.txt. However, setargv.obj is actually applied to only svn.exe and svnadmin.exe in build.conf. It is intentional, according to https://svn.apache.org/r1577170 I think we should keep the behavior between build systems. [[[ # Enable globbing for all executables if(MSVC) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} setargv.obj") endif() ]]] 2. gen-make.py accepts --with-PKG=... options like the following, but all options should be passed to cmake -B again. Why CMakeLists.txt is generated instead of adding directly CMakeLists.txt, in the patch? [[[ python gen-make.py -t cmake ^ --with-httpd=%CD%\..\win64-vs16\httpd ^ --with-apr=%CD%\..\win64-vs16\httpd ^ --with-apr-util=%CD%\..\win64-vs16\httpd ^ --with-openssl=C:\usr\apps\vcpkg\installed\x64-windows-release ^ --with-zlib==C:\usr\apps\vcpkg\installed\x64-windows-release ^ --with-libintl=C:\usr\apps\vcpkg\installed\x64-windows-release ^ --with-sqlite=C:\usr\apps\vcpkg\installed\x64-windows-release ^ --with-serf=%CD%\..\win64-vs16\serf ^ --with-swig=%CD%\..\swig\3.0.12 ^ --with-jdk=C:\usr\apps\jdk-16.0.1 ^ --with-junit=%CD%\..\junit-4.13.2.jar ]]] Also, I get cmake failing on Windows yet. [[[ C>cmake.exe -B out ^ -D CMAKE_BUILD_TYPE=Release -D APR_LIBRARY=%CD%\..\win64-vs16\httpd ^ -D APRUTIL_LIBRARY=%CD%\..\win64-vs16\httpd ^ -D APR_INCLUDE_DIR=%CD%\..\win64-vs16\httpd\include ^ -D APRUTIL_INCLUDE_DIR=%CD%\..\win64-vs16\httpd ^ -D ZLIB_INCLUDE_DIR=C:\usr\apps\vcpkg\installed\x64-windows-release\include ^ -D ZLIB_LIBRARY=C:\usr\apps\vcpkg\installed\x64-windows-release\lib\zlib.lib ^ -- Selecting Windows SDK version 10.0.20348.0 to target Windows 10.0.19045. APR config not found. Looking for libraries and includes... Found APR library: C:/usr/src/subversion/win64-vs16/httpd Found APR include dir: C:/usr/src/subversion/win64-vs16/httpd Found APR-Util library: C:/usr/src/subversion/win64-vs16/httpd Found APR-Util include dir: C:/usr/src/subversion/win64-vs16/httpd CMake Error at CMakeLists.txt:141 (find_package): Could not find a package configuration file provided by "expat" with any of the following names: expatConfig.cmake expat-config.cmake Add the installation prefix of "expat" to CMAKE_PREFIX_PATH or set "expat_DIR" to a directory containing one of the above files. If "expat" provides a separate development package or SDK, be sure it has been installed. -- Configuring incomplete, errors occurred! ]]] -- Jun Omae <jun6...@gmail.com> (大前 潤)