These libraries have no dependencies on UTIL, so it's better to omit it. However, then the test is missing symbols for the config (which likely, indirectly came through UTIL -> LOG -> CONFIG_LIB, so add it now onto the test.
19 lines
589 B
CMake
19 lines
589 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 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 yaml-cpp::yaml-cpp)
|
|
set_target_properties(params_yaml PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|