Den tors 26 juni 2025 kl 23:19 skrev Branko Čibej <br...@apache.org>:

>
> By the way, I noticed that the CMake build is consistently, intentionally
> behaving differently from the autotools build: autotools look for serf-2
> before serf-1 and apr-2 before apr(-util)-1, CMake does the opposite. I
> have no idea why, except maybe stubbornness.
>

"stubbornness" is a bit too hard in my book, it is very much uncalled for.
I'd be happy to call it inconsistent...

If I understand things correctly, FindSerf.cmake is looking for serf-2
before serf-1:

[[[
find_library(Serf_LIBRARY
  NAMES serf-2 serf-1
  PATH_SUFFIXES lib "${CMAKE_INSTALL_LIBDIR}"
)
]]]

But CMakelLists.txt, when using pkg-config, seems to look for serf-1 first:
[[[
  if(SVN_USE_PKG_CONFIG)
    pkg_check_modules(serf1 IMPORTED_TARGET serf-1)

    if(serf1_FOUND)
      # serf-1
      add_library(external-serf ALIAS PkgConfig::serf1)
    else()
      # serf-2
      pkg_check_modules(serf2 REQUIRED IMPORTED_TARGET serf-2)
      add_library(external-serf ALIAS PkgConfig::serf2)
    endif()
]]]

For APR I find it a bit more difficult to understand, but to me it looks
like it is based on finding apr.h, so it would probably find apr-1 before
apr-2:
[[[
find_path(APR_INCLUDE_DIR
  NAMES apr.h
  PATH_SUFFIXES
    include
    include/apr-1
    include/apr-1.0
    include/apr-2
    include/apr-2.0
)
]]]

When using pkg-config it seems to be the same as for Serf. It seems like
easy enough to change, but I'd like to hear other opinions if there is a
reason why it was done like this. @Timofei Zhakov <t...@chemodax.net>, I
believe this was written by you?

Cheers,
Daniel

Reply via email to