Skip to content

Commit

Permalink
include CTest only when testing enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
TinyTinni committed Aug 3, 2024
1 parent 746538d commit d0177f5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ jobs:
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON
-DFAIRYCAM_ENABLE_TESTING=ON
${{ matrix.os == 'windows-latest' && '-DOpenCV_DIR="C:/opencv/opencv/build/"' || '' }}

- name: Build
Expand Down
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ target_sources(doctest PUBLIC
add_subdirectory(src/)

# tests
include(CTest)
enable_testing()
if(FAIRYCAM_ENABLE_TESTING)
include(CTest)
enable_testing()

add_subdirectory(tests)

if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" AND NOT APPLE)
add_subdirectory(fuzzer_example)
endif()
Expand Down
1 change: 0 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

find_package(OpenCV REQUIRED)
find_package(Poco REQUIRED Foundation Net)

Expand Down

0 comments on commit d0177f5

Please sign in to comment.