From 49b783febd2f12c8256c4d29a3d4c779211aee74 Mon Sep 17 00:00:00 2001 From: Eduardo Gonzalez Lazo <30321688+EddyTheCo@users.noreply.github.com> Date: Mon, 25 Mar 2024 16:15:39 +0100 Subject: [PATCH 1/6] use common cmake functions --- CMakeLists.txt | 42 ++---------------------------------------- 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 79f8577..4ab3f91 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,52 +133,14 @@ if(OPENSSL_FOUND AND TARGET OpenSSL::Crypto AND Qt6_FOUND) DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT vault ) - install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/ - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Esterv - COMPONENT vault - ) - - install(EXPORT ${PROJECT_NAME}-config - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} - NAMESPACE ${PROJECT_NAME}:: - COMPONENT ${PROJECT_NAME} - ) - include(CMakePackageConfigHelpers) - configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in - "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" - INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} - ) - write_basic_package_version_file( - "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" - VERSION ${VERSION} - COMPATIBILITY SameMajorVersion - ) - install(FILES - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} - COMPONENT vault - ) - export(EXPORT ${PROJECT_NAME}-config - FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" - ) + build_exports() if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) add_subdirectory(examples) - set(cpack_file_name "${PROJECT_NAME}-v${SEMVER}-${CMAKE_SYSTEM_NAME}_${CMAKE_SYSTEM_VERSION}-${CMAKE_SYSTEM_PROCESSOR}-${CMAKE_CXX_COMPILER_ID}") - if(NOT BUILD_SHARED_LIBS) - set(cpack_file_name "${cpack_file_name}-static") - endif(NOT BUILD_SHARED_LIBS) - set(CPACK_PACKAGE_FILE_NAME ${cpack_file_name}) - include(CPack) - include(CPackIFW) - cpack_add_component(vault) - cpack_ifw_configure_component(vault LICENSES "License" ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE) - cpack_ifw_add_repository("Repo" URL "${REPO_URL}/packages/${CMAKE_SYSTEM_NAME}/" ) + build_cpack() endif(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) endif(OPENSSL_FOUND AND TARGET OpenSSL::Crypto AND Qt6_FOUND) - if(BUILD_DOCS) build_docs() endif() From 7ce1ef959b0bebac040d2b776c2868c92da40141 Mon Sep 17 00:00:00 2001 From: Eduardo Gonzalez Lazo <30321688+EddyTheCo@users.noreply.github.com> Date: Mon, 25 Mar 2024 16:25:24 +0100 Subject: [PATCH 2/6] fixed typo --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ab3f91..36aefcd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -133,6 +133,10 @@ if(OPENSSL_FOUND AND TARGET OpenSSL::Crypto AND Qt6_FOUND) DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT vault ) + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Esterv + COMPONENT ${PROJECT_NAME} + ) build_exports() if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) add_subdirectory(examples) From 2c88f082dd9f8c3193486073855bbddd03fdd195 Mon Sep 17 00:00:00 2001 From: Eduardo Gonzalez Lazo <30321688+EddyTheCo@users.noreply.github.com> Date: Tue, 26 Mar 2024 08:31:57 +0100 Subject: [PATCH 3/6] fixed typo --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9a67ba2..4b9d323 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,8 @@ include(FetchContent) FetchContent_Declare( QtVault GIT_REPOSITORY https://github.com/EddyTheCo/QVault.git - GIT_TAG v0.1.0 - FIND_PACKAGE_ARGS 0.1 CONFIG + GIT_TAG vMAJOR.MINOR.PATCH + FIND_PACKAGE_ARGS MAJOR.MINOR CONFIG ) FetchContent_MakeAvailable(QtVault) From fd2034944c69e8c95fb900038819461537f9f50c Mon Sep 17 00:00:00 2001 From: Eduardo Gonzalez Lazo <30321688+EddyTheCo@users.noreply.github.com> Date: Tue, 26 Mar 2024 11:33:15 +0100 Subject: [PATCH 4/6] align name --- CMakeLists.txt | 28 ++++++++++++++-------------- README.md | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 36aefcd..3557658 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,11 +63,11 @@ endif(NOT OPENSSL_FOUND) if(OPENSSL_FOUND AND TARGET OpenSSL::Crypto AND Qt6_FOUND) qt_standard_project_setup() - add_library(vault include/vault.hpp src/vault.cpp) - add_library(${PROJECT_NAME}::vault ALIAS vault) - set_target_properties(vault PROPERTIES VERSION ${VERSION} SOVERSION ${VERSION_MAJOR}) + add_library(qvault include/vault.hpp src/vault.cpp) + add_library(${PROJECT_NAME}::qvault ALIAS qvault) + set_target_properties(qvault PROPERTIES VERSION ${VERSION} SOVERSION ${VERSION_MAJOR}) if(USE_QML) - qt6_add_qml_module(vault + qt6_add_qml_module(qvault URI Esterv.Utils.Vault VERSION 1.0 RESOURCE_PREFIX @@ -77,9 +77,9 @@ if(OPENSSL_FOUND AND TARGET OpenSSL::Crypto AND Qt6_FOUND) ${CMAKE_BINARY_DIR}/Esterv/Utils/Vault IMPORT_PATH ${CMAKE_BINARY_DIR} ) - add_library(${PROJECT_NAME}::vaultplugin ALIAS vaultplugin) - target_link_libraries(vault PUBLIC Qt6::Gui Qt6::Quick) - target_compile_definitions(vault PRIVATE USE_QML) + add_library(${PROJECT_NAME}::qvaultplugin ALIAS qvaultplugin) + target_link_libraries(qvault PUBLIC Qt6::Gui Qt6::Quick) + target_compile_definitions(qvault PRIVATE USE_QML) install(TARGETS ${out_targets_var} EXPORT ${PROJECT_NAME}-config @@ -90,7 +90,7 @@ if(OPENSSL_FOUND AND TARGET OpenSSL::Crypto AND Qt6_FOUND) DESTINATION ${CMAKE_INSTALL_LIBDIR}/Esterv/Utils COMPONENT vault ) - install(TARGETS vaultplugin + install(TARGETS qvaultplugin EXPORT ${PROJECT_NAME}-config DESTINATION ${CMAKE_INSTALL_LIBDIR}/Esterv/Utils/Vault COMPONENT vault @@ -98,18 +98,18 @@ if(OPENSSL_FOUND AND TARGET OpenSSL::Crypto AND Qt6_FOUND) endif(USE_QML) - target_include_directories(vault PUBLIC $ + target_include_directories(qvault PUBLIC $ "$") - target_link_libraries(vault PUBLIC Qt6::Core Qt6::Network OpenSSL::Crypto) - target_compile_definitions(vault PRIVATE WINDOWS_QVAULT) + target_link_libraries(qvault PUBLIC Qt6::Core Qt6::Network OpenSSL::Crypto) + target_compile_definitions(qvault PRIVATE WINDOWS_QVAULT) if(EMSCRIPTEN) - target_compile_definitions(vault PRIVATE USE_EMSCRIPTEN) + target_compile_definitions(qvault PRIVATE USE_EMSCRIPTEN) endif(EMSCRIPTEN) if(NOT EMSCRIPTEN AND NOT ANDROID) add_executable(QVaultCli src/QVaultCli.cpp) - target_link_libraries(QVaultCli PRIVATE vault) + target_link_libraries(QVaultCli PRIVATE qvault) add_executable(${PROJECT_NAME}::QVaultCli ALIAS QVaultCli) set_target_properties(QVaultCli PROPERTIES WIN32_EXECUTABLE ON @@ -128,7 +128,7 @@ if(OPENSSL_FOUND AND TARGET OpenSSL::Crypto AND Qt6_FOUND) endif(NOT EMSCRIPTEN AND NOT ANDROID) - install(TARGETS vault + install(TARGETS qvault EXPORT ${PROJECT_NAME}-config DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT vault diff --git a/README.md b/README.md index 4b9d323..83fb67d 100644 --- a/README.md +++ b/README.md @@ -44,11 +44,11 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(QtVault) -target_link_libraries( QtVault::vault) +target_link_libraries( QtVault::qvault) ``` If you want to use the QML module also add ``` -$<$,STATIC_LIBRARY>:QtVault::vaultplugin> +$<$,STATIC_LIBRARY>:QtVault::qvaultplugin> ``` ## API reference From 0b6b2f7f35a6bc6b2684d085d7973fea7e94c0f6 Mon Sep 17 00:00:00 2001 From: Eduardo Gonzalez Lazo <30321688+EddyTheCo@users.noreply.github.com> Date: Thu, 28 Mar 2024 08:57:21 +0100 Subject: [PATCH 5/6] install qt dependencies if qtdeploy is set --- CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3557658..dc45e2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,11 +120,13 @@ if(OPENSSL_FOUND AND TARGET OpenSSL::Crypto AND Qt6_FOUND) RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT vaultCli ) - qt_generate_deploy_app_script( - TARGET QVaultCli - OUTPUT_SCRIPT deploy_script - ) - install(SCRIPT ${deploy_script}) + if(QTDEPLOY) + qt_generate_deploy_app_script( + TARGET QVaultCli + OUTPUT_SCRIPT deploy_script + ) + install(SCRIPT ${deploy_script}) + endif(QTDEPLOY) endif(NOT EMSCRIPTEN AND NOT ANDROID) From e8532154d4414bf729cb94f3f23f25bef1a835f8 Mon Sep 17 00:00:00 2001 From: Eduardo Gonzalez Lazo <30321688+EddyTheCo@users.noreply.github.com> Date: Thu, 28 Mar 2024 12:21:04 +0100 Subject: [PATCH 6/6] used versioned common and install qtdependencies for QVaultcli --- .github/workflows/build-test-install.yml | 6 +++--- CMakeLists.txt | 10 ++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-test-install.yml b/.github/workflows/build-test-install.yml index b6ee909..dd5bd43 100644 --- a/.github/workflows/build-test-install.yml +++ b/.github/workflows/build-test-install.yml @@ -13,16 +13,16 @@ jobs: matrix: os: [ubuntu-latest,macos-latest,windows-latest] - uses: EddyTheCo/Common/.github/workflows/build-test-install.yml@use_IFW + uses: EddyTheCo/Common/.github/workflows/build-test-install.yml@v0.3.0 with: os: ${{ matrix.os }} qtVersion: '6.6.0' - cmakeArgs: "-DCPACK_PACKAGE_CONTACT=estervtech@gmail.com -DREPO_URL=https://eddytheco.github.io/QVault -DCPACK_PACKAGE_VENDOR=estervtech" + cmakeArgs: " -DQTDEPLOY=ON -DCPACK_PACKAGE_CONTACT=estervtech@gmail.com -DREPO_URL=https://eddytheco.github.io/QVault -DCPACK_PACKAGE_VENDOR=estervtech" test: false build_doxygen: if: startsWith(github.ref, 'refs/tags/v') - uses: EddyTheCo/Common/.github/workflows/build-docs.yml@use_IFW + uses: EddyTheCo/Common/.github/workflows/build-docs.yml@v0.3.0 release: if: startsWith(github.ref, 'refs/tags/v') diff --git a/CMakeLists.txt b/CMakeLists.txt index dc45e2f..2be13ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ include(FetchContent) FetchContent_Declare( ccommon GIT_REPOSITORY https://github.com/EddyTheCo/Common.git - GIT_TAG use_IFW + GIT_TAG v0.3.0 ) FetchContent_MakeAvailable(ccommon) version_from_git( @@ -115,17 +115,15 @@ if(OPENSSL_FOUND AND TARGET OpenSSL::Crypto AND Qt6_FOUND) WIN32_EXECUTABLE ON MACOSX_BUNDLE ON ) - install(TARGETS QVaultCli - BUNDLE DESTINATION . - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - COMPONENT vaultCli + install(TARGETS QVaultCli COMPONENT vaultCli + BUNDLE DESTINATION . COMPONENT vaultCli ) if(QTDEPLOY) qt_generate_deploy_app_script( TARGET QVaultCli OUTPUT_SCRIPT deploy_script ) - install(SCRIPT ${deploy_script}) + install(SCRIPT ${deploy_script} COMPONENT vaultCli) endif(QTDEPLOY) endif(NOT EMSCRIPTEN AND NOT ANDROID)