Last active
May 25, 2023 14:12
-
-
Save amirmasoudabdol/4348cb19eacfdb96da58f01c183ec65f to your computer and use it in GitHub Desktop.
bundle.cmake
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(is_cmake_bundle_identifier_given | |
AND is_xcode_bundle_identifier_given | |
AND NOT existing_cmake_bundle_identifier STREQUAL existing_xcode_bundle_identifier) | |
message(WARNING | |
"MACOSX_BUNDLE_GUI_IDENTIFIER and XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER " | |
"are set to different values. You only need to set one of them. " | |
"Use 'MACOSX_BUNDLE_GUI_IDENTIFIER' for maximum compatibility. ") | |
endif() | |
if(NOT is_xcode_bundle_identifier_given | |
AND NOT is_cmake_bundle_identifier_given) | |
_qt_internal_get_default_apple_bundle_identifier("${target}" bundle_id) | |
message(STATUS "Generated Bundle Identifier: ${bundle_id}") | |
elseif(is_cmake_bundle_identifier_given) | |
set(bundle_id ${existing_cmake_bundle_identifier}) | |
elseif(is_xcode_bundle_identifier_given) | |
set(bundle_id ${existing_xcode_bundle_identifier}) | |
endif() | |
if(CMAKE_GENERATOR STREQUAL "Xcode") | |
set_target_properties("${target}" | |
PROPERTIES | |
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${bundle_id}" | |
MACOSX_BUNDLE_GUI_IDENTIFIER "\${PRODUCT_BUNDLE_IDENTIFIER}") | |
else() | |
set_target_properties("${target}" | |
PROPERTIES | |
MACOSX_BUNDLE_GUI_IDENTIFIER "${bundle_id}") | |
endif() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment