From 965df316a3128dea0b87549aaffa2a7cebd55eb0 Mon Sep 17 00:00:00 2001 From: boxanm Date: Sat, 25 Nov 2023 11:25:02 -0500 Subject: [PATCH] Update yaml-cpp installation on MacOS --- CMakeLists.txt | 4 +++- doc/CompilationMac.md | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d5813dc..52d2ec06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -216,11 +216,13 @@ endif() #-------------------- message(STATUS "Looking for yaml-cpp on system...") - find_package(yaml-cpp CONFIG REQUIRED) if(TARGET yaml-cpp::yaml-cpp) set(YAML_CPP_LIBRARIES "yaml-cpp::yaml-cpp") endif() +if(YAML_CPP_LIBRARIES STREQUAL "") + set(YAML_CPP_LIBRARIES "yaml-cpp") # Fix linking issue on MacOS with yaml-cpp 0.7.0 +endif () #-------------------- # DEPENDENCY: rt (optional) diff --git a/doc/CompilationMac.md b/doc/CompilationMac.md index 3a8f843a..7f3a631f 100644 --- a/doc/CompilationMac.md +++ b/doc/CompilationMac.md @@ -114,7 +114,7 @@ brew install eigen ### 2. Installing yaml-cpp -The straightforward way to install yaml-cpp library through brew was, as for hte end 2023, not functional +The straightforward way to install yaml-cpp library through brew was, as for the end of 2023, not functional ```bash brew install yaml-cpp ``` @@ -122,7 +122,7 @@ Instead, you can install the library from sources. Follow https://github.com/jbe ```bash mkdir ~/Libraries/ cd ~/Libraries -git clone git@github.com:jbeder/yaml-cpp.git +git clone -b yaml-cpp-0.7.0 git@github.com:jbeder/yaml-cpp.git cd yaml-cpp ``` Now you can compile and install yaml-cpp by entering the following commands @@ -131,7 +131,7 @@ Now you can compile and install yaml-cpp by entering the following commands SRC_DIR=$PWD BUILD_DIR=${SRC_DIR}/build mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR} -cmake .. +cmake -DBUILD_TESTING=FALSE .. make sudo make install ```