From f1fd91ca92602e1ca7caeadc2246dced980646d9 Mon Sep 17 00:00:00 2001 From: overwriter <9856mmm@gmail.com> Date: Sat, 26 Oct 2024 20:01:05 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=B0=83=E6=95=B4=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=9A=84=E7=9B=AE=E5=BD=95=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitmodules | 8 +-- ApiServer/logger.cpp | 4 -- CMakeLists.txt | 49 +++++----------- QCloudMusicApi/CMakeLists.txt | 55 ------------------ Test/logger.cpp | 4 -- {ApiServer => src/ApiServer}/CMakeLists.txt | 42 ++++++-------- {ApiServer => src/ApiServer}/generateconfig.h | 0 src/ApiServer/logger.cpp | 4 ++ {ApiServer => src/ApiServer}/logger.h | 0 {ApiServer => src/ApiServer}/main.cpp | 0 {ApiServer => src/ApiServer}/server.cpp | 0 {ApiServer => src/ApiServer}/server.h | 0 src/CMakeLists.txt | 16 ++++++ src/QCloudMusicApi/CMakeLists.txt | 57 +++++++++++++++++++ .../QCloudMusicApi}/api_c.cpp | 0 .../QCloudMusicApi}/api_c.h | 0 .../QCloudMusicApi}/apihelper.cpp | 0 .../QCloudMusicApi}/apihelper.h | 0 .../QCloudMusicApi}/example/Program.cs | 0 .../example/QCMPlugin/CMakeLists.txt | 0 .../QCloudMusicApi}/example/QCMPlugin/api.cpp | 0 .../QCloudMusicApi}/example/QCMPlugin/api.h | 0 .../example/QCMPlugin/aplugin.cpp | 0 .../example/QCMPlugin/aplugin.h | 0 .../QCloudMusicApi}/example/capi.py | 0 .../QCloudMusicApi}/example/main.rs | 0 .../QCloudMusicApi}/global.h | 0 .../QCloudMusicApi}/module.cpp | 0 .../QCloudMusicApi}/module.h | 0 .../QCloudMusicApi}/openssl-cmake | 0 .../QCloudMusicApi}/plugins.cpp | 0 .../QCloudMusicApi}/plugins.h | 0 .../QCloudMusicApi}/qcloudmusicapiplugin.h | 0 .../QCloudMusicApi}/util/config.h | 0 .../QCloudMusicApi}/util/crypto.cpp | 0 .../QCloudMusicApi}/util/crypto.h | 0 .../QCloudMusicApi}/util/index.cpp | 0 .../QCloudMusicApi}/util/index.h | 0 .../QCloudMusicApi}/util/logger.cpp | 2 +- .../QCloudMusicApi}/util/logger.h | 0 .../QCloudMusicApi}/util/option.cpp | 0 .../QCloudMusicApi}/util/option.h | 0 .../QCloudMusicApi}/util/request.cpp | 0 .../QCloudMusicApi}/util/request.h | 0 {Test => src/Test}/CMakeLists.txt | 56 ++++++++---------- {Test => src/Test}/config.json | 0 {Test => src/Test}/config.qrc | 0 {Test => src/Test}/customwidget/tabaes.cpp | 0 {Test => src/Test}/customwidget/tabaes.h | 0 {Test => src/Test}/customwidget/tabaes.ui | 0 {Test => src/Test}/customwidget/tabapi_c.cpp | 0 {Test => src/Test}/customwidget/tabapi_c.h | 0 {Test => src/Test}/customwidget/tabapi_c.ui | 0 .../Test}/customwidget/tabavatar_upload.cpp | 0 .../Test}/customwidget/tabavatar_upload.h | 0 .../Test}/customwidget/tabavatar_upload.ui | 0 {Test => src/Test}/customwidget/tabcommon.cpp | 0 {Test => src/Test}/customwidget/tabcommon.h | 0 {Test => src/Test}/customwidget/tabcommon.ui | 0 .../Test}/customwidget/tabcommonunit.cpp | 0 .../Test}/customwidget/tabcommonunit.h | 0 .../Test}/customwidget/tabcommonunit.ui | 0 .../Test}/customwidget/tablogin_cellphone.cpp | 0 .../Test}/customwidget/tablogin_cellphone.h | 0 .../Test}/customwidget/tablogin_cellphone.ui | 0 .../Test}/customwidget/tablogin_qr.cpp | 0 {Test => src/Test}/customwidget/tablogin_qr.h | 0 .../Test}/customwidget/tablogin_qr.ui | 0 .../customwidget/tabplaylist_cover_update.cpp | 0 .../customwidget/tabplaylist_cover_update.h | 0 .../customwidget/tabplaylist_cover_update.ui | 0 {Test => src/Test}/customwidget/tabplugin.cpp | 0 {Test => src/Test}/customwidget/tabplugin.h | 0 {Test => src/Test}/customwidget/tabrsa.cpp | 0 {Test => src/Test}/customwidget/tabrsa.h | 0 {Test => src/Test}/customwidget/tabrsa.ui | 0 .../Test}/customwidget/tabservertest.cpp | 0 .../Test}/customwidget/tabservertest.h | 0 .../Test}/customwidget/tabservertest.ui | 0 {Test => src/Test}/libqrencode | 0 src/Test/logger.cpp | 4 ++ {Test => src/Test}/logger.h | 0 {Test => src/Test}/main.cpp | 0 {Test => src/Test}/mainwindow.cpp | 2 +- {Test => src/Test}/mainwindow.h | 0 {Test => src/Test}/mainwindow.ui | 0 {Test => src/Test}/servicelocator.cpp | 0 {Test => src/Test}/servicelocator.h | 0 88 files changed, 141 insertions(+), 162 deletions(-) delete mode 100644 ApiServer/logger.cpp delete mode 100644 QCloudMusicApi/CMakeLists.txt delete mode 100644 Test/logger.cpp rename {ApiServer => src/ApiServer}/CMakeLists.txt (50%) rename {ApiServer => src/ApiServer}/generateconfig.h (100%) create mode 100644 src/ApiServer/logger.cpp rename {ApiServer => src/ApiServer}/logger.h (100%) rename {ApiServer => src/ApiServer}/main.cpp (100%) rename {ApiServer => src/ApiServer}/server.cpp (100%) rename {ApiServer => src/ApiServer}/server.h (100%) create mode 100644 src/CMakeLists.txt create mode 100644 src/QCloudMusicApi/CMakeLists.txt rename {QCloudMusicApi => src/QCloudMusicApi}/api_c.cpp (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/api_c.h (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/apihelper.cpp (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/apihelper.h (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/example/Program.cs (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/example/QCMPlugin/CMakeLists.txt (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/example/QCMPlugin/api.cpp (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/example/QCMPlugin/api.h (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/example/QCMPlugin/aplugin.cpp (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/example/QCMPlugin/aplugin.h (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/example/capi.py (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/example/main.rs (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/global.h (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/module.cpp (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/module.h (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/openssl-cmake (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/plugins.cpp (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/plugins.h (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/qcloudmusicapiplugin.h (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/util/config.h (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/util/crypto.cpp (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/util/crypto.h (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/util/index.cpp (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/util/index.h (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/util/logger.cpp (52%) rename {QCloudMusicApi => src/QCloudMusicApi}/util/logger.h (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/util/option.cpp (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/util/option.h (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/util/request.cpp (100%) rename {QCloudMusicApi => src/QCloudMusicApi}/util/request.h (100%) rename {Test => src/Test}/CMakeLists.txt (64%) rename {Test => src/Test}/config.json (100%) rename {Test => src/Test}/config.qrc (100%) rename {Test => src/Test}/customwidget/tabaes.cpp (100%) rename {Test => src/Test}/customwidget/tabaes.h (100%) rename {Test => src/Test}/customwidget/tabaes.ui (100%) rename {Test => src/Test}/customwidget/tabapi_c.cpp (100%) rename {Test => src/Test}/customwidget/tabapi_c.h (100%) rename {Test => src/Test}/customwidget/tabapi_c.ui (100%) rename {Test => src/Test}/customwidget/tabavatar_upload.cpp (100%) rename {Test => src/Test}/customwidget/tabavatar_upload.h (100%) rename {Test => src/Test}/customwidget/tabavatar_upload.ui (100%) rename {Test => src/Test}/customwidget/tabcommon.cpp (100%) rename {Test => src/Test}/customwidget/tabcommon.h (100%) rename {Test => src/Test}/customwidget/tabcommon.ui (100%) rename {Test => src/Test}/customwidget/tabcommonunit.cpp (100%) rename {Test => src/Test}/customwidget/tabcommonunit.h (100%) rename {Test => src/Test}/customwidget/tabcommonunit.ui (100%) rename {Test => src/Test}/customwidget/tablogin_cellphone.cpp (100%) rename {Test => src/Test}/customwidget/tablogin_cellphone.h (100%) rename {Test => src/Test}/customwidget/tablogin_cellphone.ui (100%) rename {Test => src/Test}/customwidget/tablogin_qr.cpp (100%) rename {Test => src/Test}/customwidget/tablogin_qr.h (100%) rename {Test => src/Test}/customwidget/tablogin_qr.ui (100%) rename {Test => src/Test}/customwidget/tabplaylist_cover_update.cpp (100%) rename {Test => src/Test}/customwidget/tabplaylist_cover_update.h (100%) rename {Test => src/Test}/customwidget/tabplaylist_cover_update.ui (100%) rename {Test => src/Test}/customwidget/tabplugin.cpp (100%) rename {Test => src/Test}/customwidget/tabplugin.h (100%) rename {Test => src/Test}/customwidget/tabrsa.cpp (100%) rename {Test => src/Test}/customwidget/tabrsa.h (100%) rename {Test => src/Test}/customwidget/tabrsa.ui (100%) rename {Test => src/Test}/customwidget/tabservertest.cpp (100%) rename {Test => src/Test}/customwidget/tabservertest.h (100%) rename {Test => src/Test}/customwidget/tabservertest.ui (100%) rename {Test => src/Test}/libqrencode (100%) create mode 100644 src/Test/logger.cpp rename {Test => src/Test}/logger.h (100%) rename {Test => src/Test}/main.cpp (100%) rename {Test => src/Test}/mainwindow.cpp (86%) rename {Test => src/Test}/mainwindow.h (100%) rename {Test => src/Test}/mainwindow.ui (100%) rename {Test => src/Test}/servicelocator.cpp (100%) rename {Test => src/Test}/servicelocator.h (100%) diff --git a/.gitmodules b/.gitmodules index 08b2a75..0c1cae5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ -[submodule "QCloudMusicApi/openssl-cmake"] - path = QCloudMusicApi/openssl-cmake +[submodule "src/QCloudMusicApi/openssl-cmake"] + path = src/QCloudMusicApi/openssl-cmake url = https://github.com/janbar/openssl-cmake.git -[submodule "Test/libqrencode"] - path = Test/libqrencode +[submodule "src/Test/libqrencode"] + path = src/Test/libqrencode url = https://github.com/fukuchi/libqrencode.git diff --git a/ApiServer/logger.cpp b/ApiServer/logger.cpp deleted file mode 100644 index 9826f35..0000000 --- a/ApiServer/logger.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include "logger.h" - -Q_LOGGING_CATEGORY(LOGGER_NAME, PROJECT_NAME) - diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c0c2c7..8c3777b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,48 +1,25 @@ cmake_minimum_required(VERSION 3.14) -project(QCloudMusicApiProject VERSION 1.0) +project(QCloudMusicApi VERSION 1.0) set(CMAKE_CXX_STANDARD 17) +set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD ON) +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows/Macos") + option(MUSICAPI_TEST "Build Test" ON) option(MUSICAPI_SERVER "Build ApiServer" ON) -option(MUSICAPI_SETOUTPUTPATH "Set default output path" ON) -if(ANDROID OR IOS) - set(MUSICAPI_SETOUTPUTPATH OFF) -endif() # 生成动态库 option(BUILD_SHARED_LIBS "Build shared libraries" ON) -if(MUSICAPI_SETOUTPUTPATH) - # set default output path - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${CMAKE_INSTALL_BINDIR}) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${CMAKE_INSTALL_LIBDIR}) - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${CMAKE_INSTALL_BINDIR}) - set(CMAKE_PDB_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${CMAKE_INSTALL_BINDIR}) - set(CMAKE_HEADER_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/include) - - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CMAKE_BUILD_TYPE} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CMAKE_BUILD_TYPE} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CMAKE_BUILD_TYPE} ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}) - set(CMAKE_PDB_OUTPUT_DIRECTORY_${CMAKE_BUILD_TYPE} ${CMAKE_PDB_OUTPUT_DIRECTORY}) - - - # 设置安装前缀为二进制目录 - set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}) -endif() - -add_subdirectory(QCloudMusicApi) -if(MUSICAPI_TEST) - add_subdirectory(Test) -endif() - -find_package(QT NAMES Qt6 Qt5) -find_package(Qt${QT_VERSION_MAJOR} COMPONENTS HttpServer) -if(Qt${QT_VERSION_MAJOR}HttpServer_FOUND) - # Qt6.4后才支持QHttpServer库 - if(MUSICAPI_SERVER) - add_subdirectory(ApiServer) - endif() -endif() +link_directories(${CMAKE_BINARY_DIR}/lib) +add_subdirectory(src) +set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT Test) diff --git a/QCloudMusicApi/CMakeLists.txt b/QCloudMusicApi/CMakeLists.txt deleted file mode 100644 index 795aeef..0000000 --- a/QCloudMusicApi/CMakeLists.txt +++ /dev/null @@ -1,55 +0,0 @@ -cmake_minimum_required(VERSION 3.14) - -project(QCloudMusicApi LANGUAGES CXX) - -set(CMAKE_AUTOUIC ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) - -# Provides dependency openssl -option( WITH_APPS "Build applications" OFF ) -#find_package(OpenSSL QUIET) -if(NOT OPENSSL_FOUND) - add_subdirectory( - ${CMAKE_CURRENT_SOURCE_DIR}/openssl-cmake - ${CMAKE_CURRENT_BINARY_DIR}/openssl-cmake - EXCLUDE_FROM_ALL - ) - set(OPENSSL_SSL_LIBRARY ssl) - set(OPENSSL_CRYPTO_LIBRARY crypto) - set(OPENSSL_INCLUDE_DIR "${openssl_BINARY_DIR}/include" "${openssl_BINARY_DIR}") - set(OPENSSL_FOUND ON) - set(OPENSSL_BUILD_SHARED_LIBS ON) - message(STATUS "Build OpenSSL: ${openssl_BINARY_DIR}") -endif() - -set (HAVE_OPENSSL 1) -include_directories (${OPENSSL_INCLUDE_DIR}) - -find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) -find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Network Gui) - -FILE(GLOB HEADERS ./*.h ./util/*.h) -FILE(GLOB SOURCES ./*.cpp ./util/*.cpp) -add_library(${PROJECT_NAME} - ${HEADERS} - ${SOURCES} -) -set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") - -target_link_libraries(${PROJECT_NAME} Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::Gui ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY}) - -target_compile_definitions(${PROJECT_NAME} PRIVATE - QCLOUDMUSICAPI_LIBRARY - PROJECT_NAME="${PROJECT_NAME}" -) -if(BUILD_SHARED_LIBS) - target_compile_definitions(${PROJECT_NAME} PRIVATE BUILD_SHARED_LIBS) -endif() - -if(MUSICAPI_SETOUTPUTPATH) - FILE(GLOB PUBLIC_HEADERS ./*.h) - install(FILES ${PUBLIC_HEADERS} DESTINATION ${CMAKE_HEADER_OUTPUT_DIRECTORY}) -endif() diff --git a/Test/logger.cpp b/Test/logger.cpp deleted file mode 100644 index 9826f35..0000000 --- a/Test/logger.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include "logger.h" - -Q_LOGGING_CATEGORY(LOGGER_NAME, PROJECT_NAME) - diff --git a/ApiServer/CMakeLists.txt b/src/ApiServer/CMakeLists.txt similarity index 50% rename from ApiServer/CMakeLists.txt rename to src/ApiServer/CMakeLists.txt index 4d619fd..28a30d1 100644 --- a/ApiServer/CMakeLists.txt +++ b/src/ApiServer/CMakeLists.txt @@ -1,13 +1,4 @@ -cmake_minimum_required(VERSION 3.14) - -project(ApiServer LANGUAGES CXX) - -set(CMAKE_AUTOUIC ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(TARGET_NAME ApiServer) find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core HttpServer Network Concurrent) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core HttpServer Network Concurrent) @@ -19,40 +10,41 @@ set(PROJECT_SOURCES ${SOURCES} ) if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) - qt_add_executable(${PROJECT_NAME} + qt_add_executable(${TARGET_NAME} MANUAL_FINALIZATION ${PROJECT_SOURCES} ) # Define target properties for Android with Qt 6 as: -# set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR +# set_property(TARGET ${TARGET_NAME} APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR # ${CMAKE_CURRENT_SOURCE_DIR}/android) # For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation else() if(ANDROID) - add_library(${PROJECT_NAME} SHARED + add_library(${TARGET_NAME} SHARED ${PROJECT_SOURCES} ) # Define properties for Android with Qt 5 after find_package() calls as: # set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android") else() - add_executable(${PROJECT_NAME} + add_executable(${TARGET_NAME} ${PROJECT_SOURCES} ) endif() endif() -target_link_libraries(${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::HttpServer Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::Concurrent QCloudMusicApi) - -target_compile_definitions(${PROJECT_NAME} PRIVATE - PROJECT_NAME="${PROJECT_NAME}" +target_compile_definitions(${TARGET_NAME} PRIVATE + TARGET_NAME="${TARGET_NAME}" ) - -include(GNUInstallDirs) -install(TARGETS ${PROJECT_NAME} - BUNDLE DESTINATION . - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Core + Qt${QT_VERSION_MAJOR}::HttpServer + Qt${QT_VERSION_MAJOR}::Network + Qt${QT_VERSION_MAJOR}::Concurrent + QCloudMusicApi ) if(QT_VERSION_MAJOR EQUAL 6) - qt_finalize_executable(${PROJECT_NAME}) + qt_finalize_executable(${TARGET_NAME}) endif() + +install(FILES ${PUBLIC_HEADERS} DESTINATION $/include/${TARGET_NAME}) +install(TARGETS ${TARGET_NAME} RUNTIME DESTINATION $/bin ARCHIVE DESTINATION $/lib) diff --git a/ApiServer/generateconfig.h b/src/ApiServer/generateconfig.h similarity index 100% rename from ApiServer/generateconfig.h rename to src/ApiServer/generateconfig.h diff --git a/src/ApiServer/logger.cpp b/src/ApiServer/logger.cpp new file mode 100644 index 0000000..8cb03a6 --- /dev/null +++ b/src/ApiServer/logger.cpp @@ -0,0 +1,4 @@ +#include "logger.h" + +Q_LOGGING_CATEGORY(LOGGER_NAME, TARGET_NAME) + diff --git a/ApiServer/logger.h b/src/ApiServer/logger.h similarity index 100% rename from ApiServer/logger.h rename to src/ApiServer/logger.h diff --git a/ApiServer/main.cpp b/src/ApiServer/main.cpp similarity index 100% rename from ApiServer/main.cpp rename to src/ApiServer/main.cpp diff --git a/ApiServer/server.cpp b/src/ApiServer/server.cpp similarity index 100% rename from ApiServer/server.cpp rename to src/ApiServer/server.cpp diff --git a/ApiServer/server.h b/src/ApiServer/server.h similarity index 100% rename from ApiServer/server.h rename to src/ApiServer/server.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..774c8f7 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,16 @@ +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin/Debug/src) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin/Release/src) +set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/bin/${PROJECT_NAME} CACHE PATH "Specify Install Dir" FORCE) + +add_subdirectory(QCloudMusicApi) +if(MUSICAPI_TEST) + add_subdirectory(Test) +endif() +find_package(QT NAMES Qt6 Qt5) +find_package(Qt${QT_VERSION_MAJOR} COMPONENTS HttpServer) +if(Qt${QT_VERSION_MAJOR}HttpServer_FOUND) + # Qt6.4后才支持QHttpServer库 + if(MUSICAPI_SERVER) + add_subdirectory(ApiServer) + endif() +endif() diff --git a/src/QCloudMusicApi/CMakeLists.txt b/src/QCloudMusicApi/CMakeLists.txt new file mode 100644 index 0000000..cde25b4 --- /dev/null +++ b/src/QCloudMusicApi/CMakeLists.txt @@ -0,0 +1,57 @@ +set(TARGET_NAME QCloudMusicApi) + +# Provides dependency openssl +option( WITH_APPS "Build applications" OFF ) +#find_package(OpenSSL QUIET) +if(NOT OPENSSL_FOUND) + add_subdirectory( + ${CMAKE_CURRENT_SOURCE_DIR}/openssl-cmake + ${CMAKE_CURRENT_BINARY_DIR}/openssl-cmake + EXCLUDE_FROM_ALL + ) + set(OPENSSL_SSL_LIBRARY ssl) + set(OPENSSL_CRYPTO_LIBRARY crypto) + set(OPENSSL_INCLUDE_DIR "${openssl_BINARY_DIR}/include" "${openssl_BINARY_DIR}") + set(OPENSSL_FOUND ON) + set(OPENSSL_BUILD_SHARED_LIBS ON) + message(STATUS "Build OpenSSL: ${openssl_BINARY_DIR}") +endif() + +set (HAVE_OPENSSL 1) +include_directories (${OPENSSL_INCLUDE_DIR}) + +find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) +find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Network Gui) + +FILE(GLOB HEADERS ./*.h ./util/*.h) +FILE(GLOB SOURCES ./*.cpp ./util/*.cpp) + +FILE(GLOB PUBLIC_HEADERS ./*.h) + +add_library(${TARGET_NAME} + ${HEADERS} + ${SOURCES} +) +target_compile_definitions(${TARGET_NAME} PRIVATE + QCLOUDMUSICAPI_LIBRARY + TARGET_NAME="${TARGET_NAME}" +) +target_compile_definitions(${TARGET_NAME} PRIVATE QT_MESSAGELOGCONTEXT) +set_target_properties(${TARGET_NAME} PROPERTIES PREFIX "") + +target_link_libraries(${TARGET_NAME} + Qt${QT_VERSION_MAJOR}::Core + Qt${QT_VERSION_MAJOR}::Network + Qt${QT_VERSION_MAJOR}::Gui + ${OPENSSL_SSL_LIBRARY} + ${OPENSSL_CRYPTO_LIBRARY} +) + +if(BUILD_SHARED_LIBS) + target_compile_definitions(${TARGET_NAME} PRIVATE BUILD_SHARED_LIBS) +endif() + +install(FILES ${PUBLIC_HEADERS} DESTINATION $/include/${TARGET_NAME}) +install(TARGETS ${TARGET_NAME} RUNTIME DESTINATION $/bin ARCHIVE DESTINATION $/lib) +install(DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}/ CONFIGURATIONS Debug DESTINATION $/bin FILES_MATCHING PATTERN *.pdb) +install(DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE}/ CONFIGURATIONS Release DESTINATION $/bin FILES_MATCHING PATTERN *.pdb) diff --git a/QCloudMusicApi/api_c.cpp b/src/QCloudMusicApi/api_c.cpp similarity index 100% rename from QCloudMusicApi/api_c.cpp rename to src/QCloudMusicApi/api_c.cpp diff --git a/QCloudMusicApi/api_c.h b/src/QCloudMusicApi/api_c.h similarity index 100% rename from QCloudMusicApi/api_c.h rename to src/QCloudMusicApi/api_c.h diff --git a/QCloudMusicApi/apihelper.cpp b/src/QCloudMusicApi/apihelper.cpp similarity index 100% rename from QCloudMusicApi/apihelper.cpp rename to src/QCloudMusicApi/apihelper.cpp diff --git a/QCloudMusicApi/apihelper.h b/src/QCloudMusicApi/apihelper.h similarity index 100% rename from QCloudMusicApi/apihelper.h rename to src/QCloudMusicApi/apihelper.h diff --git a/QCloudMusicApi/example/Program.cs b/src/QCloudMusicApi/example/Program.cs similarity index 100% rename from QCloudMusicApi/example/Program.cs rename to src/QCloudMusicApi/example/Program.cs diff --git a/QCloudMusicApi/example/QCMPlugin/CMakeLists.txt b/src/QCloudMusicApi/example/QCMPlugin/CMakeLists.txt similarity index 100% rename from QCloudMusicApi/example/QCMPlugin/CMakeLists.txt rename to src/QCloudMusicApi/example/QCMPlugin/CMakeLists.txt diff --git a/QCloudMusicApi/example/QCMPlugin/api.cpp b/src/QCloudMusicApi/example/QCMPlugin/api.cpp similarity index 100% rename from QCloudMusicApi/example/QCMPlugin/api.cpp rename to src/QCloudMusicApi/example/QCMPlugin/api.cpp diff --git a/QCloudMusicApi/example/QCMPlugin/api.h b/src/QCloudMusicApi/example/QCMPlugin/api.h similarity index 100% rename from QCloudMusicApi/example/QCMPlugin/api.h rename to src/QCloudMusicApi/example/QCMPlugin/api.h diff --git a/QCloudMusicApi/example/QCMPlugin/aplugin.cpp b/src/QCloudMusicApi/example/QCMPlugin/aplugin.cpp similarity index 100% rename from QCloudMusicApi/example/QCMPlugin/aplugin.cpp rename to src/QCloudMusicApi/example/QCMPlugin/aplugin.cpp diff --git a/QCloudMusicApi/example/QCMPlugin/aplugin.h b/src/QCloudMusicApi/example/QCMPlugin/aplugin.h similarity index 100% rename from QCloudMusicApi/example/QCMPlugin/aplugin.h rename to src/QCloudMusicApi/example/QCMPlugin/aplugin.h diff --git a/QCloudMusicApi/example/capi.py b/src/QCloudMusicApi/example/capi.py similarity index 100% rename from QCloudMusicApi/example/capi.py rename to src/QCloudMusicApi/example/capi.py diff --git a/QCloudMusicApi/example/main.rs b/src/QCloudMusicApi/example/main.rs similarity index 100% rename from QCloudMusicApi/example/main.rs rename to src/QCloudMusicApi/example/main.rs diff --git a/QCloudMusicApi/global.h b/src/QCloudMusicApi/global.h similarity index 100% rename from QCloudMusicApi/global.h rename to src/QCloudMusicApi/global.h diff --git a/QCloudMusicApi/module.cpp b/src/QCloudMusicApi/module.cpp similarity index 100% rename from QCloudMusicApi/module.cpp rename to src/QCloudMusicApi/module.cpp diff --git a/QCloudMusicApi/module.h b/src/QCloudMusicApi/module.h similarity index 100% rename from QCloudMusicApi/module.h rename to src/QCloudMusicApi/module.h diff --git a/QCloudMusicApi/openssl-cmake b/src/QCloudMusicApi/openssl-cmake similarity index 100% rename from QCloudMusicApi/openssl-cmake rename to src/QCloudMusicApi/openssl-cmake diff --git a/QCloudMusicApi/plugins.cpp b/src/QCloudMusicApi/plugins.cpp similarity index 100% rename from QCloudMusicApi/plugins.cpp rename to src/QCloudMusicApi/plugins.cpp diff --git a/QCloudMusicApi/plugins.h b/src/QCloudMusicApi/plugins.h similarity index 100% rename from QCloudMusicApi/plugins.h rename to src/QCloudMusicApi/plugins.h diff --git a/QCloudMusicApi/qcloudmusicapiplugin.h b/src/QCloudMusicApi/qcloudmusicapiplugin.h similarity index 100% rename from QCloudMusicApi/qcloudmusicapiplugin.h rename to src/QCloudMusicApi/qcloudmusicapiplugin.h diff --git a/QCloudMusicApi/util/config.h b/src/QCloudMusicApi/util/config.h similarity index 100% rename from QCloudMusicApi/util/config.h rename to src/QCloudMusicApi/util/config.h diff --git a/QCloudMusicApi/util/crypto.cpp b/src/QCloudMusicApi/util/crypto.cpp similarity index 100% rename from QCloudMusicApi/util/crypto.cpp rename to src/QCloudMusicApi/util/crypto.cpp diff --git a/QCloudMusicApi/util/crypto.h b/src/QCloudMusicApi/util/crypto.h similarity index 100% rename from QCloudMusicApi/util/crypto.h rename to src/QCloudMusicApi/util/crypto.h diff --git a/QCloudMusicApi/util/index.cpp b/src/QCloudMusicApi/util/index.cpp similarity index 100% rename from QCloudMusicApi/util/index.cpp rename to src/QCloudMusicApi/util/index.cpp diff --git a/QCloudMusicApi/util/index.h b/src/QCloudMusicApi/util/index.h similarity index 100% rename from QCloudMusicApi/util/index.h rename to src/QCloudMusicApi/util/index.h diff --git a/QCloudMusicApi/util/logger.cpp b/src/QCloudMusicApi/util/logger.cpp similarity index 52% rename from QCloudMusicApi/util/logger.cpp rename to src/QCloudMusicApi/util/logger.cpp index 73c99c9..641c1ec 100644 --- a/QCloudMusicApi/util/logger.cpp +++ b/src/QCloudMusicApi/util/logger.cpp @@ -1,5 +1,5 @@ #include "logger.h" namespace QCloudMusicApi { -Q_LOGGING_CATEGORY(LOGGER_NAME, PROJECT_NAME) +Q_LOGGING_CATEGORY(LOGGER_NAME, TARGET_NAME) } diff --git a/QCloudMusicApi/util/logger.h b/src/QCloudMusicApi/util/logger.h similarity index 100% rename from QCloudMusicApi/util/logger.h rename to src/QCloudMusicApi/util/logger.h diff --git a/QCloudMusicApi/util/option.cpp b/src/QCloudMusicApi/util/option.cpp similarity index 100% rename from QCloudMusicApi/util/option.cpp rename to src/QCloudMusicApi/util/option.cpp diff --git a/QCloudMusicApi/util/option.h b/src/QCloudMusicApi/util/option.h similarity index 100% rename from QCloudMusicApi/util/option.h rename to src/QCloudMusicApi/util/option.h diff --git a/QCloudMusicApi/util/request.cpp b/src/QCloudMusicApi/util/request.cpp similarity index 100% rename from QCloudMusicApi/util/request.cpp rename to src/QCloudMusicApi/util/request.cpp diff --git a/QCloudMusicApi/util/request.h b/src/QCloudMusicApi/util/request.h similarity index 100% rename from QCloudMusicApi/util/request.h rename to src/QCloudMusicApi/util/request.h diff --git a/Test/CMakeLists.txt b/src/Test/CMakeLists.txt similarity index 64% rename from Test/CMakeLists.txt rename to src/Test/CMakeLists.txt index 88c2396..09305b9 100644 --- a/Test/CMakeLists.txt +++ b/src/Test/CMakeLists.txt @@ -1,22 +1,8 @@ -cmake_minimum_required(VERSION 3.5) - -project(Test VERSION 0.1 LANGUAGES CXX) - -set(CMAKE_AUTOUIC ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(TARGET_NAME Test) find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Concurrent) find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Network Concurrent) -set(WITH_TOOLS OFF CACHE BOOL "Build utility tools" FORCE) -add_subdirectory( - ${CMAKE_CURRENT_SOURCE_DIR}/libqrencode -) - FILE(GLOB HEADERS ./*.h) FILE(GLOB SOURCES ./*.cpp) FILE(GLOB UIS ./*.ui) @@ -30,44 +16,55 @@ set(PROJECT_SOURCES ${CUSTOMWIDGET} ) +set(WITH_TOOLS OFF CACHE BOOL "Build utility tools" FORCE) +add_subdirectory( + ${CMAKE_CURRENT_SOURCE_DIR}/libqrencode +) + include_directories (./customwidget) if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) - qt_add_executable(${PROJECT_NAME} + qt_add_executable(${TARGET_NAME} MANUAL_FINALIZATION ${PROJECT_SOURCES} ) # Define target properties for Android with Qt 6 as: -# set_property(TARGET ${PROJECT_NAME} APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR +# set_property(TARGET ${TARGET_NAME} APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR # ${CMAKE_CURRENT_SOURCE_DIR}/android) # For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation else() if(ANDROID) - add_library(${PROJECT_NAME} SHARED + add_library(${TARGET_NAME} SHARED ${PROJECT_SOURCES} ) # Define properties for Android with Qt 5 after find_package() calls as: # set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android") else() - add_executable(${PROJECT_NAME} + add_executable(${TARGET_NAME} ${PROJECT_SOURCES} ) endif() endif() -target_link_libraries(${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::Concurrent QCloudMusicApi qrencode) +target_compile_definitions(${TARGET_NAME} PRIVATE + TARGET_NAME="${TARGET_NAME}" +) -target_compile_definitions(${PROJECT_NAME} PRIVATE - PROJECT_NAME="${PROJECT_NAME}" +target_link_libraries(${TARGET_NAME} PRIVATE + Qt${QT_VERSION_MAJOR}::Widgets + Qt${QT_VERSION_MAJOR}::Network + Qt${QT_VERSION_MAJOR}::Concurrent + QCloudMusicApi + qrencode ) # Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1. # If you are developing for iOS or macOS you should consider setting an # explicit, fixed bundle identifier manually though. if(${QT_VERSION} VERSION_LESS 6.1.0) - set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER com.example.${PROJECT_NAME}) + set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER com.example.${TARGET_NAME}) endif() -set_target_properties(${PROJECT_NAME} PROPERTIES +set_target_properties(${TARGET_NAME} PROPERTIES ${BUNDLE_ID_OPTION} MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} @@ -75,13 +72,8 @@ set_target_properties(${PROJECT_NAME} PROPERTIES WIN32_EXECUTABLE TRUE ) -include(GNUInstallDirs) -install(TARGETS ${PROJECT_NAME} - BUNDLE DESTINATION . - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - if(QT_VERSION_MAJOR EQUAL 6) - qt_finalize_executable(${PROJECT_NAME}) + qt_finalize_executable(${TARGET_NAME}) endif() + +install(TARGETS ${TARGET_NAME} RUNTIME DESTINATION $/bin ARCHIVE DESTINATION $/lib) diff --git a/Test/config.json b/src/Test/config.json similarity index 100% rename from Test/config.json rename to src/Test/config.json diff --git a/Test/config.qrc b/src/Test/config.qrc similarity index 100% rename from Test/config.qrc rename to src/Test/config.qrc diff --git a/Test/customwidget/tabaes.cpp b/src/Test/customwidget/tabaes.cpp similarity index 100% rename from Test/customwidget/tabaes.cpp rename to src/Test/customwidget/tabaes.cpp diff --git a/Test/customwidget/tabaes.h b/src/Test/customwidget/tabaes.h similarity index 100% rename from Test/customwidget/tabaes.h rename to src/Test/customwidget/tabaes.h diff --git a/Test/customwidget/tabaes.ui b/src/Test/customwidget/tabaes.ui similarity index 100% rename from Test/customwidget/tabaes.ui rename to src/Test/customwidget/tabaes.ui diff --git a/Test/customwidget/tabapi_c.cpp b/src/Test/customwidget/tabapi_c.cpp similarity index 100% rename from Test/customwidget/tabapi_c.cpp rename to src/Test/customwidget/tabapi_c.cpp diff --git a/Test/customwidget/tabapi_c.h b/src/Test/customwidget/tabapi_c.h similarity index 100% rename from Test/customwidget/tabapi_c.h rename to src/Test/customwidget/tabapi_c.h diff --git a/Test/customwidget/tabapi_c.ui b/src/Test/customwidget/tabapi_c.ui similarity index 100% rename from Test/customwidget/tabapi_c.ui rename to src/Test/customwidget/tabapi_c.ui diff --git a/Test/customwidget/tabavatar_upload.cpp b/src/Test/customwidget/tabavatar_upload.cpp similarity index 100% rename from Test/customwidget/tabavatar_upload.cpp rename to src/Test/customwidget/tabavatar_upload.cpp diff --git a/Test/customwidget/tabavatar_upload.h b/src/Test/customwidget/tabavatar_upload.h similarity index 100% rename from Test/customwidget/tabavatar_upload.h rename to src/Test/customwidget/tabavatar_upload.h diff --git a/Test/customwidget/tabavatar_upload.ui b/src/Test/customwidget/tabavatar_upload.ui similarity index 100% rename from Test/customwidget/tabavatar_upload.ui rename to src/Test/customwidget/tabavatar_upload.ui diff --git a/Test/customwidget/tabcommon.cpp b/src/Test/customwidget/tabcommon.cpp similarity index 100% rename from Test/customwidget/tabcommon.cpp rename to src/Test/customwidget/tabcommon.cpp diff --git a/Test/customwidget/tabcommon.h b/src/Test/customwidget/tabcommon.h similarity index 100% rename from Test/customwidget/tabcommon.h rename to src/Test/customwidget/tabcommon.h diff --git a/Test/customwidget/tabcommon.ui b/src/Test/customwidget/tabcommon.ui similarity index 100% rename from Test/customwidget/tabcommon.ui rename to src/Test/customwidget/tabcommon.ui diff --git a/Test/customwidget/tabcommonunit.cpp b/src/Test/customwidget/tabcommonunit.cpp similarity index 100% rename from Test/customwidget/tabcommonunit.cpp rename to src/Test/customwidget/tabcommonunit.cpp diff --git a/Test/customwidget/tabcommonunit.h b/src/Test/customwidget/tabcommonunit.h similarity index 100% rename from Test/customwidget/tabcommonunit.h rename to src/Test/customwidget/tabcommonunit.h diff --git a/Test/customwidget/tabcommonunit.ui b/src/Test/customwidget/tabcommonunit.ui similarity index 100% rename from Test/customwidget/tabcommonunit.ui rename to src/Test/customwidget/tabcommonunit.ui diff --git a/Test/customwidget/tablogin_cellphone.cpp b/src/Test/customwidget/tablogin_cellphone.cpp similarity index 100% rename from Test/customwidget/tablogin_cellphone.cpp rename to src/Test/customwidget/tablogin_cellphone.cpp diff --git a/Test/customwidget/tablogin_cellphone.h b/src/Test/customwidget/tablogin_cellphone.h similarity index 100% rename from Test/customwidget/tablogin_cellphone.h rename to src/Test/customwidget/tablogin_cellphone.h diff --git a/Test/customwidget/tablogin_cellphone.ui b/src/Test/customwidget/tablogin_cellphone.ui similarity index 100% rename from Test/customwidget/tablogin_cellphone.ui rename to src/Test/customwidget/tablogin_cellphone.ui diff --git a/Test/customwidget/tablogin_qr.cpp b/src/Test/customwidget/tablogin_qr.cpp similarity index 100% rename from Test/customwidget/tablogin_qr.cpp rename to src/Test/customwidget/tablogin_qr.cpp diff --git a/Test/customwidget/tablogin_qr.h b/src/Test/customwidget/tablogin_qr.h similarity index 100% rename from Test/customwidget/tablogin_qr.h rename to src/Test/customwidget/tablogin_qr.h diff --git a/Test/customwidget/tablogin_qr.ui b/src/Test/customwidget/tablogin_qr.ui similarity index 100% rename from Test/customwidget/tablogin_qr.ui rename to src/Test/customwidget/tablogin_qr.ui diff --git a/Test/customwidget/tabplaylist_cover_update.cpp b/src/Test/customwidget/tabplaylist_cover_update.cpp similarity index 100% rename from Test/customwidget/tabplaylist_cover_update.cpp rename to src/Test/customwidget/tabplaylist_cover_update.cpp diff --git a/Test/customwidget/tabplaylist_cover_update.h b/src/Test/customwidget/tabplaylist_cover_update.h similarity index 100% rename from Test/customwidget/tabplaylist_cover_update.h rename to src/Test/customwidget/tabplaylist_cover_update.h diff --git a/Test/customwidget/tabplaylist_cover_update.ui b/src/Test/customwidget/tabplaylist_cover_update.ui similarity index 100% rename from Test/customwidget/tabplaylist_cover_update.ui rename to src/Test/customwidget/tabplaylist_cover_update.ui diff --git a/Test/customwidget/tabplugin.cpp b/src/Test/customwidget/tabplugin.cpp similarity index 100% rename from Test/customwidget/tabplugin.cpp rename to src/Test/customwidget/tabplugin.cpp diff --git a/Test/customwidget/tabplugin.h b/src/Test/customwidget/tabplugin.h similarity index 100% rename from Test/customwidget/tabplugin.h rename to src/Test/customwidget/tabplugin.h diff --git a/Test/customwidget/tabrsa.cpp b/src/Test/customwidget/tabrsa.cpp similarity index 100% rename from Test/customwidget/tabrsa.cpp rename to src/Test/customwidget/tabrsa.cpp diff --git a/Test/customwidget/tabrsa.h b/src/Test/customwidget/tabrsa.h similarity index 100% rename from Test/customwidget/tabrsa.h rename to src/Test/customwidget/tabrsa.h diff --git a/Test/customwidget/tabrsa.ui b/src/Test/customwidget/tabrsa.ui similarity index 100% rename from Test/customwidget/tabrsa.ui rename to src/Test/customwidget/tabrsa.ui diff --git a/Test/customwidget/tabservertest.cpp b/src/Test/customwidget/tabservertest.cpp similarity index 100% rename from Test/customwidget/tabservertest.cpp rename to src/Test/customwidget/tabservertest.cpp diff --git a/Test/customwidget/tabservertest.h b/src/Test/customwidget/tabservertest.h similarity index 100% rename from Test/customwidget/tabservertest.h rename to src/Test/customwidget/tabservertest.h diff --git a/Test/customwidget/tabservertest.ui b/src/Test/customwidget/tabservertest.ui similarity index 100% rename from Test/customwidget/tabservertest.ui rename to src/Test/customwidget/tabservertest.ui diff --git a/Test/libqrencode b/src/Test/libqrencode similarity index 100% rename from Test/libqrencode rename to src/Test/libqrencode diff --git a/src/Test/logger.cpp b/src/Test/logger.cpp new file mode 100644 index 0000000..8cb03a6 --- /dev/null +++ b/src/Test/logger.cpp @@ -0,0 +1,4 @@ +#include "logger.h" + +Q_LOGGING_CATEGORY(LOGGER_NAME, TARGET_NAME) + diff --git a/Test/logger.h b/src/Test/logger.h similarity index 100% rename from Test/logger.h rename to src/Test/logger.h diff --git a/Test/main.cpp b/src/Test/main.cpp similarity index 100% rename from Test/main.cpp rename to src/Test/main.cpp diff --git a/Test/mainwindow.cpp b/src/Test/mainwindow.cpp similarity index 86% rename from Test/mainwindow.cpp rename to src/Test/mainwindow.cpp index f9d5ca6..93ab161 100644 --- a/Test/mainwindow.cpp +++ b/src/Test/mainwindow.cpp @@ -6,7 +6,7 @@ MainWindow::MainWindow(QWidget *parent) , ui(new Ui::MainWindow) { ui->setupUi(this); - setWindowTitle(PROJECT_NAME); + setWindowTitle(TARGET_NAME); } MainWindow::~MainWindow() diff --git a/Test/mainwindow.h b/src/Test/mainwindow.h similarity index 100% rename from Test/mainwindow.h rename to src/Test/mainwindow.h diff --git a/Test/mainwindow.ui b/src/Test/mainwindow.ui similarity index 100% rename from Test/mainwindow.ui rename to src/Test/mainwindow.ui diff --git a/Test/servicelocator.cpp b/src/Test/servicelocator.cpp similarity index 100% rename from Test/servicelocator.cpp rename to src/Test/servicelocator.cpp diff --git a/Test/servicelocator.h b/src/Test/servicelocator.h similarity index 100% rename from Test/servicelocator.h rename to src/Test/servicelocator.h