Hi!

Den lör 8 juni 2024 kl 16:12 skrev Timofey Zhakov <t...@chemodax.net>:

> 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?
>

I think it would be a very good addition to support CMake. Thanks for
bringing this up!

I'm just thinking about if it is worth supporting yet another build
generator. The answer I'm looking for is not to shoot down this effort -
rather:
* Can we drop any of the existing targets?
 - vcproj probably can go away since CMake has a higher longterm chance of
creating valid project files for future VS versions.
 - make, maybe we could switch completely? Are there any compelling reasons
for NOT using CMake to create Makefile?
* If we end up deciding to switch - shouldn't we rather rip out the
existing build-system generator architecture? Otherwise we end up in a
situation where we have a configuration (build.conf) and a generator
(gen-make.py and related) creating rulefile(s) for CMake only to have CMake
create rulefile(s) for whatever buildsystem actually used for building.

That said, I'm having some trouble figuring out how to tell CMake where APR
is installed. I run vcpkg as above in c:\devel, meaning I now have
everything installed in c:\devel\vcpkg\installed\x64-windows (for
example c:\devel\vcpkg\installed\x64-windows\include\apr.h). Still I get:

[[[
C:\Devel\svn_trunk_cmake>cmake -B out
-DCMAKE_INSTALL_PREFIX=c:\devel\vcpkg\installed\x64-windows
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 6.2.9200.
CMake Warning at CMakeLists.txt:38 (find_package):
  By not providing "Findapr.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "apr", but
  CMake did not find one.

...cut...
]]]

I'm sure I'm doing things wrong but I can't figure out what...

Kind regards,
Daniel

Reply via email to