On 28. 5. 25 14:27, Timofei Zhakov wrote:
On Wed, May 28, 2025 at 2:14 PM Branko Čibej <br...@apache.org> wrote:

    So I was fiddling with Serf's CMake build recently, and just now I
    noticed (again) that Serf has FindAPR.cmake and FindAPRUtil.cmake
    as well, and they're almost entirely completely different from
    Subversion's. Not only completely different but far more complete,
    IMO.

    I'd like to merge the two versions of these files and use the same
    ones in both Serf and Subversion. Maybe later submit them to APR,
    so that they can be deployed into <prefix>/share/cmake.

    -- Brane


+1

Actually, I was also thinking about merging those modules when I was developing cmake support in svn.

The serf modules have a lot of custom code and I'd say they are a mess. This is why I didn't copy them to subversion, but wrote them from scratch. I remember when I was building serf using cmake, it failed a few times because apr could not be located, which wasn't happening in svn.

I tried to avoid using custom hacks as much as possible, and I think they are quite pretty right now. Except, they don't support pkgconfig library finding. But this can be done through a standard module. Maybe I even have a patch for that somewhere.

Also svn's modules define /imported targets /for apr which makes it so the library can be linked in using a single line of cmake, including include directories, lib files, and custom settings such as APR_DECLARE_STATIC.

You mean, like this? From Serf's FindAPR.cmake, but only for Windows:

        add_library(APR::APR_static STATIC IMPORTED)
        set_target_properties(APR::APR_static PROPERTIES
          INTERFACE_INCLUDE_DIRECTORIES "${APR_INCLUDES}"
          IMPORTED_INTERFACE_LINK_LIBRARIES "${_apr_extra}"
          IMPORTED_LOCATION "${_apr_static}")



So, it would be great if serf starts using svn's modules. I can try to support pkgconfig in them if needed.


Subversion's FindAPR{Util} doesn't even know that apr-2 exists, so that's a non-starter. The symbol APR_DECLARE_IMPORT used in Subversion's variants does not appear anywhere in APR's codebase, except in CMakeLists.txt on the 1.7.x branch. It has no effect. And so on.

This needs to be a proper merge, not just Serf reverting to use Subversion's incomplete implementation.

-- Brane

Reply via email to