aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2023-10-18 13:53:16 +0000
committerSaturneric <[email protected]>2023-10-18 13:53:16 +0000
commitedf86e2e65ac2cbcde73fa0afe31a1bf5150eb38 (patch)
tree72cbe2826336440357bcb4d48636c826e05daee9
parentfeat: simplify the thread system and improve its stability (diff)
downloadGpgFrontend-edf86e2e65ac2cbcde73fa0afe31a1bf5150eb38.tar.gz
GpgFrontend-edf86e2e65ac2cbcde73fa0afe31a1bf5150eb38.zip
fix: solve build issues on macOS
Diffstat (limited to '')
-rw-r--r--cmake/FindGpgme.cmake20
-rw-r--r--src/CMakeLists.txt4
-rw-r--r--src/core/CMakeLists.txt4
3 files changed, 19 insertions, 9 deletions
diff --git a/cmake/FindGpgme.cmake b/cmake/FindGpgme.cmake
index ffb14b7f..7e616456 100644
--- a/cmake/FindGpgme.cmake
+++ b/cmake/FindGpgme.cmake
@@ -418,15 +418,17 @@ if ( GPGME_PTH_FOUND )
set( _gpgme_flavours "${_gpgme_flavours} pth" )
endif()
-set(GPGME_LIBRARIES "")
-
-# determine the library in one of the found flavors, can be reused e.g. by FindQgpgme.cmake, Alex
-foreach(_currentFlavour vanilla glib qt pth pthread)
- if(NOT GPGME_LIBRARY_DIR)
- get_filename_component(GPGME_LIBRARY_DIR "${_gpgme_${_currentFlavour}_lib}" PATH)
- list(APPEND GPGME_LIBRARIES "${_gpgme_${_currentFlavour}_lib}")
- endif()
-endforeach()
+if(NOT GPGME_LIBRARIES)
+ # determine the library in one of the found flavors, can be reused e.g. by FindQgpgme.cmake, Alex
+ set(GPGME_LIBRARIES "")
+ foreach(_currentFlavour vanilla glib qt pth pthread)
+ if(NOT GPGME_LIBRARY_DIR)
+ get_filename_component(GPGME_LIBRARY_DIR "${_gpgme_${_currentFlavour}_lib}" PATH)
+ list(APPEND GPGME_LIBRARIES "${_gpgme_${_currentFlavour}_lib}")
+ endif()
+ endforeach()
+
+endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Gpgme
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4182b764..f828b763 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -33,6 +33,10 @@ else()
PATHS ${BOOST_ROOT} NO_DEFAULT_PATH)
endif()
+if(APPLE)
+ add_compile_definitions("_GNU_SOURCE")
+endif()
+
# Introduce GpgME
find_package(Gpgme REQUIRED)
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index bd0c28b3..c8edc8d7 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -81,7 +81,11 @@ endif ()
target_link_libraries(gpgfrontend_core PRIVATE spdlog)
# link libarchive
+if(APPLE)
+ set(LibArchive_INCLUDE_DIR "/usr/local/opt/libarchive/include")
+endif()
find_package(LibArchive REQUIRED)
+target_include_directories(gpgfrontend_core PRIVATE ${LibArchive_INCLUDE_DIR})
target_link_libraries(gpgfrontend_core PRIVATE archive)
# link json