Skip to content

Commit 0310a6b

Browse files
authored
Allow to disable tests through BUILD_TESTING=OFF
1 parent 51e45d2 commit 0310a6b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

CMakeLists.txt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
cmake_minimum_required(VERSION 3.0)
2-
project(linq)
3-
4-
enable_testing()
2+
project(linq CXX)
53

64
find_package(Boost)
75

@@ -37,6 +35,10 @@ install(FILES
3735
install(FILES linq.h DESTINATION include)
3836
install(DIRECTORY linq DESTINATION include)
3937

40-
add_executable(linq-test test.cpp)
41-
target_link_libraries(linq-test linq ${Boost_test_LIBRARY_RELEASE})
42-
add_test(NAME linq-test COMMAND linq-test)
38+
include(CTest)
39+
40+
if (BUILD_TESTING)
41+
add_executable(linq-test test.cpp)
42+
target_link_libraries(linq-test linq ${Boost_test_LIBRARY_RELEASE})
43+
add_test(NAME linq-test COMMAND linq-test)
44+
endif (BUILD_TESTING)

0 commit comments

Comments
 (0)