diff --git a/Sources/Plasma/Apps/plClient/CMakeLists.txt b/Sources/Plasma/Apps/plClient/CMakeLists.txt index b5b724fde7..3b5272fda3 100644 --- a/Sources/Plasma/Apps/plClient/CMakeLists.txt +++ b/Sources/Plasma/Apps/plClient/CMakeLists.txt @@ -90,7 +90,7 @@ if(WIN32) win32/res/headspin.ico ) elseif(APPLE) - set(plClient_SOURCES ${plClient_SOURCES} + list(APPEND plClient_SOURCES Mac-Cocoa/main.mm Mac-Cocoa/NSString+StringTheory.mm Mac-Cocoa/PLSKeyboardEventMonitor.mm @@ -100,7 +100,7 @@ elseif(APPLE) Mac-Cocoa/PLSPatcher.mm Mac-Cocoa/PLSServerStatus.mm ) - set(plClient_HEADERS ${plClient_HEADERS} + list(APPEND plClient_HEADERS Mac-Cocoa/NSString+StringTheory.h Mac-Cocoa/PLSKeyboardEventMonitor.h Mac-Cocoa/PLSView.h @@ -109,17 +109,13 @@ elseif(APPLE) Mac-Cocoa/PLSPatcher.h Mac-Cocoa/PLSServerStatus.h ) - set(RESOURCES + list(APPEND plClient_RESOURCES + Mac-Cocoa/Assets.xcassets + Mac-Cocoa/banner.png + Mac-Cocoa/banner@2x.png Mac-Cocoa/MainMenu.xib Mac-Cocoa/PLSLoginWindowController.xib Mac-Cocoa/PLSPatcherWindowController.xib - Mac-Cocoa/banner.png - Mac-Cocoa/banner@2x.png - win32/res/Dirt.ICO - ) - - list(APPEND plClient_RESOURCES - win32/res/Dirt.ICO ) else() list(APPEND plClient_SOURCES @@ -127,10 +123,15 @@ else() ) endif() +plasma_executable(plClient CLIENT INSTALL_PDB + SOURCES + ${plClient_SOURCES} ${plClient_HEADERS} + ${plClient_TEXT} ${plClient_RESOURCES} +) + if(APPLE) - plasma_executable(plClient CLIENT INSTALL_PDB SOURCES ${plClient_SOURCES} ${plClient_HEADERS} ${RESOURCES}) + target_sources(plClient PRIVATE ${plClient_IBSOURCES}) set_target_properties(plClient PROPERTIES - BUNDLE TRUE MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Mac-Cocoa/Info.plist.in" # Hard coding the app name here intentionally. # Should prevent macOS from tripping over secured resources being @@ -141,42 +142,28 @@ if(APPLE) MACOSX_BUNDLE_GUI_IDENTIFIER org.Huru.UruExplorer MACOSX_BUNDLE_BUNDLE_VERSION "0.1" MACOSX_BUNDLE_SHORT_VERSION_STRING "0.1" + RESOURCE "${plClient_RESOURCES} ${plClient_IBSOURCES}" XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME AppIcon XCODE_ATTRIBUTE_MTL_FAST_MATH "YES" XCODE_ATTRIBUTE_MTL_ENABLE_DEBUG_INFO[variant=Debug] "INCLUDE_SOURCE" XCODE_ATTRIBUTE_MTL_ENABLE_DEBUG_INFO[variant=RelWithDebInfo] "INCLUDE_SOURCE" XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS[variant=Debug] "YES" XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS[variant=RelWithDebInfo] "YES" - XCODE_ATTRIBUTE_MTL_HEADER_SEARCH_PATHS ${Plasma_SOURCE_DIR}/Sources/Plasma/NucleusLib/inc/ + XCODE_ATTRIBUTE_MTL_HEADER_SEARCH_PATHS "${Plasma_SOURCE_DIR}/Sources/Plasma/NucleusLib/inc/" XCODE_ATTRIBUTE_INSTALL_PATH "/Applications" XCODE_ATTRIBUTE_SKIP_INSTALL "NO" - XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${CMAKE_CURRENT_SOURCE_DIR}/Mac-Cocoa/plClient.entitlements + XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${CMAKE_CURRENT_SOURCE_DIR}/Mac-Cocoa/plClient.entitlements" XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME "YES" + XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "YES" ) target_compile_options(plClient PRIVATE -fobjc-arc) - target_sources(plClient PRIVATE Mac-Cocoa/Assets.xcassets) - set_source_files_properties(Mac-Cocoa/Assets.xcassets ${RESOURCES} PROPERTIES - MACOSX_PACKAGE_LOCATION Resources - ) - target_link_libraries(plClient PRIVATE "-framework Cocoa") - target_link_libraries(plClient PRIVATE "-framework QuartzCore") - install( - TARGETS plClient - DESTINATION client - ) - + if(PLASMA_APPLE_DEVELOPMENT_TEAM_ID) set_target_properties(plClient PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Apple Development" XCODE_ATTRIBUTE_DEVELOPMENT_TEAM ${PLASMA_APPLE_DEVELOPMENT_TEAM_ID} ) endif() -else() - plasma_executable(plClient WIN32 CLIENT INSTALL_PDB - SOURCES - ${plClient_SOURCES} ${plClient_HEADERS} - ${plClient_TEXT} ${plClient_RESOURCES} - ) endif() if(PLASMA_BUILD_RESOURCE_DAT) @@ -240,6 +227,8 @@ target_link_libraries( $<$:pfDXPipeline> $<$:pfGLPipeline> CURL::libcurl + "$<$:-framework Cocoa>" + "$<$:-framework QuartzCore>" ) target_include_directories(plClient PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}") @@ -269,4 +258,4 @@ endif() source_group("Source Files" FILES ${plClient_SOURCES}) source_group("Header Files" FILES ${plClient_HEADERS}) source_group("Text" FILES ${plClient_TEXT}) -source_group("Windows Resource Files" FILES ${plClient_RESOURCES}) +source_group("Resources" FILES ${plClient_RESOURCES}) diff --git a/cmake/PlasmaTargets.cmake b/cmake/PlasmaTargets.cmake index 18a32eb5b2..d79fd1b1c2 100644 --- a/cmake/PlasmaTargets.cmake +++ b/cmake/PlasmaTargets.cmake @@ -27,12 +27,9 @@ function(plasma_executable TARGET) if(_pex_WIN32) list(APPEND addexe_args WIN32) endif() - if(_pex_QT_GUI) + if(_pex_QT_GUI OR _pex_CLIENT) list(APPEND addexe_args WIN32 MACOSX_BUNDLE) endif() - if(_pex_CLIENT) - list(APPEND addexe_args MACOSX_BUNDLE) - endif() if(_pex_EXCLUDE_FROM_ALL) list(APPEND addexe_args EXCLUDE_FROM_ALL) endif()