aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--CMakeLists.txt5
-rw-r--r--src/CMakeLists.txt43
-rw-r--r--src/gpg/CMakeLists.txt7
-rw-r--r--src/smtp/CMakeLists.txt8
-rw-r--r--src/ui/CMakeLists.txt7
-rw-r--r--third_party/easyloggingpp/CMakeLists.txt9
6 files changed, 74 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8a524da7..c362d5f2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -171,6 +171,11 @@ if (APPLE)
set(ENV{Qt5_DIR} /usr/local/opt/qt5/lib/cmake)
+ if(XCODE_BUILD)
+ set(XCODE_CODE_SIGN_IDENTITY "\"${XCODE_CODE_SIGN_IDENTITY}\"")
+ message(STATUS "XCODE_CODE_SIGN_IDENTITY ${XCODE_CODE_SIGN_IDENTITY}")
+ endif()
+
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/third_party
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 346b1524..b2c70ade 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -31,8 +31,13 @@ if (APPLICATION_BUILD)
set(APP_ICON_RESOURCE_WINDOWS "${CMAKE_SOURCE_DIR}/gpgfrontend.rc")
set_property(SOURCE gpgfrontend.rc APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_SOURCE_DIR}/gpgfrontend.ico)
- # Set Binary Output Path
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/release)
+ if(NOT XCODE_BUILD)
+ # Set Binary Output Path
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/release)
+ else()
+ # Set Binary Output Path
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE})
+ endif()
message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
endif ()
@@ -155,7 +160,7 @@ if (APPLICATION_BUILD)
if (${CMAKE_BUILD_TYPE} STREQUAL "Release")
if (MINGW)
add_executable(${AppName} WIN32 ${BASE_SOURCE} ${RESOURCE_FILES} ${QT5_MOCS})
- elseif (APPLE)
+ elseif (APPLE AND NOT XCODE_BUILD)
add_executable(${AppName} MACOSX_BUNDLE ${ICON_RESOURCE} ${BASE_SOURCE} ${RESOURCE_FILES} ${QT5_MOCS})
set_target_properties(${AppName} PROPERTIES
BUNDLE True
@@ -183,7 +188,37 @@ if (APPLICATION_BUILD)
COMMAND /bin/mkdir -p ./gpgfrontend/usr/lib
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
COMMENT "Complement to build the required architecture")
- else ()
+ elseif (APPLE AND XCODE_BUILD)
+ add_executable(${AppName} MACOSX_BUNDLE ${ICON_RESOURCE} ${BASE_SOURCE} ${RESOURCE_FILES} ${QT5_MOCS})
+ set_target_properties(${AppName} PROPERTIES
+ BUNDLE True
+ MACOSX_BUNDLE_GUI_IDENTIFIER pub.gpgfrontend.gpgfrontend
+ MACOSX_BUNDLE_BUNDLE_NAME ${AppName}
+ MACOSX_BUNDLE_LONG_VERSION_STRING ${BUILD_VERSION}
+ MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION}
+ MACOSX_BUNDLE_BUNDLE_VERSION ${BUILD_VERSION}
+ MACOSX_BUNDLE_ICON_FILE "gpgfrontend.icns")
+ add_custom_command(TARGET ${AppName} POST_BUILD
+ COMMAND /bin/rm -rf ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${AppName}.app/Contents/Resources
+ WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+ COMMENT "Deleting Resources in App Bundle")
+ add_custom_command(TARGET ${AppName} POST_BUILD
+ COMMAND /bin/mv -n ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Resources ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${AppName}.app/Contents/
+ WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+ COMMENT "Copying Resources into App Bundle Resource")
+ add_custom_command(TARGET ${AppName} POST_BUILD
+ COMMAND macdeployqt ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${AppName}.app
+ WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+ COMMENT "Resolving Qt Dependency")
+ add_custom_command(TARGET ${AppName} POST_BUILD
+ COMMAND codesign --deep --force --options=runtime -s "${XCODE_CODE_SIGN_IDENTITY}" ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${AppName}.app -v
+ WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+ COMMENT "Signing App Bundle")
+ set_target_properties(${AppName} PROPERTIES
+ XCODE_ATTRIBUTE_INSTALL_PATH "$(LOCAL_APPS_DIR)"
+ XCODE_ATTRIBUTE_SKIP_INSTALL "No"
+ )
+ else()
add_executable(${AppName} ${BASE_SOURCE} ${RESOURCE_FILES} ${QT5_MOCS})
endif ()
else ()
diff --git a/src/gpg/CMakeLists.txt b/src/gpg/CMakeLists.txt
index 19b9f00f..ac01aa26 100644
--- a/src/gpg/CMakeLists.txt
+++ b/src/gpg/CMakeLists.txt
@@ -33,6 +33,13 @@ elseif (APPLE)
${BOOST_LIBS}
${libgpgme} ${libgpg-error} ${libassuan}
dl)
+ if(XCODE_BUILD)
+ set_target_properties(gpg_core
+ PROPERTIES
+ ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
+ LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
+ LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
+ endif()
else ()
find_library(libgpgme NAMES libgpgme.a)
find_library(libgpg-error NAMES libgpg-error.a)
diff --git a/src/smtp/CMakeLists.txt b/src/smtp/CMakeLists.txt
index 8e341f98..afae322e 100644
--- a/src/smtp/CMakeLists.txt
+++ b/src/smtp/CMakeLists.txt
@@ -4,3 +4,11 @@ add_library(smtp STATIC ${SMTP_MIME_SOURCE})
target_link_libraries(smtp
Qt5::Network Qt5::Core)
+
+if(XCODE_BUILD)
+set_target_properties(smtp
+ PROPERTIES
+ ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
+ LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
+ LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
+endif() \ No newline at end of file
diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt
index 529921e0..dd4973be 100644
--- a/src/ui/CMakeLists.txt
+++ b/src/ui/CMakeLists.txt
@@ -19,4 +19,11 @@ target_link_libraries(${GPGFRONTEND_UI_LIB_NAME}
target_include_directories(gpgfrontend-ui PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/${GPGFRONTEND_UI_LIB_NAME}_autogen/include)
+if(XCODE_BUILD)
+set_target_properties(gpgfrontend-ui
+ PROPERTIES
+ ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
+ LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
+ LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
+endif()
target_compile_features(gpgfrontend-ui PUBLIC cxx_std_17) \ No newline at end of file
diff --git a/third_party/easyloggingpp/CMakeLists.txt b/third_party/easyloggingpp/CMakeLists.txt
index 9b96f9c4..40b4bd14 100644
--- a/third_party/easyloggingpp/CMakeLists.txt
+++ b/third_party/easyloggingpp/CMakeLists.txt
@@ -1,4 +1,11 @@
aux_source_directory(. EASY_LOGGING_CPP_SOURCE)
add_library(easy_logging_pp STATIC ${EASY_LOGGING_CPP_SOURCE})
-target_link_libraries(easy_logging_pp stdc++) \ No newline at end of file
+target_link_libraries(easy_logging_pp stdc++)
+if(XCODE_BUILD)
+set_target_properties(easy_logging_pp
+ PROPERTIES
+ ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
+ LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}
+ LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
+endif() \ No newline at end of file