diff options
author | Saturneric <[email protected]> | 2022-03-12 06:22:02 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2022-03-12 06:22:02 +0000 |
commit | 133fa7e8102b0654340ba3cd3f82cb3227beb4b1 (patch) | |
tree | 3f553b978188f7721a9521d0bd96a54e299b63a4 | |
parent | <fix>(core): Fix the setting loading IO problem under Windows (diff) | |
parent | <fix, refactor, feat> adjust the project configuration (diff) | |
download | GpgFrontend-133fa7e8102b0654340ba3cd3f82cb3227beb4b1.tar.gz GpgFrontend-133fa7e8102b0654340ba3cd3f82cb3227beb4b1.zip |
Merge branch 'develop-2.0.5' of git.codesdream.com:GpgFrontend into develop-2.0.5
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | CMakeLists.txt | 10 | ||||
-rw-r--r-- | src/CMakeLists.txt | 83 | ||||
-rw-r--r-- | src/core/CMakeLists.txt | 7 | ||||
-rw-r--r-- | src/ui/CMakeLists.txt | 6 | ||||
-rw-r--r-- | third_party/CMakeLists.txt | 5 | ||||
m--------- | third_party/libconfig | 0 |
7 files changed, 69 insertions, 45 deletions
diff --git a/.gitmodules b/.gitmodules index 2949c406..3815e764 100644 --- a/.gitmodules +++ b/.gitmodules @@ -25,3 +25,6 @@ [submodule "third_party/libarchive"] path = third_party/libarchive url = https://github.com/saturneric/libarchive.git +[submodule "third_party/libconfig"] + path = third_party/libconfig + url = https://github.com/saturneric/libconfig diff --git a/CMakeLists.txt b/CMakeLists.txt index 78dc74fd..7ceb9d00 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -139,17 +139,21 @@ endif(CCACHE_FOUND) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") # using clang message(STATUS "Using Compiler clang") + message(STATUS "clang version ${CMAKE_CXX_COMPILER_VERSION}") set(USING_COMPILER_CLANG 1) elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # using gcc message(STATUS "Using Compiler gcc") + message(STATUS "gcc version ${CMAKE_CXX_COMPILER_VERSION}") set(USING_COMPILER_GCC 1) elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") # using Intel C++ message(STATUS "Using Compiler Intel") + message(WARNING "Compilation with this compiler is untested, which may create some problems that need to be solved by the user.") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # using Visual Studio C++ message(STATUS "Using Compiler MSVC") + message(WARNING "Compilation with this compiler is untested, which may create some problems that need to be solved by the user.") endif () # Using Standard C++-17 (Consider compatibility) @@ -261,6 +265,7 @@ message(STATUS "GpgFrontend Build Timestamp ${BUILD_TIMESTAMP}") message(STATUS "GpgFrontend Build Version ${BUILD_VERSION}") message(STATUS "GpgFrontend Git Repo Version ${GIT_VERSION}") +# Windows IF (MINGW) message(STATUS "GpgFrontend Configuration For OS Platform Microsoft Windows") message(STATUS "Build Environment MINGW") @@ -281,6 +286,7 @@ IF (MINGW) ) endif () +# macOS if (APPLE) message(STATUS "GpgFrontend Configuration For OS Platform MacOS") @@ -304,7 +310,6 @@ if (APPLE) ) link_directories( /usr/local/lib - /usr/local/opt/openssl/lib ) endif () @@ -374,6 +379,7 @@ if (FULL_APPLICATION_BUILD) set(BASIC_ENV_CONFIG 1) set(MULTI_LANG_SUPPORT 1) elseif (MINIMUM_APPLICATION_BUILD) + message(STATUS "Build Minimum Application") set(QT5_ENV_SUPPORT 1) set(GPG_CORE 1) set(UI_CORE 1) @@ -384,6 +390,7 @@ elseif (MINIMUM_APPLICATION_BUILD) # set(APP_IMAGE_UPDATE 1) # endif () elseif (STABLE_APPLICATION_BUILD) + message(STATUS "Build Stable Application") set(QT5_ENV_SUPPORT 1) set(GPG_CORE 1) set(UI_CORE 1) @@ -450,6 +457,7 @@ add_subdirectory(third_party) # source code add_subdirectory(src) +# build to test gpgfrontend core if (TEST_CORE_BUILD) include(CTest) enable_testing() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 45f28421..0769f11a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -253,6 +253,7 @@ if (APPLICATION_BUILD) endif () +# link options for GpgFrontend if (APPLICATION_BUILD) target_link_libraries(${AppName} gpgfrontend_ui) IF (MINGW) @@ -260,52 +261,54 @@ if (APPLICATION_BUILD) target_link_libraries(${AppName} crypto) elseif (APPLE) message(STATUS "Link Application Static Library For macOS") - target_link_libraries(${AppName} crypto intl) + target_link_libraries(${AppName} intl) else () message(STATUS "Link Application Static Library For Linux") target_link_libraries(${AppName} crypto pthread) endif () endif () -if (LINUX_INSTALL_SOFTWARE) - if (LINUX) - if (INSTALL_GPGFRONTEND_APP) - install(TARGETS ${AppName} - EXPORT GpgFrontendTargets - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - ) - install(FILES ${CMAKE_SOURCE_DIR}/TRANSLATORS - DESTINATION /usr/local/share/${AppName}/) - install(FILES ${CMAKE_SOURCE_DIR}/resource/meta/pub.gpgfrontend.gpgfrontend.appdata.xml - DESTINATION /usr/share/metainfo/) - install(DIRECTORY ${CMAKE_SOURCE_DIR}/resource/desktop/ - DESTINATION /usr/share/applications/) - install(DIRECTORY ${CMAKE_SOURCE_DIR}/resource/pixmaps/ - DESTINATION /usr/share/pixmaps/) - install(DIRECTORY ${CMAKE_SOURCE_DIR}/resource/hicolor/ - DESTINATION /usr/share/icons/hicolor/) - endif () - if (MULTI_LANG_SUPPORT) - install(DIRECTORY ${LOCALE_OUTPUT_PATH}/ - DESTINATION ${CMAKE_INSTALL_FULL_LOCALEDIR}) - endif () - if (APP_PACKAGE_DEB) - message(STATUS "Configure Deb Package") - SET(CPACK_GENERATOR "DEB") - set(CPACK_INSTALL_PREFIX "/usr/local/") - set(CPACK_PACKAGE_NAME "gpgfrontend") - set(CPACK_DEBIAN_PACKAGE_NAME "gpgfrontend") - set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") - set(CPACK_PACKAGE_CONTACT "[email protected]") - SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Saturneric") - set(CPACK_DEBIAN_PACKAGE_DEPENDS "gpg (>= 2.2), libqt5core5a (>= 5.9), libqt5gui5 (>= 5.9), libqt5widgets5 (>= 5.9), libqt5network5 (>= 5.9), libqt5printsupport5 (>= 5.9), libconfig++-dev (>=1.5)") - set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") - set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") - set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") - include(CPack) - endif () +# using c++ standard 17 +target_compile_features(${AppName} PUBLIC cxx_std_17) + +# if building linux package +if (LINUX AND LINUX_INSTALL_SOFTWARE) + if (INSTALL_GPGFRONTEND_APP) + install(TARGETS ${AppName} + EXPORT GpgFrontendTargets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) + install(FILES ${CMAKE_SOURCE_DIR}/TRANSLATORS + DESTINATION /usr/local/share/${AppName}/) + install(FILES ${CMAKE_SOURCE_DIR}/resource/meta/pub.gpgfrontend.gpgfrontend.appdata.xml + DESTINATION /usr/share/metainfo/) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/resource/desktop/ + DESTINATION /usr/share/applications/) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/resource/pixmaps/ + DESTINATION /usr/share/pixmaps/) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/resource/hicolor/ + DESTINATION /usr/share/icons/hicolor/) + endif () + if (MULTI_LANG_SUPPORT) + install(DIRECTORY ${LOCALE_OUTPUT_PATH}/ + DESTINATION ${CMAKE_INSTALL_FULL_LOCALEDIR}) + endif () + if (APP_PACKAGE_DEB) + message(STATUS "Configure Deb Package") + SET(CPACK_GENERATOR "DEB") + set(CPACK_INSTALL_PREFIX "/usr/local/") + set(CPACK_PACKAGE_NAME "gpgfrontend") + set(CPACK_DEBIAN_PACKAGE_NAME "gpgfrontend") + set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64") + set(CPACK_PACKAGE_CONTACT "[email protected]") + SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Saturneric") + set(CPACK_DEBIAN_PACKAGE_DEPENDS "gpg (>= 2.2), libqt5core5a (>= 5.9), libqt5gui5 (>= 5.9), libqt5widgets5 (>= 5.9), libqt5network5 (>= 5.9), libqt5printsupport5 (>= 5.9), libconfig++-dev (>=1.5)") + set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}") + set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}") + set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}") + include(CPack) endif () endif () diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 2f463039..192e1e0c 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -49,8 +49,9 @@ target_link_libraries(gpgfrontend_core OpenSSL::SSL OpenSSL::Crypto) target_link_libraries(gpgfrontend_core QtAES) # link vmime if (NOT LINUX) + # macOS target_link_libraries(gpgfrontend_core - gpgfrontend_vmime ssl crypto intl iconv) + gpgfrontend_vmime intl iconv) if (MINGW) target_link_libraries(gpgfrontend_core ws2_32) endif () @@ -76,11 +77,13 @@ target_precompile_headers(gpgfrontend_core PUBLIC ${CMAKE_SOURCE_DIR}/src/GpgFrontend.h PUBLIC GpgFrontendCore.h) +# using std c++ 17 +target_compile_features(gpgfrontend_core PUBLIC cxx_std_17) + # link for different platforms if (MINGW) message(STATUS "Link GPG Static Library For MINGW") target_link_libraries(gpgfrontend_core wsock32) - target_compile_features(gpgfrontend_core PUBLIC cxx_std_17) elseif (APPLE) message(STATUS "Link GPG Static Library For macOS") target_link_libraries(gpgfrontend_core dl) diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt index 12810174..001a776d 100644 --- a/src/ui/CMakeLists.txt +++ b/src/ui/CMakeLists.txt @@ -57,8 +57,9 @@ target_link_libraries(gpgfrontend_ui # link vmime if (NOT LINUX) + # macOS target_link_libraries(gpgfrontend_ui - gpgfrontend_vmime ssl crypto intl iconv) + gpgfrontend_vmime intl iconv) if (MINGW) target_link_libraries(gpgfrontend_ui ws2_32) endif () @@ -81,6 +82,9 @@ target_precompile_headers(gpgfrontend_ui PUBLIC GpgFrontendUI.h) target_include_directories(gpgfrontend_ui PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/gpgfrontend_ui_autogen/include) +# using std c++ 17 +target_compile_features(gpgfrontend_ui PUBLIC cxx_std_17) + # for xcode archive build if (XCODE_BUILD) set_target_properties(gpgfrontend_ui diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index 2ef5d898..618cbaa1 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -209,4 +209,7 @@ add_library(encoding_detect STATIC ${ENCODING_DETECT_SOURCE_CODE}) if (NOT MINGW) remove_definitions(-DDEBUG) add_subdirectory(libarchive) -endif ()
\ No newline at end of file +endif () + +# libconfig +add_subdirectory(libconfig)
\ No newline at end of file diff --git a/third_party/libconfig b/third_party/libconfig new file mode 160000 +Subproject 020a9ce12d1be7ab79ca0674fc957e732ab67f4 |