do not exclude from all, but add option to disable tests

This commit is contained in:
Martin Marmsoler 2022-11-17 09:20:22 +01:00
parent 2bc8c32905
commit d4db08ca72
2 changed files with 6 additions and 2 deletions

View File

@ -56,6 +56,7 @@ option(USE_SYSTEM_QT "Don't copy QT files into the installation directory" OFF)
option(USE_SYSTEM_LUA "Use the system-wide Lua installation" OFF)
option(USE_SYSTEM_HUNSPELL "Use the system-wide hunspell installation" OFF)
option(USE_SYSTEM_CMARK "Use the system-wide cmark installation" OFF)
option(ENABLE_TESTS "Enable Gittyup Unittests" ON)
set(LUA_MODULES_PATH
CACHE
@ -128,4 +129,7 @@ add_subdirectory(dep)
add_subdirectory(src)
add_subdirectory(l10n)
add_subdirectory(pack)
add_subdirectory(test)
if(ENABLE_TESTS)
add_subdirectory(test)
endif()

View File

@ -2,7 +2,7 @@
macro(test)
cmake_parse_arguments(ARG "NO_WIN32_OFFSCREEN" "NAME" "" ${ARGN})
add_executable(test_${ARG_NAME} EXCLUDE_FROM_ALL ${ARG_NAME}.cpp)
add_executable(test_${ARG_NAME} ${ARG_NAME}.cpp)
target_link_libraries(test_${ARG_NAME} testlib)
set_target_properties(test_${ARG_NAME} PROPERTIES OUTPUT_NAME ${ARG_NAME}