diff --git a/tools/EurocDataset/CMakeLists.txt b/tools/EurocDataset/CMakeLists.txt index 4d0f04f1e2..6598decbdc 100644 --- a/tools/EurocDataset/CMakeLists.txt +++ b/tools/EurocDataset/CMakeLists.txt @@ -1,27 +1,31 @@ FIND_PACKAGE(yaml-cpp QUIET) -IF(NOT yaml-cpp_FOUND) +IF(yaml-cpp_FOUND) + # yaml-cpp 0.8.0 uses the wrong target in YAML_CPP_LIBRARIES. + IF(yaml-cpp_VERSION VERSION_EQUAL "0.8.0") + SET(YAML_CPP_LIBRARIES yaml-cpp::yaml-cpp) + ENDIF() +ELSE() find_package(PkgConfig QUIET) IF(PKG_CONFIG_FOUND) pkg_check_modules(yaml_cpp QUIET yaml-cpp) IF(yaml_cpp_FOUND) SET(YAML_CPP_LIBRARIES ${yaml_cpp_LIBRARIES}) - SET(YAML_CPP_INCLUDE_DIRS ${yaml_cpp_INCLUDEDIR}) + SET(YAML_CPP_INCLUDE_DIR ${yaml_cpp_INCLUDEDIR}) SET(yaml-cpp_FOUND ${yaml_cpp_FOUND}) ENDIF(yaml_cpp_FOUND) ENDIF(PKG_CONFIG_FOUND) -ENDIF(NOT yaml-cpp_FOUND) +ENDIF(yaml-cpp_FOUND) IF(yaml-cpp_FOUND) SET(INCLUDE_DIRS - ${YAML_CPP_INCLUDE_DIRS} + ${YAML_CPP_INCLUDE_DIR} ) SET(LIBRARIES ${YAML_CPP_LIBRARIES} - yaml-cpp ) INCLUDE_DIRECTORIES(${INCLUDE_DIRS} yaml-cpp)