From 6e47834e8a57445866df9e0728c0968df6279043 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Fri, 27 Nov 2020 13:59:31 -0500 Subject: [PATCH] Dep/CMake: Add yaml-cpp support to CMake --- cmake/SearchForStuff.cmake | 13 +++++++++++++ common/src/Utilities/CMakeLists.txt | 1 + 2 files changed, 14 insertions(+) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index e57427f043..5b6896a692 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -268,3 +268,16 @@ if(NOT fmt_FOUND) else() message(STATUS "Found fmt: ${fmt_VERSION}") endif() + +find_package(yaml-cpp "0.6.3" QUIET) +if(NOT yaml-cpp_FOUND) + if(EXISTS "${CMAKE_SOURCE_DIR}/3rdparty/yaml-cpp/yaml-cpp/CMakeLists.txt") + message(STATUS "No system yaml-cpp was found. Using bundled") + add_subdirectory(3rdparty/yaml-cpp/yaml-cpp EXCLUDE_FROM_ALL) + else() + message(FATAL_ERROR "No system or bundled yaml-cpp was found") + endif() +else() + message(STATUS "Found yaml-cpp: ${yaml-cpp_VERSION}") + message(STATUS "Note that the latest release of yaml-cpp is very outdated, and the bundled submodule in the repo has over a year of bug fixes and as such is preferred.") +endif() diff --git a/common/src/Utilities/CMakeLists.txt b/common/src/Utilities/CMakeLists.txt index 21355b8254..98c39948f3 100644 --- a/common/src/Utilities/CMakeLists.txt +++ b/common/src/Utilities/CMakeLists.txt @@ -112,6 +112,7 @@ set(UtilitiesFinalSources set(UtilitiesFinalLibs ${LIBC_LIBRARIES} # Gold (new linux linker) does not get automatically dependency of dependency ${wxWidgets_LIBRARIES} + yaml-cpp ) add_pcsx2_lib(${Output} "${UtilitiesFinalSources}" "${UtilitiesFinalLibs}" "${UtilitiesFinalFlags}")