2018-10-18 05:36:56 +08:00
|
|
|
include(QtUtils)
|
|
|
|
msvc_registry_search()
|
2020-10-14 08:37:03 +08:00
|
|
|
find_qt5(Core Widgets WebSockets)
|
2018-08-19 12:13:19 +08:00
|
|
|
cmake_policy(SET CMP0037 OLD)
|
2018-08-20 03:26:50 +08:00
|
|
|
|
2019-06-13 16:01:29 +08:00
|
|
|
add_library(Bing\ Translate MODULE bingtranslate.cpp translatewrapper.cpp network.cpp extensionimpl.cpp)
|
2019-06-11 01:58:19 +08:00
|
|
|
add_library(Copy\ to\ Clipboard MODULE copyclipboard.cpp extensionimpl.cpp)
|
2020-03-26 19:41:21 +08:00
|
|
|
add_library(DeepL\ Translate MODULE deepltranslate.cpp translatewrapper.cpp network.cpp extensionimpl.cpp)
|
2021-01-15 21:07:23 +08:00
|
|
|
add_library(DevTools\ DeepL\ Translate MODULE devtoolsdeepltranslate.cpp devtools.cpp translatewrapper.cpp network.cpp extensionimpl.cpp)
|
2019-06-11 01:58:19 +08:00
|
|
|
add_library(Extra\ Newlines MODULE extranewlines.cpp extensionimpl.cpp)
|
|
|
|
add_library(Extra\ Window MODULE extrawindow.cpp extensionimpl.cpp)
|
2019-06-13 16:01:29 +08:00
|
|
|
add_library(Google\ Translate MODULE googletranslate.cpp translatewrapper.cpp network.cpp extensionimpl.cpp)
|
2019-06-11 01:58:19 +08:00
|
|
|
add_library(Lua MODULE lua.cpp extensionimpl.cpp)
|
|
|
|
add_library(Regex\ Filter MODULE regexfilter.cpp extensionimpl.cpp)
|
2019-06-14 01:06:34 +08:00
|
|
|
add_library(Remove\ Repeated\ Characters MODULE removerepeatchar.cpp extensionimpl.cpp)
|
|
|
|
add_library(Remove\ Repeated\ Phrases MODULE removerepeatphrase.cpp extensionimpl.cpp)
|
2019-08-08 02:05:50 +08:00
|
|
|
add_library(Remove\ Repeated\ Phrases\ 2 MODULE removerepeatphrase2.cpp extensionimpl.cpp)
|
2019-06-14 01:06:34 +08:00
|
|
|
add_library(Remove\ 30\ Repeated\ Sentences MODULE removerepeatsentence.cpp extensionimpl.cpp)
|
2019-06-11 01:58:19 +08:00
|
|
|
add_library(Replacer MODULE replacer.cpp extensionimpl.cpp)
|
2021-01-16 00:53:57 +08:00
|
|
|
add_library(Styler MODULE styler.cpp extensionimpl.cpp)
|
2019-06-11 01:58:19 +08:00
|
|
|
add_library(Thread\ Linker MODULE threadlinker.cpp extensionimpl.cpp)
|
2018-08-20 03:26:50 +08:00
|
|
|
|
2020-04-19 09:04:07 +08:00
|
|
|
target_precompile_headers(Bing\ Translate REUSE_FROM pch)
|
|
|
|
target_precompile_headers(Copy\ to\ Clipboard REUSE_FROM pch)
|
|
|
|
target_precompile_headers(DeepL\ Translate REUSE_FROM pch)
|
2021-01-15 21:07:23 +08:00
|
|
|
target_precompile_headers(DevTools\ DeepL\ Translate REUSE_FROM pch)
|
2020-04-19 09:04:07 +08:00
|
|
|
target_precompile_headers(Extra\ Newlines REUSE_FROM pch)
|
|
|
|
target_precompile_headers(Extra\ Window REUSE_FROM pch)
|
|
|
|
target_precompile_headers(Google\ Translate REUSE_FROM pch)
|
|
|
|
target_precompile_headers(Lua REUSE_FROM pch)
|
|
|
|
target_precompile_headers(Regex\ Filter REUSE_FROM pch)
|
|
|
|
target_precompile_headers(Remove\ Repeated\ Characters REUSE_FROM pch)
|
|
|
|
target_precompile_headers(Remove\ Repeated\ Phrases REUSE_FROM pch)
|
|
|
|
target_precompile_headers(Remove\ Repeated\ Phrases\ 2 REUSE_FROM pch)
|
|
|
|
target_precompile_headers(Remove\ 30\ Repeated\ Sentences REUSE_FROM pch)
|
|
|
|
target_precompile_headers(Replacer REUSE_FROM pch)
|
2021-01-16 00:53:57 +08:00
|
|
|
target_precompile_headers(Styler REUSE_FROM pch)
|
2020-04-19 09:04:07 +08:00
|
|
|
target_precompile_headers(Thread\ Linker REUSE_FROM pch)
|
|
|
|
|
2018-11-04 11:26:27 +08:00
|
|
|
target_link_libraries(Bing\ Translate winhttp Qt5::Widgets)
|
2020-03-26 19:41:21 +08:00
|
|
|
target_link_libraries(DeepL\ Translate winhttp Qt5::Widgets)
|
2021-01-15 21:07:23 +08:00
|
|
|
target_link_libraries(DevTools\ DeepL\ Translate shell32 winhttp Qt5::Widgets Qt5::WebSockets)
|
2018-12-22 04:11:12 +08:00
|
|
|
target_link_libraries(Extra\ Window Qt5::Widgets)
|
2018-11-04 11:58:52 +08:00
|
|
|
target_link_libraries(Google\ Translate winhttp Qt5::Widgets)
|
2019-02-13 08:54:15 +08:00
|
|
|
target_link_libraries(Lua lua53 Qt5::Widgets)
|
2018-11-04 11:58:52 +08:00
|
|
|
target_link_libraries(Regex\ Filter Qt5::Widgets)
|
2021-01-16 00:53:57 +08:00
|
|
|
target_link_libraries(Styler Qt5::Widgets)
|
2019-01-23 03:35:34 +08:00
|
|
|
target_link_libraries(Thread\ Linker Qt5::Widgets)
|
2020-10-14 08:37:03 +08:00
|
|
|
|
2021-03-10 12:32:56 +08:00
|
|
|
add_custom_target(Cleaner ALL COMMAND del *.xdll WORKING_DIRECTORY ${CMAKE_FINAL_OUTPUT_DIRECTORY})
|
|
|
|
|
2021-01-16 00:32:23 +08:00
|
|
|
if (NOT EXISTS ${CMAKE_FINAL_OUTPUT_DIRECTORY}/Qt5WebSockets.dll AND NOT EXISTS ${CMAKE_FINAL_OUTPUT_DIRECTORY}/Qt5WebSocketsd.dll)
|
|
|
|
add_custom_command(TARGET DevTools\ DeepL\ Translate
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/windeployqt"
|
|
|
|
COMMAND set PATH=%PATH%$<SEMICOLON>${qt5_install_prefix}/bin
|
|
|
|
COMMAND Qt5::windeployqt --dir ${CMAKE_FINAL_OUTPUT_DIRECTORY} "${CMAKE_FINAL_OUTPUT_DIRECTORY}/DevTools\ DeepL\ Translate.dll"
|
|
|
|
)
|
|
|
|
endif()
|