mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-10 05:20:19 +08:00
CMake: Add compatibility for yaml-cpp 0.8.0. (#1115)
- Upstream uses YAML_CPP_INCLUDE_DIR - yaml-cpp 0.8.0 does not set YAML_CPP_LIBRARIES to the new target name. - Debug builds of yaml-cpp suffix the library with `d`.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user