diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f8d81b685..8041277594 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ * **Removed** * **Bug Fix** * FIXED: `incremental_build_tiles` script works again [#4909](https://github.com/valhalla/valhalla/pull/4909) + * FIXED: Fix ability to use Valhalla via cmake `add_subdirectory` [#4930](https://github.com/valhalla/valhalla/pull/4930) * **Enhancement** ## Release Date: 2024-10-10 Valhalla 3.5.1 diff --git a/CMakeLists.txt b/CMakeLists.txt index 3af4452a73..46064579f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,10 +127,10 @@ find_package(Threads REQUIRED) # resolve vendored libraries set(date_include_dir ${VALHALLA_SOURCE_DIR}/third_party/date/include) -set(rapidjson_include_dir ${CMAKE_SOURCE_DIR}/third_party/rapidjson/include) -set(robinhoodhashing_include_dir ${CMAKE_SOURCE_DIR}/third_party/robin-hood-hashing/src/include) +set(rapidjson_include_dir ${VALHALLA_SOURCE_DIR}/third_party/rapidjson/include) +set(robinhoodhashing_include_dir ${VALHALLA_SOURCE_DIR}/third_party/robin-hood-hashing/src/include) set(cxxopts_include_dir ${VALHALLA_SOURCE_DIR}/third_party/cxxopts/include) -set(dirent_include_dir ${CMAKE_SOURCE_DIR}/third_party/dirent/include) +set(dirent_include_dir ${VALHALLA_SOURCE_DIR}/third_party/dirent/include) if (PREFER_EXTERNAL_DEPS) # date find_package(date QUIET) diff --git a/cmake/ValhallaPkgConfig.cmake b/cmake/ValhallaPkgConfig.cmake index a0483c801a..6bd38190f3 100644 --- a/cmake/ValhallaPkgConfig.cmake +++ b/cmake/ValhallaPkgConfig.cmake @@ -48,7 +48,7 @@ function(configure_valhalla_pc) list(JOIN LIBS_PRIVATE " " LIBS_PRIVATE) configure_file( - ${CMAKE_SOURCE_DIR}/libvalhalla.pc.in - ${CMAKE_BINARY_DIR}/libvalhalla.pc + ${VALHALLA_SOURCE_DIR}/libvalhalla.pc.in + ${VALHALLA_BUILD_DIR}/libvalhalla.pc @ONLY) endfunction()