Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Conan 2.x #7042

Open
wants to merge 74 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
8983956
Migrate to Conan 2.x
SiarheiFedartsou Sep 29, 2024
5359a77
Migrate to Conan 2.x
SiarheiFedartsou Sep 29, 2024
e67e9ea
Migrate to Conan 2.x
SiarheiFedartsou Sep 29, 2024
3af3b11
Migrate to Conan 2.x
SiarheiFedartsou Sep 29, 2024
dd6cf93
Migrate to Conan 2.x
SiarheiFedartsou Sep 29, 2024
324e4ee
Migrate to Conan 2.x
SiarheiFedartsou Sep 29, 2024
893c0d7
Migrate to Conan 2.x
SiarheiFedartsou Sep 29, 2024
a885dff
Migrate to Conan 2.x
SiarheiFedartsou Sep 29, 2024
ac3cac7
Migrate to Conan 2.x
SiarheiFedartsou Sep 29, 2024
9107198
Migrate to Conan 2.x
SiarheiFedartsou Sep 29, 2024
8871c90
Migrate to Conan 2.x
SiarheiFedartsou Sep 29, 2024
ac89b85
Migrate to Conan 2.x
SiarheiFedartsou Sep 30, 2024
ab519aa
Migrate to Conan 2.x
SiarheiFedartsou Sep 30, 2024
dcd4ddb
Migrate to Conan 2.x
SiarheiFedartsou Sep 30, 2024
69ef347
Migrate to Conan 2.x
SiarheiFedartsou Sep 30, 2024
2293d13
Migrate to Conan 2.x
SiarheiFedartsou Sep 30, 2024
fec9a42
Migrate to Conan 2.x
SiarheiFedartsou Sep 30, 2024
b7f0a1f
Migrate to Conan 2.x
SiarheiFedartsou Oct 1, 2024
f638b04
Migrate to Conan 2.x
SiarheiFedartsou Oct 1, 2024
4f5825f
Migrate to Conan 2.x
SiarheiFedartsou Oct 1, 2024
1d06531
Migrate to Conan 2.x
SiarheiFedartsou Oct 1, 2024
9654339
Migrate to Conan 2.x
SiarheiFedartsou Oct 1, 2024
165853a
Migrate to Conan 2.x
SiarheiFedartsou Oct 1, 2024
822c373
Migrate to Conan 2.x
SiarheiFedartsou Oct 3, 2024
9ecc91e
wip
SiarheiFedartsou Oct 9, 2024
2c40141
wip
SiarheiFedartsou Oct 12, 2024
e578e6d
wip
SiarheiFedartsou Oct 12, 2024
cbed6bd
wip
SiarheiFedartsou Oct 12, 2024
6ec17cf
wip
SiarheiFedartsou Oct 12, 2024
4897275
wip
SiarheiFedartsou Oct 12, 2024
b76dbfb
wip
SiarheiFedartsou Oct 12, 2024
ad04774
wip
SiarheiFedartsou Oct 12, 2024
17e1c04
wip
SiarheiFedartsou Oct 12, 2024
56ccb1e
wip
SiarheiFedartsou Oct 13, 2024
b85f235
wip
SiarheiFedartsou Oct 13, 2024
6a8ff78
wip
SiarheiFedartsou Oct 13, 2024
ae0913d
wip
SiarheiFedartsou Oct 13, 2024
66df8f5
wip
SiarheiFedartsou Oct 13, 2024
8190a30
wip
SiarheiFedartsou Oct 13, 2024
b59fff2
wip
SiarheiFedartsou Oct 13, 2024
7e2b7d4
wip
SiarheiFedartsou Oct 13, 2024
022e950
wip
SiarheiFedartsou Oct 13, 2024
b643194
wip
SiarheiFedartsou Oct 13, 2024
ce6c050
wip
SiarheiFedartsou Oct 13, 2024
a67ef6f
wip
SiarheiFedartsou Oct 13, 2024
3461761
wip
SiarheiFedartsou Oct 13, 2024
c061337
wip
SiarheiFedartsou Oct 13, 2024
d5564cc
wip
SiarheiFedartsou Oct 20, 2024
22c8a3d
wip
SiarheiFedartsou Oct 20, 2024
df5da66
wip
SiarheiFedartsou Oct 21, 2024
a463bbb
Merge branch 'master' into sf-conan2
SiarheiFedartsou Oct 21, 2024
c127194
wip
SiarheiFedartsou Oct 21, 2024
9ed9d6c
wip
SiarheiFedartsou Oct 21, 2024
cc0eeb2
wip
SiarheiFedartsou Oct 21, 2024
5d6468f
wip
SiarheiFedartsou Oct 22, 2024
c39dc2e
wip
SiarheiFedartsou Oct 22, 2024
fe0d560
wip
SiarheiFedartsou Oct 22, 2024
ad08b15
wip
SiarheiFedartsou Oct 22, 2024
aea0d88
wip
SiarheiFedartsou Oct 23, 2024
044080d
wip
SiarheiFedartsou Oct 23, 2024
c340430
wip
SiarheiFedartsou Oct 23, 2024
bac4f12
wip
SiarheiFedartsou Oct 23, 2024
99b3e8f
wip
SiarheiFedartsou Oct 23, 2024
67fca9f
wip
SiarheiFedartsou Oct 25, 2024
1e7e4ff
wip
SiarheiFedartsou Oct 25, 2024
182ad13
wip
SiarheiFedartsou Oct 26, 2024
7c1f0bf
wip
SiarheiFedartsou Oct 27, 2024
12163b0
wip
SiarheiFedartsou Oct 29, 2024
0c9b23f
wip
SiarheiFedartsou Oct 29, 2024
f48bfdf
wip
SiarheiFedartsou Oct 29, 2024
7848f99
wip
SiarheiFedartsou Oct 29, 2024
8cb8e64
wip
SiarheiFedartsou Oct 29, 2024
3be0c11
wip
SiarheiFedartsou Oct 29, 2024
46f0aa4
wip
SiarheiFedartsou Nov 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 24 additions & 26 deletions .github/workflows/osrm-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
BUILD_TYPE: Release
steps:
- uses: actions/checkout@v4
- run: pip install "conan<2.0.0"
- run: conan --version
- run: cmake --version
- uses: actions/setup-node@v4
with:
Expand All @@ -51,6 +49,12 @@ jobs:
run: |
mkdir build
cd build

python3 -m venv .venv
source .venv/Scripts/Activate
python3 -m pip install conan==2.7.1
conan profile detect --force

cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON ..
cmake --build . --config Release

Expand Down Expand Up @@ -393,10 +397,10 @@ jobs:
- name: Enable Conan cache
uses: actions/cache@v4
with:
path: ~/.conan
key: v9-conan-${{ matrix.name }}-${{ github.sha }}
path: ~/.conan2
key: v10-conan-${{ matrix.name }}-${{ github.sha }}
restore-keys: |
v9-conan-${{ matrix.name }}-
v10-conan-${{ matrix.name }}-
- name: Enable test cache
uses: actions/cache@v4
with:
Expand Down Expand Up @@ -457,8 +461,6 @@ jobs:

- name: Install dev dependencies
run: |
python3 -m pip install "conan<2.0.0" || python3 -m pip install "conan<2.0.0" --break-system-packages

# workaround for issue that GitHub Actions seems to not adding it to PATH after https://github.com/actions/runner-images/pull/6499
# and that's why CI cannot find conan executable installed above
if [[ "${RUNNER_OS}" == "macOS" ]]; then
Expand Down Expand Up @@ -495,20 +497,6 @@ jobs:
tar zxvf onetbb.tgz
sudo cp -a oneapi-tbb-${TBB_VERSION}/lib/. /usr/local/lib/
sudo cp -a oneapi-tbb-${TBB_VERSION}/include/. /usr/local/include/
- name: Add Clang 18 to list of Conan compilers # workaround for the issue that Conan 1.x doesn't know about Clang 18
if: ${{ matrix.ENABLE_CONAN == 'ON' && matrix.CCOMPILER == 'clang-18' }}
run: |
sudo wget https://github.com/mikefarah/yq/releases/download/v4.9.6/yq_linux_amd64 -O /usr/bin/yq && sudo chmod +x /usr/bin/yq

conan config init
yq eval '.compiler.clang.version += ["18"]' -i "$HOME/.conan/settings.yml"
- name: Add Apple-clang 16 to list of Conan compilers # workaround for the issue that Conan 1.x doesn't know about Apple-clang 16
if: ${{ matrix.ENABLE_CONAN == 'ON' && matrix.runs-on == 'macos-14' }}
run: |
sudo wget https://github.com/mikefarah/yq/releases/download/v4.9.6/yq_darwin_arm64 -O /usr/local/bin/yq && sudo chmod +x /usr/local/bin/yq

conan config init
yq eval '.compiler.apple-clang.version += ["16.0"]' -i "$HOME/.conan/settings.yml"
- name: Prepare build
run: |
mkdir ${OSRM_BUILD_DIR}
Expand All @@ -530,7 +518,14 @@ jobs:
run: |
echo "Using ${JOBS} jobs"
pushd ${OSRM_BUILD_DIR}


if [[ "${ENABLE_CONAN}" == "ON" ]]; then
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install conan==2.7.1
conan profile detect --force
fi

ccache --zero-stats
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DENABLE_CONAN=${ENABLE_CONAN:-OFF} \
Expand All @@ -544,6 +539,7 @@ jobs:
-DENABLE_CCACHE=ON \
-DENABLE_LTO=${ENABLE_LTO:-ON} \
-DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR}

make --jobs=${JOBS}

if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" ]]; then
Expand All @@ -558,7 +554,7 @@ jobs:
fi
popd
- name: Build example
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }}
if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' && matrix.ENABLE_CONAN != 'ON' }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No a lot of reasons to support building libosrm example with Conan... IMO if we want to use Conan deps there instead of system ones we should make libosrm Conan package itself...

run: |
mkdir example/build && pushd example/build
cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
Expand All @@ -570,8 +566,10 @@ jobs:
make -C test/data benchmark

# macOS SIP strips the linker path. Reset this inside the running shell
export LD_LIBRARY_PATH=${{ env.LD_LIBRARY_PATH }}
./example/build/osrm-example test/data/mld/monaco.osrm
if [[ "${ENABLE_CONAN}" == "OFF" ]]; then
export LD_LIBRARY_PATH=${{ env.LD_LIBRARY_PATH }}
./example/build/osrm-example test/data/mld/monaco.osrm
fi

# All tests assume to be run from the build directory
pushd ${OSRM_BUILD_DIR}
Expand Down Expand Up @@ -681,7 +679,7 @@ jobs:
python3 -m venv .venv
source .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
pip install "conan<2.0.0" "requests==2.31.0" "numpy==1.26.4"
pip install "conan==2.7.1" "requests==2.31.0" "numpy==1.26.4"
- name: Prepare data
run: |
if [ "$RUN_BIG_BENCHMARK" = "true" ]; then
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- NodeJS:
- CHANGED: Use node-api instead of NAN. [#6452](https://github.com/Project-OSRM/osrm-backend/pull/6452)
- Misc:
- CHANGED: Migrate to Conan 2.x. [#7042](https://github.com/Project-OSRM/osrm-backend/pull/7042)
- CHANGED: Use thread_local instead of boost::thread_specific_ptr. [#6991](https://github.com/Project-OSRM/osrm-backend/pull/6991)
- CHANGED: Bump flatbuffers to v24.3.25 version. [#6988](https://github.com/Project-OSRM/osrm-backend/pull/6988)
- CHANGED: Add .reserve(...) to assembleGeometry function. [#6983](https://github.com/Project-OSRM/osrm-backend/pull/6983)
Expand Down
189 changes: 83 additions & 106 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,29 @@ option(ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF)
option(ENABLE_CLANG_TIDY "Enables clang-tidy checks" OFF)


if (ENABLE_CONAN)
message(STATUS "Installing Conan packages. It may take a while...")
find_program(CONAN_EXECUTABLE NAMES conan)

if (NOT CONAN_EXECUTABLE)
message(FATAL_ERROR "Conan not found! Please install Conan 2.x and try again.")
else()
set(CMAKE_TOOLCHAIN_FILE "./conan_toolchain.cmake")

execute_process(
COMMAND ${CONAN_EXECUTABLE} install .. --output-folder=. --build=missing --settings compiler.cppstd=20 --settings build_type=${CMAKE_BUILD_TYPE}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
OUTPUT_VARIABLE conan_stdout
ERROR_VARIABLE conan_stderr
RESULT_VARIABLE conan_install_result
)

if (NOT conan_install_result EQUAL 0)
message(FATAL_ERROR "Conan install failed: ${conan_install_result}. Stderr: ${conan_stderr}. Stdout: ${conan_stdout}")
endif()
endif()
endif()

if (ENABLE_CLANG_TIDY)
find_program(CLANG_TIDY_COMMAND NAMES clang-tidy)
if(NOT CLANG_TIDY_COMMAND)
Expand Down Expand Up @@ -321,116 +344,75 @@ if (MSVC)
add_definitions(-DBOOST_ALL_NO_LIB)
endif()

if(ENABLE_CONAN)
message(STATUS "Installing dependencies via Conan")

# Conan will generate Find*.cmake files to build directory, so we use them with the highest priority
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_BINARY_DIR})
list(INSERT CMAKE_PREFIX_PATH 0 ${CMAKE_BINARY_DIR})

include(${CMAKE_CURRENT_LIST_DIR}/cmake/conan.cmake)

conan_check(REQUIRED)
if (ENABLE_CONAN)
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
find_package(TBB REQUIRED)
find_package(EXPAT REQUIRED)
find_package(BZip2 REQUIRED)
find_package(Lua 5.2 REQUIRED)

set(CONAN_BOOST_VERSION "1.85.0@#14265ec82b25d91305bbb3b30d3357f8")
set(CONAN_BZIP2_VERSION "1.0.8@#d1b2d5816f25865acf978501dff1f897")
set(CONAN_EXPAT_VERSION "2.6.2@#2d385d0d50eb5561006a7ff9e356656b")
set(CONAN_LUA_VERSION "5.4.6@#658d6089093cf01992c2737ab2e96763")
set(CONAN_TBB_VERSION "2021.12.0@#e56e5b44be8d690530585dd3634c0106")
add_dependency_includes(${Boost_INCLUDE_DIRS})

set(CONAN_SYSTEM_INCLUDES ON)
set(BOOST_BASE_LIBRARIES ${Boost_LIBRARIES})
set(BOOST_ENGINE_LIBRARIES ${Boost_LIBRARIES})

add_dependency_includes(${TBB_INCLUDE_DIR})
set(TBB_LIBRARIES ${TBB_LIBRARIES})

set(CONAN_ARGS
REQUIRES
"boost/${CONAN_BOOST_VERSION}"
"bzip2/${CONAN_BZIP2_VERSION}"
"expat/${CONAN_EXPAT_VERSION}"
"lua/${CONAN_LUA_VERSION}"
"onetbb/${CONAN_TBB_VERSION}"
BASIC_SETUP
GENERATORS cmake_find_package json # json generator generates a conanbuildinfo.json in the build folder so (non-CMake) projects can easily parse OSRM's dependencies
KEEP_RPATHS
NO_OUTPUT_DIRS
OPTIONS boost:without_stacktrace=True # Apple Silicon cross-compilation fails without it
BUILD missing
)
add_dependency_includes(${expat_INCLUDE_DIRS})
set(EXPAT_LIBRARIES ${expat_LIBRARIES})
set(EXPAT_INCLUDE_DIRS ${expat_INCLUDE_DIRS})

# Enable revisions in the conan config
execute_process(COMMAND ${CONAN_CMD} config set general.revisions_enabled=1 RESULT_VARIABLE RET_CODE)
if(NOT "${RET_CODE}" STREQUAL "0")
message(FATAL_ERROR "Error setting revisions for Conan: '${RET_CODE}'")
endif()
add_dependency_includes(${BZIP2_INCLUDE_DIR})

# explicitly say Conan to use x86 dependencies if build for x86 platforms (https://github.com/conan-io/cmake-conan/issues/141)
if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
conan_cmake_run("${CONAN_ARGS};ARCH;x86")
# cross-compilation for Apple Silicon
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
conan_cmake_run("${CONAN_ARGS};ARCH;armv8")
else()
conan_cmake_run("${CONAN_ARGS}")
set(LUA_LIBRARIES lua::lua)
if (LUA_FOUND)
message(STATUS "Using Lua ${LUA_VERSION_STRING}")
endif()

add_dependency_includes(${CONAN_INCLUDE_DIRS_BOOST})
add_dependency_includes(${CONAN_INCLUDE_DIRS_BZIP2})
add_dependency_includes(${CONAN_INCLUDE_DIRS_EXPAT})
add_dependency_includes(${CONAN_INCLUDE_DIRS_LUA})
add_dependency_includes(${CONAN_INCLUDE_DIRS_TBB})

set(Boost_USE_STATIC_LIBS ON)
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
set(Boost_DATE_TIME_LIBRARY "${Boost_date_time_LIB_TARGETS}")
set(Boost_PROGRAM_OPTIONS_LIBRARY "${Boost_program_options_LIB_TARGETS}")
set(Boost_IOSTREAMS_LIBRARY "${Boost_iostreams_LIB_TARGETS}")
set(Boost_THREAD_LIBRARY "${Boost_thread_LIB_TARGETS}")
set(Boost_ZLIB_LIBRARY "${Boost_zlib_LIB_TARGETS}")
set(Boost_UNIT_TEST_FRAMEWORK_LIBRARY "${Boost_unit_test_framework_LIB_TARGETS}")


find_package(BZip2 REQUIRED)
find_package(EXPAT REQUIRED)
find_package(lua REQUIRED)
set(LUA_LIBRARIES ${lua_LIBRARIES})

find_package(TBB REQUIRED)

add_dependency_includes(${lua_INCLUDE_DIRS})

# note: we avoid calling find_package(Osmium ...) here to ensure that the
# expat and bzip2 are used from conan rather than the system
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include)
else()
find_package(Boost 1.70 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
add_dependency_includes(${Boost_INCLUDE_DIRS})

else()
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
find_package(TBB REQUIRED)
add_dependency_includes(${TBB_INCLUDE_DIR})
set(TBB_LIBRARIES TBB::tbb)

find_package(EXPAT REQUIRED)
add_dependency_includes(${EXPAT_INCLUDE_DIRS})

find_package(BZip2 REQUIRED)
add_dependency_includes(${BZIP2_INCLUDE_DIR})

find_package(Lua 5.2 REQUIRED)
if (LUA_FOUND)
message(STATUS "Using Lua ${LUA_VERSION_STRING}")
endif()

add_dependency_includes(${Boost_INCLUDE_DIRS})
add_dependency_includes(${TBB_INCLUDE_DIR})
add_dependency_includes(${EXPAT_INCLUDE_DIRS})
add_dependency_includes(${BZIP2_INCLUDE_DIR})
add_dependency_includes(${LUA_INCLUDE_DIR})

set(TBB_LIBRARIES TBB::tbb)

set(BOOST_BASE_LIBRARIES
${Boost_DATE_TIME_LIBRARY}
${Boost_IOSTREAMS_LIBRARY}
${Boost_THREAD_LIBRARY})

set(BOOST_ENGINE_LIBRARIES
${Boost_ZLIB_LIBRARY}
${Boost_REGEX_LIBRARY}
${BOOST_BASE_LIBRARIES})

# add a target to generate API documentation with Doxygen
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif()

# note libosmium depends on expat and bzip2
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake")
if(NOT OSMIUM_INCLUDE_DIR)
Expand All @@ -440,6 +422,8 @@ else()
include_directories(SYSTEM ${OSMIUM_INCLUDE_DIR})
endif()



# prefix compilation with ccache by default if available and on clang or gcc
if(ENABLE_CCACHE AND (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU"))
find_program(CCACHE_FOUND ccache)
Expand All @@ -454,6 +438,7 @@ endif()
# to ensure that osrm binaries play well with other binaries like nodejs
find_package(ZLIB REQUIRED)
add_dependency_includes(${ZLIB_INCLUDE_DIRS})
set(ZLIB_LIBRARY ${ZLIB_LIBRARIES})

add_dependency_defines(-DBOOST_SPIRIT_USE_PHOENIX_V3)
add_dependency_defines(-DBOOST_RESULT_OF_USE_DECLTYPE)
Expand All @@ -464,15 +449,6 @@ add_dependency_defines(-DBOOST_PHOENIX_STL_TUPLE_H_)
add_definitions(${OSRM_DEFINES})
include_directories(SYSTEM ${DEPENDENCIES_INCLUDE_DIRS})

set(BOOST_BASE_LIBRARIES
${Boost_DATE_TIME_LIBRARY}
${Boost_IOSTREAMS_LIBRARY}
${Boost_THREAD_LIBRARY})

set(BOOST_ENGINE_LIBRARIES
${Boost_ZLIB_LIBRARY}
${Boost_REGEX_LIBRARY}
${BOOST_BASE_LIBRARIES})

# Binaries
target_link_libraries(osrm-datastore osrm_store ${Boost_PROGRAM_OPTIONS_LIBRARY})
Expand Down Expand Up @@ -505,10 +481,10 @@ set(PARTITIONER_LIBRARIES
${CMAKE_THREAD_LIBS_INIT}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}
${MAYBE_COVERAGE_LIBRARIES}
${ZLIB_LIBRARY})
${MAYBE_COVERAGE_LIBRARIES})
set(CUSTOMIZER_LIBRARIES
${BOOST_ENGINE_LIBRARIES}
${ZLIB_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
${TBB_LIBRARIES}
${MAYBE_RT_LIBRARY}
Expand Down Expand Up @@ -676,16 +652,17 @@ list(APPEND DEPENDENCIES_INCLUDE_DIRS "${PKGCONFIG_INCLUDE_DIR}")
list(APPEND DEPENDENCIES_INCLUDE_DIRS "${PKGCONFIG_INCLUDE_DIR}/osrm")
JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS)

# Boost uses imported targets, we need to use a generator expression to extract
# the link libraries to be written to the pkg-config file.
# Conan & TBB define dependencies as CMake targets too, that's why we do the same for them.
foreach(engine_lib ${ENGINE_LIBRARIES})
if("${engine_lib}" MATCHES "^Boost.*" OR "${engine_lib}" MATCHES "^CONAN_LIB.*" OR "${engine_lib}" MATCHES "^TBB.*")
list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "$<TARGET_LINKER_FILE:${engine_lib}>")
else()
list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}")
endif()
endforeach(engine_lib)

if (NOT ENABLE_CONAN)
foreach(engine_lib ${ENGINE_LIBRARIES})
if("${engine_lib}" MATCHES "^boost.*" OR "${engine_lib}" MATCHES "^TBB.*")
list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "$<TARGET_LINKER_FILE:${engine_lib}>")
else()
list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}")
endif()
endforeach(engine_lib)
endif()

JOIN("${PKGCONFIG_DEPENDENT_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in pkgconfig.configured @ONLY)
Expand Down
Loading
Loading