diff --git a/CMakeLists.txt b/CMakeLists.txt index 23e71c6..c13277f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED True) # Enable "compile_commands.json" output for use with various tools set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -# Add the Catch2 library -find_package(yaml-cpp REQUIRED) find_package(Lua 5.1 REQUIRED) # Add all source files to a single target @@ -31,11 +29,6 @@ target_include_directories(test_cl PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include $ # Enable testing enable_testing() -# Add the tests to the test suite -include(Catch) -catch_discover_tests(test_cl) -add_test(NAME TestCl COMMAND test_cl) - include(FetchContent) FetchContent_Declare( tmuxub @@ -50,3 +43,16 @@ FetchContent_Declare( GIT_TAG origin/devel ) FetchContent_MakeAvailable(Catch2) + +FetchContent_Declare( + yaml-cpp + GIT_REPOSITORY https://github.com/jbeder/yaml-cpp.git + GIT_TAG origin/master +) +FetchContent_MakeAvailable(yaml-cpp) + +# Add the tests to the test suite +include(Catch) +catch_discover_tests(test_cl) +add_test(NAME TestCl COMMAND test_cl) +