Skip to content

Commit 878a0e1

Browse files
author
Grok Compression
committed
build: only build testing if tests folder exists and contains CMakeLists.txt
1 parent 7071e23 commit 878a0e1

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

CMakeLists.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,14 @@ endif()
255255

256256
# Build Testing
257257
option(BUILD_TESTING "Build tests." OFF)
258-
if(BUILD_TESTING AND GRK_BUILD_CODEC)
259-
enable_testing()
260-
include(CTest)
261-
find_path(GRK_DATA_ROOT README-GROK-TEST-DATA
262-
PATHS $ENV{GRK_DATA_ROOT} ${CMAKE_SOURCE_DIR}/../grok-test-data
263-
NO_CMAKE_FIND_ROOT_PATH)
264-
add_subdirectory(tests)
265-
set(GRK_BUILD_CORE_EXAMPLES ON CACHE BOOL "Build core examples" FORCE)
258+
if(BUILD_TESTING AND GRK_BUILD_CODEC AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt")
259+
enable_testing()
260+
include(CTest)
261+
find_path(GRK_DATA_ROOT README-GROK-TEST-DATA
262+
PATHS $ENV{GRK_DATA_ROOT} ${CMAKE_SOURCE_DIR}/../grok-test-data
263+
NO_CMAKE_FIND_ROOT_PATH)
264+
add_subdirectory(tests)
265+
set(GRK_BUILD_CORE_EXAMPLES ON CACHE BOOL "Build core examples" FORCE)
266266
endif()
267267

268268
# install all targets referenced as GrokTargets

0 commit comments

Comments
 (0)