Make it possible to opt out of building tests

This commit is contained in:
Harmen Stoppels
2019-09-05 13:34:24 +02:00
parent 6e33b499a6
commit 06c852e908
3 changed files with 7 additions and 4 deletions
+6 -1
View File
@@ -1,9 +1,14 @@
cmake_minimum_required(VERSION 3.6)
project(linuxdeploy-plugin-qt)
include(CTest)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_subdirectory(lib)
add_subdirectory(src)
add_subdirectory(tests)
if (BUILD_TESTING)
add_subdirectory(tests)
endif()
+1 -1
View File
@@ -1,5 +1,5 @@
add_subdirectory(linuxdeploy EXCLUDE_FROM_ALL)
if(NOT TARGET gtest)
if(NOT TARGET gtest AND BUILD_TESTING)
add_subdirectory(googletest EXCLUDE_FROM_ALL)
endif()
-2
View File
@@ -1,5 +1,3 @@
enable_testing()
add_executable(linuxdeploy-plugin-qt-tests test_main.cpp test_deploy_qml.cpp ../src/qml.cpp)
target_link_libraries(linuxdeploy-plugin-qt-tests linuxdeploy_core args json gtest)
target_compile_definitions(linuxdeploy-plugin-qt-tests PRIVATE TESTS_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}/data")