Skip to content

Commit

Permalink
Fixes (#38) (#39)
Browse files Browse the repository at this point in the history
* fix indlude dir install

* align naming

* unset cpack variables from inherit preset
  • Loading branch information
EddyTheCo authored Dec 28, 2024
1 parent e6a1550 commit 1cdc987
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
40 changes: 20 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ if(OPENSSL_FOUND
AND Qt6_FOUND)
qt_standard_project_setup()

add_library(vault include/esterv/crypto/vault.hpp src/vault.cpp)
add_library(Esterv::vault ALIAS vault)
set_target_properties(vault PROPERTIES VERSION ${VERSION} SOVERSION
add_library(Vault include/esterv/crypto/vault.hpp src/vault.cpp)
add_library(Esterv::Vault ALIAS Vault)
set_target_properties(Vault PROPERTIES VERSION ${VERSION} SOVERSION
${VERSION_MAJOR})
if(USE_QML)
qt6_add_qml_module(
vault
Vault
URI
Esterv.Crypto.Vault
VERSION
Expand All @@ -96,11 +96,11 @@ if(OPENSSL_FOUND
${CMAKE_BINARY_DIR}/Esterv/Crypto/Vault
IMPORT_PATH
${CMAKE_BINARY_DIR})
add_library(Esterv::vaultplugin ALIAS vaultplugin)
target_link_libraries(vault PUBLIC Qt6::Gui Qt6::Quick)
target_compile_definitions(vault PRIVATE USE_QML)
add_library(Esterv::Vaultplugin ALIAS Vaultplugin)
target_link_libraries(Vault PUBLIC Qt6::Gui Qt6::Quick)
target_compile_definitions(Vault PRIVATE USE_QML)
target_include_directories(
vault PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/esterv/crypto)
Vault PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include/esterv/crypto)

install(
TARGETS ${out_targets_var}
Expand All @@ -114,7 +114,7 @@ if(OPENSSL_FOUND
DESTINATION ${CMAKE_INSTALL_LIBDIR}/Esterv/Crypto
COMPONENT ${PROJECT_NAME}-qml)
install(
TARGETS vaultplugin
TARGETS Vaultplugin
EXPORT ${PROJECT_NAME}-config
DESTINATION ${CMAKE_INSTALL_LIBDIR}/Esterv/Crypto/Vault
COMPONENT ${PROJECT_NAME}-qml
Expand All @@ -123,40 +123,40 @@ if(OPENSSL_FOUND
endif(USE_QML)

target_include_directories(
vault PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
Vault PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")

target_link_libraries(vault PUBLIC Qt6::Core Qt6::Network OpenSSL::Crypto)
target_compile_definitions(vault PRIVATE WINDOWS_VAULT)
target_link_libraries(Vault PUBLIC Qt6::Core Qt6::Network OpenSSL::Crypto)
target_compile_definitions(Vault PRIVATE WINDOWS_VAULT)
if(EMSCRIPTEN)
target_compile_definitions(vault PRIVATE USE_EMSCRIPTEN)
target_compile_definitions(Vault PRIVATE USE_EMSCRIPTEN)
endif(EMSCRIPTEN)

if(NOT EMSCRIPTEN AND NOT ANDROID)
add_executable(vaultCli src/vaultCli.cpp)
target_link_libraries(vaultCli PRIVATE vault)
set_target_properties(vaultCli PROPERTIES WIN32_EXECUTABLE ON MACOSX_BUNDLE
add_executable(VaultCli src/vault_cli.cpp)
target_link_libraries(VaultCli PRIVATE Vault)
set_target_properties(VaultCli PROPERTIES WIN32_EXECUTABLE ON MACOSX_BUNDLE
ON)
install(
TARGETS vaultCli
TARGETS VaultCli
EXPORT ${PROJECT_NAME}-config
COMPONENT ${PROJECT_NAME}-cli
BUNDLE DESTINATION . COMPONENT ${PROJECT_NAME}-cli)
if(QTDEPLOY)
qt_generate_deploy_app_script(TARGET vaultCli OUTPUT_SCRIPT deploy_script)
qt_generate_deploy_app_script(TARGET VaultCli OUTPUT_SCRIPT deploy_script)
install(SCRIPT ${deploy_script} COMPONENT ${PROJECT_NAME}-cli)
endif(QTDEPLOY)
endif(NOT EMSCRIPTEN AND NOT ANDROID)

install(
TARGETS vault
TARGETS Vault
EXPORT ${PROJECT_NAME}-config
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT ${PROJECT_NAME}
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT ${PROJECT_NAME})
install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Esterv
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT ${PROJECT_NAME}-dev)
build_exports()
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
Expand Down
4 changes: 2 additions & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@
"configurePreset": "default-develop",
"variables": {
"CPACK_COMPONENTS_GROUPING": "ALL_COMPONENTS_IN_ONE",
"CPACK_PACKAGE_CONTACT": "[email protected]",
"CPACK_PACKAGE_VENDOR": "estervtech"
"CPACK_ARCHIVE_COMPONENT_INSTALL": "OFF",
"CPACK_COMPONENTS_ALL": ""
}
}
]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(EstervVault)
target_link_libraries(<target> <PRIVATE|PUBLIC|INTERFACE> Esterv::vault)
target_link_libraries(<target> <PRIVATE|PUBLIC|INTERFACE> Esterv::Vault)
```
If you want to use the QML module also add
```
target_link_libraries(<target> <PRIVATE|PUBLIC|INTERFACE> $<$<STREQUAL:$<TARGET_PROPERTY:Esterv::vault,TYPE>,STATIC_LIBRARY>:Esterv::vaultplugin>)
target_link_libraries(<target> <PRIVATE|PUBLIC|INTERFACE> $<$<STREQUAL:$<TARGET_PROPERTY:Esterv::Vault,TYPE>,STATIC_LIBRARY>:Esterv::Vaultplugin>)
```

## API reference
Expand Down
4 changes: 2 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ if(USE_QML AND BUILD_EXAMPLES)
target_link_libraries(
${example}
PRIVATE
vault
$<$<STREQUAL:$<TARGET_PROPERTY:vault,TYPE>,STATIC_LIBRARY>:vaultplugin>)
Vault
$<$<STREQUAL:$<TARGET_PROPERTY:Vault,TYPE>,STATIC_LIBRARY>:Vaultplugin>)

set_target_properties(${example} PROPERTIES WIN32_EXECUTABLE ON
MACOSX_BUNDLE ON)
Expand Down
File renamed without changes.

0 comments on commit 1cdc987

Please sign in to comment.