Skip to content

Commit

Permalink
Merge branch 'vcpkg_bindings' into vcpkg_bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn authored Apr 16, 2024
2 parents 6646e7f + f54ce2b commit 2aa8256
Show file tree
Hide file tree
Showing 7 changed files with 827 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ if (WITH_CORE AND WITH_BINDINGS)
include(SIPMacros)

set(SIP_INCLUDES ${PYQT_SIP_DIR} ${CMAKE_SOURCE_DIR}/python)
set(SIP_CONCAT_PARTS 26)
set(SIP_CONCAT_PARTS 12)

if (NOT BINDINGS_GLOBAL_INSTALL)
set(Python_SITEARCH ${QGIS_DATA_DIR}/python)
Expand Down
72 changes: 72 additions & 0 deletions vcpkg/ports/qca/0001-fix-path-for-vcpkg.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
diff --git "a/CMakeLists.txt" "b/CMakeLists.txt"
index 1f84c2c9e..f72ee9d8d 100644
--- "a/CMakeLists.txt"
+++ "b/CMakeLists.txt"
@@ -58,6 +58,7 @@ set(QCA_SUFFIX "qt5")
if(NOT BUILD_SHARED_LIBS OR QT_IS_STATIC)
set(STATIC_PLUGINS ON)
add_definitions(-DQT_STATICPLUGIN)
+ add_definitions(-DQCA_STATIC)
set(PLUGIN_TYPE "STATIC")
else()
set(PLUGIN_TYPE "MODULE")
@@ -266,10 +267,17 @@ if(DEVELOPER_MODE)
add_definitions(-DDEVELOPER_MODE)

# To prefer plugins from build tree when run qca from build tree
- file(WRITE ${CMAKE_BINARY_DIR}/bin/qt.conf
-"[Paths]
-Plugins=${CMAKE_BINARY_DIR}/lib/${QCA_LIB_NAME}
-")
+ if(NOT BUILD_SHARED_LIBS OR QT_IS_STATIC)
+ file(WRITE ${CMAKE_BINARY_DIR}/bin/qt.conf
+ "[Paths]
+ Plugins=${CMAKE_BINARY_DIR}/lib/${QCA_LIB_NAME}
+ ")
+ else()
+ file(WRITE ${CMAKE_BINARY_DIR}/bin/qt.conf
+ "[Paths]
+ Plugins=${CMAKE_BINARY_DIR}/bin/${QCA_LIB_NAME}
+ ")
+ endif()
endif()

if (APPLE)
@@ -309,7 +317,7 @@ else()
set( qca_CERTSTORE "${CMAKE_CURRENT_SOURCE_DIR}/certs/rootcerts.pem")
# note that INSTALL_FILES targets are relative to the current installation prefix...
if(NOT DEVELOPER_MODE)
- install(FILES "${qca_CERTSTORE}" DESTINATION "${QCA_PREFIX_INSTALL_DIR}/certs")
+ install(FILES "${qca_CERTSTORE}" DESTINATION "${QCA_PREFIX_INSTALL_DIR}/share/qca/certs")
endif()
endif()
message(STATUS "certstore path: " ${qca_CERTSTORE})
@@ -390,10 +398,10 @@ endif()
include(CMakePackageConfigHelpers)
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/QcaConfig.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}Config.cmake"
- INSTALL_DESTINATION ${QCA_LIBRARY_INSTALL_DIR}/cmake/${QCA_CONFIG_NAME_BASE}
+ "${CMAKE_BINARY_DIR}/share/qca/cmake/${QCA_CONFIG_NAME_BASE}Config.cmake"
+ INSTALL_DESTINATION ${CMAKE_BINARY_DIR}/share/qca/cmake
)
-write_basic_config_version_file("${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}ConfigVersion.cmake" VERSION ${QCA_LIB_VERSION_STRING} COMPATIBILITY AnyNewerVersion)
+write_basic_config_version_file("${CMAKE_BINARY_DIR}/share/qca/cmake/${QCA_CONFIG_NAME_BASE}ConfigVersion.cmake" VERSION ${QCA_LIB_VERSION_STRING} COMPATIBILITY AnyNewerVersion)

if(NOT DEVELOPER_MODE)

@@ -461,10 +469,10 @@ if(NOT DEVELOPER_MODE)
endif()
endif()

- install(EXPORT ${QCA_CONFIG_NAME_BASE}Targets DESTINATION ${QCA_LIBRARY_INSTALL_DIR}/cmake/${QCA_CONFIG_NAME_BASE} FILE ${QCA_CONFIG_NAME_BASE}Targets.cmake)
+ install(EXPORT ${QCA_CONFIG_NAME_BASE}Targets DESTINATION ${QCA_PREFIX_INSTALL_DIR}/share/qca/cmake FILE ${QCA_CONFIG_NAME_BASE}Targets.cmake)
install(FILES
- "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}Config.cmake"
- "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/${QCA_CONFIG_NAME_BASE}/${QCA_CONFIG_NAME_BASE}ConfigVersion.cmake"
- DESTINATION ${QCA_LIBRARY_INSTALL_DIR}/cmake/${QCA_CONFIG_NAME_BASE}
+ "${CMAKE_BINARY_DIR}/share/qca/cmake/${QCA_CONFIG_NAME_BASE}Config.cmake"
+ "${CMAKE_BINARY_DIR}/share/qca/cmake/${QCA_CONFIG_NAME_BASE}ConfigVersion.cmake"
+ DESTINATION ${QCA_PREFIX_INSTALL_DIR}/share/qca/cmake
)
endif()
26 changes: 26 additions & 0 deletions vcpkg/ports/qca/0002-fix-build-error.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 8d67288a3dde7e535ff747715f96f98282a3bf67 Mon Sep 17 00:00:00 2001
From: Matthias Kuhn <[email protected]>
Date: Fri, 3 Dec 2021 15:17:25 +0100
Subject: [PATCH] Ifdef codecs

---
cmake/modules/QcaMacro.cmake | 9 ---------
plugins/qca-ossl/qca-ossl.cpp | 6 ++++++
2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/cmake/modules/QcaMacro.cmake b/cmake/modules/QcaMacro.cmake
index 80af6e84..ba86310d 100644
--- a/cmake/modules/QcaMacro.cmake
+++ b/cmake/modules/QcaMacro.cmake
@@ -65,10 +65,6 @@ macro(add_qca_test TARGET DESCRIPTION)
endmacro(add_qca_test)

macro(install_pdb TARGET INSTALL_PATH)
- if(MSVC)
- install(FILES $<TARGET_PDB_FILE:${TARGET}> DESTINATION ${INSTALL_PATH} CONFIGURATIONS Debug)
- install(FILES $<TARGET_PDB_FILE:${TARGET}> DESTINATION ${INSTALL_PATH} CONFIGURATIONS RelWithDebInfo)
- endif()
endmacro(install_pdb)

macro(normalize_path PATH)

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From f32f5ae8b8b49653bfff87f2f882862bcaa8c3f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D9=85=D9=87=D8=AF=D9=8A=20=D8=B4=D9=8A=D9=86=D9=88=D9=86?=
=?UTF-8?q?=20=28Mehdi=20Chinoune=29?= <[email protected]>
Date: Mon, 20 Mar 2023 16:21:18 +0100
Subject: [PATCH] Define NOMINMAX to fix building qca-botan plugin with MSVC

---
plugins/qca-botan/CMakeLists.txt | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/plugins/qca-botan/CMakeLists.txt b/plugins/qca-botan/CMakeLists.txt
index 11c0d20..9b8b978 100644
--- a/plugins/qca-botan/CMakeLists.txt
+++ b/plugins/qca-botan/CMakeLists.txt
@@ -11,6 +11,10 @@ if(BOTAN_FOUND)
set(QCA_BOTAN_SOURCES qca-botan.cpp)
add_library(qca-botan ${PLUGIN_TYPE} ${QCA_BOTAN_SOURCES})

+ if(MSVC)
+ target_compile_definitions(qca-botan PRIVATE NOMINMAX)
+ endif()
+
if(APPLE AND ${PLUGIN_TYPE} STREQUAL "MODULE")
set_property(TARGET qca-botan PROPERTY SUFFIX ".dylib")
endif()
--
2.40.0.windows.1

Loading

0 comments on commit 2aa8256

Please sign in to comment.