Build baresip against libre vcpkg port

38 views
Skip to first unread message

Johan Tjernström

unread,
Feb 13, 2024, 5:08:45 AM2/13/24
to baresip
Hi!

I wanted to try baresip and found the vcpkg port of libre (baresip-libre) so I thought I try that approach before the official way. The port installed just fine.

Now I want to build baresip. Unfortunately, there is no vcpkg port for this lib. According to the baresip-libre usage instructions you should use:

    find_package(libre CONFIG REQUIRED)
    target_link_libraries(main PRIVATE libre::libre)


My experience with CMake is not great but I tried to modify the baresip CMakeLists.txt in different ways, basically I tried this:

    find_package(re CONFIG REQUIRED HINTS ../re/cmake) ->
    find_package(libre CONFIG REQUIRED)

and 
    set(LINKLIBS ${RE_LIBRARIES} ${RE_LIBS}) ->
    set(LINKLIBS "libre::libre")

LINKLIBS later get appended to all the different target_* calls, e.g.
    target_link_libraries(baresip PUBLIC ${LINKLIBS} ${MODULES_DETECTED})

When CMake generates my build files I don't get the correct include directories, I miss the "re" subfolder (e.g. vcpkg\installed\x64-windows\include\re) where the libre header files are installed. I found the following line in libre-targets.cmake which I assume is supposed to handle this:

   set_target_properties(libre::re PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include/re"

But it doesn't seem to propagate all the way. Anyone have any experience with this or have any suggestions before I go the official installation way?

I'm in a Windows 10 environment and use MSVC 2022 btw.

Regards,
Johan
Reply all
Reply to author
Forward
0 new messages