mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
Merge remote-tracking branch 'origin/yaml-cpp-fix-dependency' into integration_2024_w43 (!3063)
Update yaml-cpp dependency handling - Added CPM fallback in case package is not found automatically. - Using yaml-cpp::yaml-cpp target instead of yaml-cpp to silence deprecation warnings on newer cmake versions.
This commit is contained in:
@@ -32,7 +32,7 @@ set (OPENAIR_DIR ${CMAKE_SOURCE_DIR})
|
||||
|
||||
include("cmake_targets/macros.cmake")
|
||||
if(NOT DEFINED ENV{CPM_SOURCE_CACHE})
|
||||
set(CPM_SOURCE_CACHE ~/.cache/cpm/)
|
||||
set(CPM_SOURCE_CACHE ~/.cache/cpm/ CACHE FILEPATH "Directory to download CPM dependencies")
|
||||
endif()
|
||||
include("cmake_targets/CPM.cmake")
|
||||
|
||||
|
||||
@@ -1,25 +1,18 @@
|
||||
find_package(yaml-cpp REQUIRED PATHS /usr/lib/aarch64-linux-gnu/pkgconfig/)
|
||||
# include(FetchContent)
|
||||
|
||||
# FetchContent_Declare(
|
||||
# yaml-cpp
|
||||
# GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
|
||||
# GIT_TAG 0.8.0
|
||||
# )
|
||||
# FetchContent_GetProperties(yaml-cpp)
|
||||
|
||||
# if(NOT yaml-cpp_POPULATED)
|
||||
# message(STATUS "Fetching yaml-cpp...")
|
||||
# FetchContent_Populate(yaml-cpp)
|
||||
# add_subdirectory(${yaml-cpp_SOURCE_DIR} ${yaml-cpp_BINARY_DIR})
|
||||
# endif()
|
||||
find_package(yaml-cpp)
|
||||
if (NOT yaml-cpp_FOUND)
|
||||
CPMAddPackage("gh:jbeder/yaml-cpp#yaml-cpp-0.7.0@0.7.0")
|
||||
else()
|
||||
if (NOT TARGET yaml-cpp::yaml-cpp)
|
||||
add_library(yaml-cpp::yaml-cpp ALIAS yaml-cpp)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_library(params_yaml_static config_yaml.cpp)
|
||||
target_link_libraries(params_yaml_static PUBLIC UTIL yaml-cpp)
|
||||
target_link_libraries(params_yaml_static PUBLIC UTIL yaml-cpp::yaml-cpp)
|
||||
if (ENABLE_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
add_library(params_yaml MODULE config_yaml.cpp)
|
||||
target_link_libraries(params_yaml PUBLIC UTIL yaml-cpp)
|
||||
target_link_libraries(params_yaml PUBLIC UTIL yaml-cpp::yaml-cpp)
|
||||
set_target_properties(params_yaml PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||
|
||||
Reference in New Issue
Block a user