CMake Wizards: Add properties that are required for iOS

Running applications on iOS requires declaring a bundle identifier and
version numbers in the application's Info.plist file.

Unconditionally add them, since they also make sense for desktop
applications, even if they are not strictly required.

Fixes: QTCREATORBUG-25297
Task-number: QTCREATORBUG-23574
Change-Id: I2269bec2d4eaf3e8dd3332a027b284049b3b8b42
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Eike Ziller
2021-02-11 16:30:54 +01:00
parent 9dad47387f
commit b72c1d11e6
2 changed files with 14 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.14)
project(%{ProjectName} LANGUAGES CXX)
project(%{ProjectName} VERSION 0.1 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -70,3 +70,9 @@ target_compile_definitions(%{ProjectName}
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(%{ProjectName}
PRIVATE Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Quick)
set_target_properties(%{ProjectName} PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
)

View File

@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.5)
project(%{ProjectName} LANGUAGES CXX)
project(%{ProjectName} VERSION 0.1 LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -71,3 +71,9 @@ else()
endif()
target_link_libraries(%{ProjectName} PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
set_target_properties(%{ProjectName} PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
)