From fabf1080b62a54c7ec2dc6da7709186c80cb20cd Mon Sep 17 00:00:00 2001 From: aqua Date: Fri, 26 Apr 2024 22:24:19 +0300 Subject: Added cmakelists --- lib/bookmarks/CMakeLists.txt | 9 +++++++++ lib/bookmarks/meson.build | 16 ---------------- lib/configuration/CMakeLists.txt | 6 ++++++ lib/downloads/CMakeLists.txt | 8 ++++++++ lib/downloads/meson.build | 19 ------------------- lib/pluginloader/CMakeLists.txt | 0 lib/session_formats/CMakeLists.txt | 5 +++++ lib/urlfilter/CMakeLists.txt | 27 +++++++++++++++++++++++++++ lib/urlfilter/meson.build | 26 -------------------------- 9 files changed, 55 insertions(+), 61 deletions(-) create mode 100644 lib/bookmarks/CMakeLists.txt delete mode 100644 lib/bookmarks/meson.build create mode 100644 lib/configuration/CMakeLists.txt create mode 100644 lib/downloads/CMakeLists.txt delete mode 100644 lib/downloads/meson.build create mode 100644 lib/pluginloader/CMakeLists.txt create mode 100644 lib/session_formats/CMakeLists.txt create mode 100644 lib/urlfilter/CMakeLists.txt delete mode 100644 lib/urlfilter/meson.build (limited to 'lib') diff --git a/lib/bookmarks/CMakeLists.txt b/lib/bookmarks/CMakeLists.txt new file mode 100644 index 0000000..d4bd3c7 --- /dev/null +++ b/lib/bookmarks/CMakeLists.txt @@ -0,0 +1,9 @@ +add_library(bookmarks STATIC + bookmarkformat.cpp bookmarkformat.h + bookmarkitem.cpp bookmarkitem.h + bookmarkmodel.cpp bookmarkmodel.h + formats/xbel.cpp formats/xbel.h + formats/ffjson.cpp formats/ffjson.h +) +target_link_libraries(bookmarks PUBLIC Qt6::Widgets) +target_include_directories(bookmarks PUBLIC ${CMAKE_CURRENT_LIST_DIR}) diff --git a/lib/bookmarks/meson.build b/lib/bookmarks/meson.build deleted file mode 100644 index 81c1ece..0000000 --- a/lib/bookmarks/meson.build +++ /dev/null @@ -1,16 +0,0 @@ -bookmarks_moc = mod_qt5.preprocess( - moc_headers: [ 'bookmarkmodel.h' ], - dependencies: dep_qt5 -) - -bookmarks_lib = static_library('bookmarks', - [ bookmarks_moc, - 'bookmarkformat.cpp', 'formats/xbel.cpp', 'formats/ffjson.cpp', - 'bookmarkitem.cpp', 'bookmarkmodel.cpp' ], - dependencies: dep_qt5 -) - -dep_bookmarks = declare_dependency( - include_directories: include_directories('.'), - link_with: bookmarks_lib -) diff --git a/lib/configuration/CMakeLists.txt b/lib/configuration/CMakeLists.txt new file mode 100644 index 0000000..9e2f34e --- /dev/null +++ b/lib/configuration/CMakeLists.txt @@ -0,0 +1,6 @@ +add_library(configuration STATIC + configuration.cpp configuration.h + qt_specialization.cpp qt_specialization.h +) +target_link_libraries(configuration PUBLIC Qt6::Gui) +target_include_directories(configuration PUBLIC ${CMAKE_CURRENT_LIST_DIR}) diff --git a/lib/downloads/CMakeLists.txt b/lib/downloads/CMakeLists.txt new file mode 100644 index 0000000..b310e3a --- /dev/null +++ b/lib/downloads/CMakeLists.txt @@ -0,0 +1,8 @@ +add_library(downloads STATIC + downloadsform.ui + downloadswidget.cpp downloadswidget.h + widgets/downloaditemform.ui widgets/downloaditemwidget.cpp widgets/downloaditemwidget.h + widgets/elidedlabel.cpp widgets/elidedlabel.h +) +target_link_libraries(downloads PUBLIC Qt6::Widgets Qt6::WebEngineWidgets) +target_include_directories(downloads PUBLIC ${CMAKE_CURRENT_LIST_DIR}) diff --git a/lib/downloads/meson.build b/lib/downloads/meson.build deleted file mode 100644 index 9b86391..0000000 --- a/lib/downloads/meson.build +++ /dev/null @@ -1,19 +0,0 @@ -downloads_inc = include_directories('.') -downloads_moc = mod_qt5.preprocess( - moc_headers: ['downloadswidget.h', 'widgets/downloaditemwidget.h', 'widgets/elidedlabel.h'], - ui_files: ['downloadsform.ui', 'widgets/downloaditemform.ui'], - dependencies: dep_qt5 -) - -downloads_lib = static_library('downloads', - ['downloadswidget.cpp', downloads_moc, - 'widgets/downloaditemwidget.cpp', 'widgets/elidedlabel.cpp'], - dependencies: dep_qt5 -) - -dep_downloads = declare_dependency( - include_directories: downloads_inc, - link_with: downloads_lib, - sources: ['downloadswidget.cpp', downloads_moc, - 'widgets/downloaditemwidget.cpp', 'widgets/elidedlabel.cpp'] -) diff --git a/lib/pluginloader/CMakeLists.txt b/lib/pluginloader/CMakeLists.txt new file mode 100644 index 0000000..e69de29 diff --git a/lib/session_formats/CMakeLists.txt b/lib/session_formats/CMakeLists.txt new file mode 100644 index 0000000..c043559 --- /dev/null +++ b/lib/session_formats/CMakeLists.txt @@ -0,0 +1,5 @@ +add_library(session_formats STATIC + session_json.cpp session_json.hpp +) +target_link_libraries(session_formats PUBLIC Qt6::Core) +target_include_directories(session_formats PUBLIC ${CMAKE_CURRENT_LIST_DIR} ${PROJECT_SOURCE_DIR}/include) diff --git a/lib/urlfilter/CMakeLists.txt b/lib/urlfilter/CMakeLists.txt new file mode 100644 index 0000000..012839d --- /dev/null +++ b/lib/urlfilter/CMakeLists.txt @@ -0,0 +1,27 @@ +add_library(urlfilter STATIC + matcher.h urlfilter.h + adblock/adblocklist.cpp adblock/adblocklist.h + adblock/parser.cpp adblock/parser.h + hostlist/hostlist.cpp hostlist/hostlist.h +) +target_link_libraries(urlfilter PUBLIC Qt6::WebEngineCore) +target_include_directories(urlfilter PUBLIC ${CMAKE_CURRENT_LIST_DIR}) + + +add_executable(test_urlfilter_matcher test/matcher.cpp) +target_link_libraries(test_urlfilter_matcher PUBLIC urlfilter GTest::gtest_main) +gtest_add_tests(TARGET test_urlfilter_matcher + SOURCES test/matcher.cpp + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/test) + +add_executable(test_urlfilter_hostlist test/hostlist.cpp) +target_link_libraries(test_urlfilter_hostlist PUBLIC urlfilter GTest::gtest_main) +gtest_add_tests(TARGET test_urlfilter_hostlist + SOURCES test/hostlist.cpp + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/test) + +add_executable(test_urlfilter_adblock test/adblock.cpp) +target_link_libraries(test_urlfilter_adblock PUBLIC urlfilter GTest::gtest_main) +gtest_add_tests(TARGET test_urlfilter_adblock + SOURCES test/adblock.cpp + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/test) diff --git a/lib/urlfilter/meson.build b/lib/urlfilter/meson.build deleted file mode 100644 index 2591028..0000000 --- a/lib/urlfilter/meson.build +++ /dev/null @@ -1,26 +0,0 @@ -urlfilter_lib = static_library('urlfilter', - ['urlfilter.h', 'matcher.h', - 'hostlist/hostlist.cpp', 'hostlist/hostlist.h', - 'adblock/adblocklist.cpp', 'adblock/adblocklist.h', 'adblock/parser.cpp', 'adblock/parser.h'], - dependencies: dep_qt5 -) - -dep_urlfilter = declare_dependency( - include_directories: include_directories('.'), - link_with: urlfilter_lib -) - -if dep_gtest.found() - test('urlfilter: matcher', - executable('urlfilter-matcher', dependencies: [dep_qt5, dep_gtest, dep_urlfilter], sources: ['test/matcher.cpp']), - workdir: meson.current_source_dir() / 'test' - ) - test('urlfilter: host list', - executable('urlfilter-hostlist', dependencies: [dep_qt5, dep_gtest, dep_urlfilter], sources: ['test/hostlist.cpp']), - workdir: meson.current_source_dir() / 'test' - ) - test('urlfilter: adblock list', - executable('urlfilter-adblocklist', dependencies: [dep_qt5, dep_gtest, dep_urlfilter], sources: ['test/adblock.cpp']), - workdir: meson.current_source_dir() / 'test' - ) -endif -- cgit v1.2.1