Skip to content

Commit

Permalink
Update CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
acodcha committed Sep 25, 2023
1 parent 766f928 commit 57cd202
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,19 @@ option(
OFF
)

# Download and setup the yaml-cpp library.
include(FetchContent)
FetchContent_Declare(
yaml-cpp
GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git
GIT_TAG master
)
FetchContent_MakeAvailable(yaml-cpp)
message(STATUS "The yaml-cpp library was fetched from: https://github.com/jbeder/yaml-cpp.git")

# Define the main Secret Santa executable.
add_executable(secret-santa ${PROJECT_SOURCE_DIR}/source/Main.cpp)
target_link_libraries(secret-santa PUBLIC stdc++fs)
target_link_libraries(secret-santa PUBLIC stdc++fs yaml-cpp)

# Configure the Secret Santa tests.
if(TEST_SECRET_SANTA)
Expand All @@ -35,7 +45,6 @@ if(TEST_SECRET_SANTA)
message(STATUS "The GoogleTest library was found at: ${GTest_CONFIG}")
else()
# In this case, the GoogleTest library is not found, so fetch it instead.
include(FetchContent)
FetchContent_Declare(
GoogleTest
GIT_REPOSITORY https://github.com/google/googletest.git
Expand Down

0 comments on commit 57cd202

Please sign in to comment.