ports/graphics/libopendrive/files/patch-CMakeLists.txt
Po-Chuan Hsieh 31b89bbc37
graphics/libopendrive: Update to newer snapshot (82c2dd9)
- Bump PORTREVISION for package change
2025-07-04 17:05:28 +08:00

63 lines
1.8 KiB
Plaintext

--- CMakeLists.txt.orig 2025-07-04 08:27:24 UTC
+++ CMakeLists.txt
@@ -20,22 +20,10 @@ include(CTest)
endif()
include(CTest)
-include(FetchContent)
include(GNUInstallDirs)
-FetchContent_Declare(
- pugixml
- GIT_REPOSITORY https://github.com/zeux/pugixml.git
- GIT_TAG v1.14
-)
-FetchContent_MakeAvailable(pugixml)
-
-FetchContent_Declare(
- Catch2
- GIT_REPOSITORY https://github.com/catchorg/Catch2.git
- GIT_TAG v3.4.0
-)
-FetchContent_MakeAvailable(Catch2)
+find_package(pugixml 1.14 REQUIRED)
+find_package(Catch2 3.4.0 REQUIRED)
include(Catch)
set(SOURCES
@@ -59,19 +47,18 @@ set(SOURCES
src/RoadObject.cpp
src/RoadSignal.cpp
src/RoutingGraph.cpp
- ${pugixml_SOURCE_DIR}/src/pugixml.cpp
)
add_library(OpenDrive ${SOURCES})
target_include_directories(
OpenDrive PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/pugixml>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
- $<BUILD_INTERFACE:${pugixml_SOURCE_DIR}/src>
)
add_executable(tests tests/test.cpp)
-target_link_libraries(tests PRIVATE OpenDrive Catch2::Catch2WithMain)
+target_link_libraries(tests PRIVATE OpenDrive pugixml::pugixml Catch2::Catch2WithMain)
catch_discover_tests(tests WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tests)
install(
@@ -80,12 +67,6 @@ install(
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
-)
-install(
- FILES
- ${pugixml_SOURCE_DIR}/src/pugixml.hpp
- ${pugixml_SOURCE_DIR}/src/pugiconfig.hpp
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(TARGETS OpenDrive EXPORT OpenDriveConfig)