Skip to content

Commit

Permalink
Update yaml-cpp installation on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
boxanm committed Nov 25, 2023
1 parent ff2ffb6 commit 965df31
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions doc/CompilationMac.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ 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
```
Instead, you can install the library from sources. Follow https://github.com/jbeder/yaml-cpp/tree/master
```bash
mkdir ~/Libraries/
cd ~/Libraries
git clone [email protected]:jbeder/yaml-cpp.git
git clone -b yaml-cpp-0.7.0 [email protected]:jbeder/yaml-cpp.git
cd yaml-cpp
```
Now you can compile and install yaml-cpp by entering the following commands
Expand All @@ -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
```
Expand Down

0 comments on commit 965df31

Please sign in to comment.