Skip to content

Commit c1deffe

Browse files
committed
enable testing only when CMAKE_BUILD_TESTS=ON
The function enable_testing was globally enabled, no matter the value of the CMAKE_BUILD_TESTS option. This patch guards this call, so it only gets called, when CMAKE_BUILD_TESTS=ON. Signed-off-by: Bernd Waibel <[email protected]>
1 parent 9e63393 commit c1deffe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
cmake_minimum_required(VERSION 3.1)
22
project(CTL VERSION 1.5.2)
3-
enable_testing()
43
include(GNUInstallDirs)
54

65
set(CMAKE_MODULE_PATH
@@ -37,11 +36,12 @@ endif()
3736
add_subdirectory(lib)
3837
add_subdirectory(doc)
3938
if (CTL_BUILD_TOOLS)
40-
add_subdirectory(ctlrender)
39+
add_subdirectory(ctlrender)
4140
add_subdirectory(OpenEXR_CTL)
4241
endif()
4342

4443
if (CTL_BUILD_TESTS)
45-
add_subdirectory(unittest)
44+
enable_testing()
45+
add_subdirectory(unittest)
4646
endif()
4747

0 commit comments

Comments
 (0)