diff --git a/CMakeLists.txt b/CMakeLists.txt index 265fd5772..8f5a246e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,7 +79,7 @@ endif() # 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) +find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Widgets Network Sql QuickWidgets PrintSupport WebEngineWidgets WebChannel Test) if (NOT DISABLE_DBUS) find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus) endif() @@ -114,6 +114,34 @@ if (EXISTS "${CMAKE_SOURCE_DIR}/.git") endif() endif() -# Finally, go into the src subdir -add_subdirectory(src) +# Include dirs used everywhere +include_directories( + ${CMAKE_SOURCE_DIR}/src/lib/3rdparty + ${CMAKE_SOURCE_DIR}/src/lib/adblock + ${CMAKE_SOURCE_DIR}/src/lib/app + ${CMAKE_SOURCE_DIR}/src/lib/autofill + ${CMAKE_SOURCE_DIR}/src/lib/bookmarks + ${CMAKE_SOURCE_DIR}/src/lib/cookies + ${CMAKE_SOURCE_DIR}/src/lib/downloads + ${CMAKE_SOURCE_DIR}/src/lib/history + ${CMAKE_SOURCE_DIR}/src/lib/navigation + ${CMAKE_SOURCE_DIR}/src/lib/network + ${CMAKE_SOURCE_DIR}/src/lib/notifications + ${CMAKE_SOURCE_DIR}/src/lib/opensearch + ${CMAKE_SOURCE_DIR}/src/lib/other + ${CMAKE_SOURCE_DIR}/src/lib/plugins + ${CMAKE_SOURCE_DIR}/src/lib/popupwindow + ${CMAKE_SOURCE_DIR}/src/lib/preferences + ${CMAKE_SOURCE_DIR}/src/lib/rss + ${CMAKE_SOURCE_DIR}/src/lib/session + ${CMAKE_SOURCE_DIR}/src/lib/sidebar + ${CMAKE_SOURCE_DIR}/src/lib/tabwidget + ${CMAKE_SOURCE_DIR}/src/lib/tools + ${CMAKE_SOURCE_DIR}/src/lib/webengine + ${CMAKE_SOURCE_DIR}/src/lib/webtab +) + +# Finally, go into the subdirs +add_subdirectory(src) +add_subdirectory(tests/autotests) diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index a505fda4c..be8ba44a1 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -1,29 +1,3 @@ -include_directories( - ${CMAKE_SOURCE_DIR}/src/lib/3rdparty - ${CMAKE_SOURCE_DIR}/src/lib/adblock - ${CMAKE_SOURCE_DIR}/src/lib/app - ${CMAKE_SOURCE_DIR}/src/lib/autofill - ${CMAKE_SOURCE_DIR}/src/lib/bookmarks - ${CMAKE_SOURCE_DIR}/src/lib/cookies - ${CMAKE_SOURCE_DIR}/src/lib/downloads - ${CMAKE_SOURCE_DIR}/src/lib/history - ${CMAKE_SOURCE_DIR}/src/lib/navigation - ${CMAKE_SOURCE_DIR}/src/lib/network - ${CMAKE_SOURCE_DIR}/src/lib/notifications - ${CMAKE_SOURCE_DIR}/src/lib/opensearch - ${CMAKE_SOURCE_DIR}/src/lib/other - ${CMAKE_SOURCE_DIR}/src/lib/plugins - ${CMAKE_SOURCE_DIR}/src/lib/popupwindow - ${CMAKE_SOURCE_DIR}/src/lib/preferences - ${CMAKE_SOURCE_DIR}/src/lib/rss - ${CMAKE_SOURCE_DIR}/src/lib/session - ${CMAKE_SOURCE_DIR}/src/lib/sidebar - ${CMAKE_SOURCE_DIR}/src/lib/tabwidget - ${CMAKE_SOURCE_DIR}/src/lib/tools - ${CMAKE_SOURCE_DIR}/src/lib/webengine - ${CMAKE_SOURCE_DIR}/src/lib/webtab -) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/plugins") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/plugins") diff --git a/tests/autotests/CMakeLists.txt b/tests/autotests/CMakeLists.txt new file mode 100644 index 000000000..b5f4bfe47 --- /dev/null +++ b/tests/autotests/CMakeLists.txt @@ -0,0 +1,24 @@ +set(autotests_EXTRA_LIBS ) + +if (KDE_INTEGRATION AND KF5Wallet_FOUND) + add_definitions(-DHAVE_KDE_PASSWORDS_PLUGIN) + set(autotests_EXTRA_LIBS ${autotests_EXTRA_LIBS} ${CMAKE_BINARY_DIR}/bin/plugins/libKWalletPasswords.so) +endif() + +if (GNOME_INTEGRATION AND GNOME_KEYRING_FOUND) + add_definitions(-DHAVE_GNOME_PASSWORDS_PLUGIN) + set(autotests_EXTRA_LIBS ${autotests_EXTRA_LIBS} ${CMAKE_BINARY_DIR}/bin/plugins/libGnomeKeyringPasswords.so) +endif() + +set( autotests_SRCS + qztoolstest.cpp + main.cpp + cookiestest.cpp + adblocktest.cpp + updatertest.cpp + passwordbackendtest.cpp + ) + +add_executable(autotests ${autotests_SRCS}) +target_link_libraries(autotests FalkonPrivate Qt5::Test) +