diff options
author | saturneric <[email protected]> | 2024-07-28 17:45:39 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-07-28 17:45:39 +0000 |
commit | 7a552f4d9dc0455b66ea2329bc1cd06a71bc6a79 (patch) | |
tree | c344bf0615bc49f80bb81519810bade0d6ea05ba /src | |
parent | fix: errors in judgment conditions (diff) | |
download | GpgFrontend-sdk/2.1.3.tar.gz GpgFrontend-sdk/2.1.3.zip |
feat: support more build modesdk/2.1.3
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 35 | ||||
-rw-r--r-- | src/GpgFrontendContext.h | 4 | ||||
-rw-r--r-- | src/cmd.cpp | 7 | ||||
-rw-r--r-- | src/core/function/GlobalSettingStation.h | 2 | ||||
-rw-r--r-- | src/core/utils/BuildInfoUtils.cpp | 2 | ||||
-rw-r--r-- | src/core/utils/BuildInfoUtils.h | 7 | ||||
-rw-r--r-- | src/main.cpp | 10 |
7 files changed, 61 insertions, 6 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9b590b7b..a91bc2ea 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -405,6 +405,16 @@ if (BUILD_APPLICATION) endif () +if(STABLE_BUILD_ONLY_APPLICATION) + target_include_directories(${AppName} PUBLIC "${CMAKE_SOURCE_DIR}/src") + + if(GPGFRONTEND_QT5_BUILD) + target_link_libraries(${AppName} Qt5::Core Qt5::Widgets) + else() + target_link_libraries(${AppName} Qt6::Core Qt6::Widgets) + endif() +endif() + # link options for GpgFrontend if (BUILD_APPLICATION) target_link_libraries(${AppName} gpgfrontend_ui gpgfrontend_test) @@ -419,6 +429,8 @@ if (BUILD_APPLICATION) endif () endif () + + # add i18n support if (BUILD_APPLICATION) set(LOCALE_TS_PATH ${CMAKE_SOURCE_DIR}/resource/lfs/locale/ts) @@ -509,8 +521,8 @@ if (LINUX AND LINUX_INSTALL_SOFTWARE) DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/) endif () -# if building sdk -if (BUILD_SDK) +# if only build sdk +if (STABLE_BUILD_ONLY_SDK) include(GNUInstallDirs) set(GPGFRONTEND_SDK_INSTALL_LIBRARIES gpgfrontend_module_sdk) @@ -522,3 +534,22 @@ if (BUILD_SDK) LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif () + + +# if build full sdk +if (STABLE_BUILD_FULL_SDK) + include(GNUInstallDirs) + set(GPGFRONTEND_SDK_INSTALL_LIBRARIES + mimalloc + gpgfrontend_core + gpgfrontend_ui + gpgfrontend_test + gpgfrontend_module_sdk) + + install(TARGETS ${GPGFRONTEND_SDK_INSTALL_LIBRARIES} + EXPORT GpgFrontendTargets + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) +endif ()
\ No newline at end of file diff --git a/src/GpgFrontendContext.h b/src/GpgFrontendContext.h index c4c10690..9dd805b7 100644 --- a/src/GpgFrontendContext.h +++ b/src/GpgFrontendContext.h @@ -28,6 +28,10 @@ #pragma once +#include <qapplication.h> + +#include <memory> + namespace GpgFrontend { struct GpgFrontendContext; diff --git a/src/cmd.cpp b/src/cmd.cpp index 1f3182fe..06222431 100644 --- a/src/cmd.cpp +++ b/src/cmd.cpp @@ -28,11 +28,16 @@ #include "cmd.h" +#include <qdatetime.h> #include <qglobal.h> +#include <qloggingcategory.h> +#include <qstring.h> +#include <qtextstream.h> #include "core/utils/BuildInfoUtils.h" // GpgFrontend + #include "GpgFrontendContext.h" #include "test/GpgFrontendTest.h" @@ -40,7 +45,7 @@ namespace GpgFrontend { auto PrintVersion() -> int { QTextStream stream(stdout); - stream << PROJECT_NAME << " " << GetProjectVersion() << '\n'; + stream << GetProjectName() << " " << GetProjectVersion() << '\n'; stream << "Copyright (©) 2021 Saturneric <[email protected]>" << '\n' << QCoreApplication::tr( "This is free software; see the source for copying conditions.") diff --git a/src/core/function/GlobalSettingStation.h b/src/core/function/GlobalSettingStation.h index c907bdb5..d3287ac2 100644 --- a/src/core/function/GlobalSettingStation.h +++ b/src/core/function/GlobalSettingStation.h @@ -28,6 +28,8 @@ #pragma once +#include <qsettings.h> + #include "core/function/basic/GpgFunctionObject.h" namespace GpgFrontend { diff --git a/src/core/utils/BuildInfoUtils.cpp b/src/core/utils/BuildInfoUtils.cpp index 261057b7..65a0b43a 100644 --- a/src/core/utils/BuildInfoUtils.cpp +++ b/src/core/utils/BuildInfoUtils.cpp @@ -5,6 +5,8 @@ namespace GpgFrontend { +auto GetProjectName() -> QString { return {PROJECT_NAME}; } + auto GetProjectVersion() -> QString { return (QStringList{} << "v" << VERSION_MAJOR << "." << VERSION_MINOR << "." << VERSION_PATCH) diff --git a/src/core/utils/BuildInfoUtils.h b/src/core/utils/BuildInfoUtils.h index 07b0bb21..dfc9efe3 100644 --- a/src/core/utils/BuildInfoUtils.h +++ b/src/core/utils/BuildInfoUtils.h @@ -37,6 +37,13 @@ namespace GpgFrontend { * * @return QString */ +auto GPGFRONTEND_CORE_EXPORT GetProjectName() -> QString; + +/** + * @brief + * + * @return QString + */ auto GPGFRONTEND_CORE_EXPORT GetProjectVersion() -> QString; /** diff --git a/src/main.cpp b/src/main.cpp index 77856fe0..085ba03f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -30,14 +30,18 @@ * \mainpage GpgFrontend Develop Document Main Page */ +#include <qcommandlineparser.h> +#include <qloggingcategory.h> + +// #include "GpgFrontendContext.h" +#include "core/utils/MemoryUtils.h" + +// #include "app.h" #include "cmd.h" #include "init.h" -// -#include "core/utils/MemoryUtils.h" - /** * * @param argc |