diff --git a/CMakeLists.txt b/CMakeLists.txt index fceb4a105..56eadf738 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,10 @@ add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_USE_QSTRINGBUILDER -DQT_NO_CAS # Mandatory: Qt5 set(QT_MIN_VERSION "5.8.0") -find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Widgets Network Sql QuickWidgets PrintSupport WebEngineWidgets WebChannel Test) +find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Widgets Network Sql QuickWidgets PrintSupport WebEngineWidgets WebChannel) +if (BUILD_TESTING) + find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Test) +endif() if (NOT DISABLE_DBUS) find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus) endif() @@ -138,6 +141,9 @@ include_directories( # Finally, go into the subdirs add_subdirectory(src) -add_subdirectory(tests/autotests) + +if (BUILD_TESTING) + add_subdirectory(autotests) +endif() feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/tests/autotests/CMakeLists.txt b/autotests/CMakeLists.txt similarity index 100% rename from tests/autotests/CMakeLists.txt rename to autotests/CMakeLists.txt diff --git a/tests/autotests/adblocktest.cpp b/autotests/adblocktest.cpp similarity index 100% rename from tests/autotests/adblocktest.cpp rename to autotests/adblocktest.cpp diff --git a/tests/autotests/adblocktest.h b/autotests/adblocktest.h similarity index 100% rename from tests/autotests/adblocktest.h rename to autotests/adblocktest.h diff --git a/tests/autotests/cookiestest.cpp b/autotests/cookiestest.cpp similarity index 100% rename from tests/autotests/cookiestest.cpp rename to autotests/cookiestest.cpp diff --git a/tests/autotests/cookiestest.h b/autotests/cookiestest.h similarity index 100% rename from tests/autotests/cookiestest.h rename to autotests/cookiestest.h diff --git a/tests/autotests/formcompletertest.cpp b/autotests/formcompletertest.cpp similarity index 100% rename from tests/autotests/formcompletertest.cpp rename to autotests/formcompletertest.cpp diff --git a/tests/autotests/formcompletertest.h b/autotests/formcompletertest.h similarity index 100% rename from tests/autotests/formcompletertest.h rename to autotests/formcompletertest.h diff --git a/tests/autotests/main.cpp b/autotests/main.cpp similarity index 100% rename from tests/autotests/main.cpp rename to autotests/main.cpp diff --git a/tests/autotests/passwordbackendtest.cpp b/autotests/passwordbackendtest.cpp similarity index 100% rename from tests/autotests/passwordbackendtest.cpp rename to autotests/passwordbackendtest.cpp diff --git a/tests/autotests/passwordbackendtest.h b/autotests/passwordbackendtest.h similarity index 100% rename from tests/autotests/passwordbackendtest.h rename to autotests/passwordbackendtest.h diff --git a/tests/autotests/qztoolstest.cpp b/autotests/qztoolstest.cpp similarity index 100% rename from tests/autotests/qztoolstest.cpp rename to autotests/qztoolstest.cpp diff --git a/tests/autotests/qztoolstest.h b/autotests/qztoolstest.h similarity index 100% rename from tests/autotests/qztoolstest.h rename to autotests/qztoolstest.h diff --git a/tests/autotests/updatertest.cpp b/autotests/updatertest.cpp similarity index 100% rename from tests/autotests/updatertest.cpp rename to autotests/updatertest.cpp diff --git a/tests/autotests/updatertest.h b/autotests/updatertest.h similarity index 100% rename from tests/autotests/updatertest.h rename to autotests/updatertest.h