Files
openairinterface5g/common/config/yaml/CMakeLists.txt
T
Bartosz Podrygajlo e086334a08 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.
2024-10-28 18:02:34 +01:00

19 lines
599 B
CMake

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::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::yaml-cpp)
set_target_properties(params_yaml PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})