Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ else()
set(CCR_EXCLUDE_FROM_ALL "EXCLUDE_FROM_ALL")
endif()

option(
CCR_FETCH_DEPS
"Fetch dependencies via FetchContent."
On
)

option(CCR_BUILD_TESTS "Enable building the tests" ${CCR_DEFAULTOPT})

if (CCR_BUILD_TESTS)
Expand All @@ -38,5 +44,15 @@ include(GNUInstallDirs)
include(CTest)
include(GoogleTest)

add_subdirectory(external)
if (CCR_FETCH_DEPS)
add_subdirectory(external)
else()
find_package(CLI11 REQUIRED)
find_package(nlohmann_json REQUIRED)
find_package(GTest REQUIRED)
find_package(pugixml REQUIRED)
find_package(cucumber_messages REQUIRED)
find_package(cucumber_gherkin REQUIRED)
endif()

add_subdirectory(cucumber_cpp)
4 changes: 2 additions & 2 deletions cucumber_cpp/library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ target_include_directories(cucumber_cpp.library PUBLIC
)

target_link_libraries(cucumber_cpp.library PUBLIC
gtest
gmock
GTest::gtest
GTest::gmock
cucumber_gherkin_lib
cucumber_cpp.library.report
cucumber_cpp.library.engine
Expand Down
2 changes: 1 addition & 1 deletion cucumber_cpp/library/report/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ target_include_directories(cucumber_cpp.library.report PUBLIC
)

target_link_libraries(cucumber_cpp.library.report PUBLIC
pugixml
pugixml::pugixml
cucumber_cpp.library
)
6 changes: 3 additions & 3 deletions cucumber_cpp/library/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ add_test(NAME cucumber_cpp.library.test COMMAND cucumber_cpp.library.test)

target_link_libraries(cucumber_cpp.library.test PUBLIC
cucumber_cpp.library
gtest
gmock
gmock_main
GTest::gtest
GTest::gmock
GTest::gmock_main
cucumber_cpp.library.engine.test_helper
cucumber_cpp.library.engine.test_helper.steps
)
Expand Down
Loading