mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
xCode version check
Signed-off-by: Richard Voigtmann <richard.v.voigtmann@gmail.com>
This commit is contained in:
parent
e125f4767f
commit
e46b0335ab
1 changed files with 37 additions and 21 deletions
|
|
@ -418,30 +418,46 @@ if(UNIX AND APPLE)
|
||||||
|
|
||||||
find_program(ACTOOL_EXE actool DOC "Path to the apple asset catalog compiler")
|
find_program(ACTOOL_EXE actool DOC "Path to the apple asset catalog compiler")
|
||||||
if(ACTOOL_EXE)
|
if(ACTOOL_EXE)
|
||||||
set(ASSETS_OUT_DIR "${CMAKE_BINARY_DIR}/program_info")
|
execute_process(
|
||||||
set(GENERATED_ASSETS_CAR "${ASSETS_OUT_DIR}/Assets.car")
|
COMMAND xcodebuild -version
|
||||||
set(ICON_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_Branding_MAC_ICON}")
|
OUTPUT_VARIABLE XCODE_VERSION_OUTPUT
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
add_custom_command(
|
|
||||||
OUTPUT "${GENERATED_ASSETS_CAR}"
|
|
||||||
COMMAND ${ACTOOL_EXE} "${ICON_SOURCE}"
|
|
||||||
--compile "${ASSETS_OUT_DIR}"
|
|
||||||
--output-partial-info-plist /dev/null
|
|
||||||
--app-icon PrismLauncher
|
|
||||||
--enable-on-demand-resources NO
|
|
||||||
--target-device mac
|
|
||||||
--minimum-deployment-target ${CMAKE_OSX_DEPLOYMENT_TARGET}
|
|
||||||
--platform macosx
|
|
||||||
DEPENDS "${ICON_SOURCE}"
|
|
||||||
COMMENT "Compiling asset catalog (${ICON_SOURCE})"
|
|
||||||
VERBATIM
|
|
||||||
)
|
)
|
||||||
add_custom_target(compile_assets ALL DEPENDS "${GENERATED_ASSETS_CAR}")
|
|
||||||
if(EXISTS "${GENERATED_ASSETS_CAR}")
|
string(REGEX MATCH "Xcode ([0-9]+\.[0-9]+)" XCODE_VERSION_MATCH "${XCODE_VERSION_OUTPUT}")
|
||||||
install(FILES "${GENERATED_ASSETS_CAR}" DESTINATION "${RESOURCES_DEST_DIR}")
|
if(XCODE_VERSION_MATCH)
|
||||||
|
set(XCODE_VERSION ${CMAKE_MATCH_1})
|
||||||
|
else()
|
||||||
|
set(XCODE_VERSION 0.0)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(XCODE_VERSION VERSION_GREATER_EQUAL 26.0)
|
||||||
|
set(ASSETS_OUT_DIR "${CMAKE_BINARY_DIR}/program_info")
|
||||||
|
set(GENERATED_ASSETS_CAR "${ASSETS_OUT_DIR}/Assets.car")
|
||||||
|
set(ICON_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/${Launcher_Branding_MAC_ICON}")
|
||||||
|
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${GENERATED_ASSETS_CAR}"
|
||||||
|
COMMAND ${ACTOOL_EXE} "${ICON_SOURCE}"
|
||||||
|
--compile "${ASSETS_OUT_DIR}"
|
||||||
|
--output-partial-info-plist /dev/null
|
||||||
|
--app-icon PrismLauncher
|
||||||
|
--enable-on-demand-resources NO
|
||||||
|
--target-device mac
|
||||||
|
--minimum-deployment-target ${CMAKE_OSX_DEPLOYMENT_TARGET}
|
||||||
|
--platform macosx
|
||||||
|
DEPENDS "${ICON_SOURCE}"
|
||||||
|
COMMENT "Compiling asset catalog (${ICON_SOURCE})"
|
||||||
|
VERBATIM
|
||||||
|
)
|
||||||
|
add_custom_target(compile_assets ALL DEPENDS "${GENERATED_ASSETS_CAR}")
|
||||||
|
install(FILES "${GENERATED_ASSETS_CAR}" DESTINATION "${RESOURCES_DEST_DIR}")
|
||||||
|
else()
|
||||||
|
message(WARNING "Xcode ${XCODE_VERSION} is too old. Minimum required version is 26.0")
|
||||||
|
endif()
|
||||||
|
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "actool not found. Cannot compile macOS app icons.\n"
|
message(WARNING "actool not found. Cannot compile macOS app icons.\n"
|
||||||
"Install Xcode command line tools: 'xcode-select --install'")
|
"Install Xcode command line tools: 'xcode-select --install'")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue