Allow tests to be ignored (#12)
This commit is contained in:
Родитель
51683d39e8
Коммит
9341d49813
|
@ -5,18 +5,21 @@ project(tracelogging)
|
|||
include(GNUInstallDirs)
|
||||
|
||||
add_compile_options(-Wall -Wextra -Werror)
|
||||
set(TRACELOGGING_BUILD_TESTS ON CACHE BOOL "Build tests.")
|
||||
|
||||
# Include source
|
||||
add_subdirectory(src)
|
||||
|
||||
# Only include testing stuff if we are the top level
|
||||
if (${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
|
||||
enable_testing()
|
||||
if(TRACELOGGING_BUILD_TESTS)
|
||||
if (${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
|
||||
enable_testing()
|
||||
|
||||
if (NOT TARGET Catch2::Catch2)
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/external/Catch2/contrib")
|
||||
add_subdirectory(external/Catch2)
|
||||
if (NOT TARGET Catch2::Catch2)
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/external/Catch2/contrib")
|
||||
add_subdirectory(external/Catch2)
|
||||
endif ()
|
||||
|
||||
add_subdirectory(test)
|
||||
endif ()
|
||||
|
||||
add_subdirectory(test)
|
||||
endif ()
|
||||
|
|
Загрузка…
Ссылка в новой задаче