CMake Macros and Variables

From RAD Studio
Jump to: navigation, search

Go Up to Using CMake with C++ Builder


Below you will find the list of Macros and Variables available for iOS and Android.

Windows Macros and Variables

Windows Macro

Macro Description Valid inputs

set_embt_target(target)

Sets the type of application to be build.
target: Type of application.

“VCL”, “FMX”, “Package”, “DynamicRuntime”

Windows Variable

Variable Description

EMBT_TARGET

Fixed value: "Windows" for Windows-Embarcadero.cmake

iOS Macros and Variables

iOS Macros

Macro Description Valid inputs Default values

set_embt_device_family(device)

Sets the Info.plist UIDeviceFamily
device: UI device family type.

“iPhone”, “iPad”, “iPhone & iPad”

"iPhone & iPad"

add_embt_additional_files(file_path [destination_dir [destination_name]])

Add additional files to be deployed to the application bundle directory.

  • file_path: File to be deployed to the application bundle directory. file_path should be in fully qualified form.
  • destination_dir: If this parameter is set, file will be deployed to this destination directory relative to EMBT_PROJECT_LOCATION. If this parameter is not set, file will be deployed to EMBT_PROJECT_LOCATION.
  • destination_name: If this parameter is set, destiname_name will be the name of the file in the application bundle directory. Otherwise, the name will be the file_path short filename.

This macro can be called more than once.

add_embt_interface_orientations(orientation)

Sets the Info.plist UISupportedInterfaceOrientations
orientation: UI supported interface orientation.
This macro can be called more than once.

“Portrait”, "PortraitUpsideDown", "LandscapeLeft", "LandscapeRight”

“Portrait” | "PortraitUpsideDown" | "LandscapeLeft" | "LandscapeRight”

add_embt_background_modes(mode)

Sets the Info.plist UIBackgroundModes
mode: UI background mode.
This macro can be called more than once.

"audio", "location", "voip", "fetch", "remote-notification", "newsstand-content", "external-accessory", "bluetooth-central", "bluetooth-peripheral"

<none>

set_embt_target(target)

Sets the type of application to be build.
target: Type of application.

"FMX"

add_fmx_app(source)

Adds the build target source files.
source: List of source files.

iOS Variables

Variable Description Default values

APP

Project/Application name

IOS_SDK_NAME

Specify the iOS SDK name to use to compile the application.
If the iOS SDK name is not specified, default iOS SDK as defined in RAD Studio will be used.

REMOTE_PROFILE

Specify the remote connection profile name.
If the remote connection profile is not specified, default remote connection profile as defined in RAD Studio will be used.

CERTIFICATE

Specify the certificate of the provisioning profile to be used to sign the application.
If the certificate is not specified, the first certificate found in the provisioning profile will be used.

PROVISIONING_PROFILE

Specify the provisioning profile to be used for the application. You can specify either the name or filename of the provisioning profile. If filename is specified, it should be in fully qualified form.
If the provisioning profile is not specified, the first provisioning profile that matches the specified EMBT_IOS_BUNDLE_IDENTIFIER and EMBT_IOS_BUILD_TYPE will be used.

EMBT_PROJECT_LOCATION

Application bundle directory in the remote machine.

“${APP}.app”

EMBT_TARGET

Fixed value: "iOS64" for bccios64.cmake and "iOS32" for bccios32.cmake

EMBT_IOS_BUILD_TYPE

Set application build type.
Valid values: “Ad-hoc”, “Application-Store”

“Application-Store”

EMBT_IOS_INFO_PLIST

Sets the custom Info.plist file.

EMBT_IOS_BUNDLE_ALLOW_MIXED_LOCALIZATIONS

Sets the Info.plist CFBundleAllowMixedLocalizations

"YES"

EMBT_IOS_BUNDLE_DEVELOPMENT_REGION

Sets the Info.plist CFBundleDevelopmentRegion

"en"

EMBT_IOS_BUNDLE_DISPLAY_NAME

Sets the Info.plist CFBundleDisplayName

“${APP}”

EMBT_IOS_BUNDLE_EXECUTABLE

Sets the Info.plist CFBundleExecutable

“${APP}”

EMBT_IOS_BUNDLE_IDENTIFIER

Sets the Info.plist CFBundleIdentifier

“${APP}”

EMBT_IOS_BUNDLE_INFO_DICTIONARY_VERSION

Sets the Info.plist CFBundleInfoDictionaryVersion

“7.1”

EMBT_IOS_BUNDLE_NAME

Sets the Info.plist CFBundleName

“${APP}”

EMBT_IOS_BUNDLE_PACKAGE_TYPE

Sets the Info.plist CFBundlePackageType

“APPL”

EMBT_IOS_BUNDLE_RESOURCE_SPECIFICATION

Sets the Info.plist CFBundleResourceSpecification

“${BDS}/cmake/templates/ResourceRules.plist"

EMBT_IOS_BUNDLE_SHORT_VERSION_STRING

Sets the Info.plist CFBundleShortVersionString

“1.0.0”

EMBT_IOS_BUNDLE_SIGNATURE

Sets the Info.plist CFBundleSignature

“????”

EMBT_IOS_BUNDLE_VERSION

Sets the Info.plist CFBundleVersion

“1.0.0”

EMBT_IOS_CAMERA_USAGE_DESCRIPTION

Sets the Info.plist NSCameraUsageDescription

“This app needs access to your camera”

EMBT_IOS_CONTACTS_USAGE_DESCRIPTION

Sets the Info.plist NSContactsUsageDescription

“This app needs access to your contact information”

EMBT_IOS_LOCAL_NOTIFICATION_PERMISSION

Sets the Info.plist FMLocalNotificationPermission

“false”

EMBT_IOS_LOCATION_ALWAYS_USAGE_DESCRIPTION

Sets the Info.plist NSLocationAlwaysUsageDescription

“This app needs access to your location always”

EMBT_IOS_LOCATION_WHEN_IN_USE_USAGE_DESCRIPTION

Sets the Info.plist NSLocationWhenInUseUsageDescription

“This app needs access to your location when you're using it”

EMBT_IOS_MINIMUM_OS_VERSION

Sets the Info.plist MinimumOSVersion

“8.0”

EMBT_IOS_PHOTO_LIBRARY_USAGE_DESCRIPTION

Sets the Info.plist NSPhotoLibraryUsageDescription

“This app needs access to your photos”

EMBT_IOS_REQUIRED_DEVICE_CAPABILITIES

Sets the Info.plist UIRequiredDeviceCapabilities

"arm7" for bccios32.cmake, "arm64" for bccios64.cmake

EMBT_IOS_REQUIRES_IPHONE_OS

Sets the Info.plist LSRequiresIPhoneO

“true”

EMBT_IOS_ALLOWS_ARBITRARY_LOADS

Sets the Info.plist NSAllowsArbitraryLoads

“true”

EMBT_IOS_ADDITIONAL_KEY_VALUE_PAIRS

Add additional Info.plist key value pairs

Variables to set icon and image files for iPad

Variable Default value

EMBT_IPAD_APPLICATION_ICON_144_144

"${BDS}/bin/Artwork/iOS/iPad/FM_ApplicationIcon_144x144.png"

EMBT_IPAD_APPLICATION_ICON_152_152

"${BDS}/bin/Artwork/iOS/iPad/FM_ApplicationIcon_152x152.png"

EMBT_IPAD_APPLICATION_ICON_72_72

"${BDS}/bin/Artwork/iOS/iPad/FM_ApplicationIcon_72x72.png"

EMBT_IPAD_APPLICATION_ICON_76_76

"${BDS}/bin/Artwork/iOS/iPad/FM_ApplicationIcon_76x76.png"

EMBT_IPAD_SETTING_ICON_29_29

"${BDS}/bin/Artwork/iOS/iPad/FM_SettingIcon_29x29.png"

EMBT_IPAD_SETTING_ICON_58_58

"${BDS}/bin/Artwork/iOS/iPad/FM_SettingIcon_58x58.png"

EMBT_IPAD_SPOTLIGHT_SEARCH_ICON_100_100

"${BDS}/bin/Artwork/iOS/iPad/FM_SpotlightSearchIcon_100x100.png"

EMBT_IPAD_SPOTLIGHT_SEARCH_ICON_40_40

"${BDS}/bin/Artwork/iOS/iPad/FM_SpotlightSearchIcon_40x40.png"

EMBT_IPAD_SPOTLIGHT_SEARCH_ICON_50_50

"${BDS}/bin/Artwork/iOS/iPad/ FM_SpotlightSearchIcon_50x50.png"

EMBT_IPAD_SPOTLIGHT_SEARCH_ICON_80_80

"${BDS}/bin/Artwork/iOS/iPad/FM_SpotlightSearchIcon_80x80.png"

EMBT_IPAD_LAUNCH_IMAGE_1024_748

"${BDS}/bin/Artwork/iOS/iPad/FM_LaunchImageLandscape_1024x748.png"

EMBT_IPAD_LAUNCH_IMAGE_1024_768

"${BDS}/bin/Artwork/iOS/iPad/FM_LaunchImageLandscape_1024x768.png"

EMBT_IPAD_LAUNCH_IMAGE_1536_2008

"${BDS}/bin/Artwork/iOS/iPad/FM_LaunchImagePortrait_1536x2008.png"

EMBT_IPAD_LAUNCH_IMAGE_1536_2048

"${BDS}/bin/Artwork/iOS/iPad/FM_LaunchImagePortrait_1536x2048.png"

EMBT_IPAD_LAUNCH_IMAGE_2048_1496

"${BDS}/bin/Artwork/iOS/iPad/FM_LaunchImageLandscape_2048x1496.png"

EMBT_IPAD_LAUNCH_IMAGE_2048_1536

"${BDS}/bin/Artwork/iOS/iPad/FM_LaunchImageLandscape_2048x1536.png"

EMBT_IPAD_LAUNCH_IMAGE_768_1004

"${BDS}/bin/Artwork/iOS/iPad/FM_LaunchImagePortrait_768x1004.png"

EMBT_IPAD_LAUNCH_IMAGE_768_1024

"${BDS}/bin/Artwork/iOS/iPad/FM_LaunchImagePortrait_768x1024.png"

Variables to set icon and image files for iPhone

Variable Default value

EMBT_IPHONE_APPLICATION_ICON_114_114

"${BDS}/bin/Artwork/iOS/iPhone/FM_ApplicationIcon_114x114.png"

EMBT_IPHONE_APPLICATION_ICON_120_120

"${BDS}/bin/Artwork/iOS/iPhone/FM_ApplicationIcon_120x120.png"

EMBT_IPHONE_APPLICATION_ICON_180_180

"${BDS}/bin/Artwork/iOS/iPhone/FM_ApplicationIcon_180x180.png"

EMBT_IPHONE_APPLICATION_ICON_57_57

"${BDS}/bin/Artwork/iOS/iPhone/FM_ApplicationIcon_57x57.png"

EMBT_IPHONE_APPLICATION_ICON_60_60

"${BDS}/bin/Artwork/iOS/iPhone/FM_ApplicationIcon_60x60.png"

EMBT_IPHONE_APPLICATION_ICON_87_87

"${BDS}/bin/Artwork/iOS/iPhone/FM_ApplicationIcon_87x87.png"

EMBT_IPHONE_SPOTLIGHT_SEARCH_ICON_29_29

"${BDS}/bin/Artwork/iOS/iPhone/FM_SpotlightSearchIcon_29x29.png"

EMBT_IPHONE_SPOTLIGHT_SEARCH_ICON_40_40

"${BDS}/bin/Artwork/iOS/iPhone/FM_SpotlightSearchIcon_40x40.png"

EMBT_IPHONE_SPOTLIGHT_SEARCH_ICON_58_58

"${BDS}/bin/Artwork/iOS/iPhone/FM_SpotlightSearchIcon_58x58.png"

EMBT_IPHONE_SPOTLIGHT_SEARCH_ICON_80_80

"${BDS}/bin/Artwork/iOS/iPhone/FM_SpotlightSearchIcon_80x80.png"

EMBT_IPHONE_LAUNCH_IMAGE_1125_2436

"${BDS}/bin/Artwork/iOS/iPhone/FM_LaunchImage_1125x2436.png"

EMBT_IPHONE_LAUNCH_IMAGE_1242_2208

"${BDS}/bin/Artwork/iOS/iPhone/FM_LaunchImage_1242x2208.png"

EMBT_IPHONE_LAUNCH_IMAGE_2208_1242

"${BDS}/bin/Artwork/iOS/iPhone/FM_LaunchImage_2208x1242.png"

EMBT_IPHONE_LAUNCH_IMAGE_2436_1125

"${BDS}/bin/Artwork/iOS/iPhone/FM_LaunchImage_2436x1125.png"

EMBT_IPHONE_LAUNCH_IMAGE_320_480

"${BDS}/bin/Artwork/iOS/iPhone/FM_LaunchImage_320x480.png"

EMBT_IPHONE_LAUNCH_IMAGE_640_1136

"${BDS}/bin/Artwork/iOS/iPhone/FM_LaunchImage_640x1136.png"

EMBT_IPHONE_LAUNCH_IMAGE_640_960

"${BDS}/bin/Artwork/iOS/iPhone/FM_LaunchImage_640x960.png"

EMBT_IPHONE_LAUNCH_IMAGE_750_1334

"${BDS}/bin/Artwork/iOS/iPhone/FM_LaunchImage_750x1334.png"

Android Macros and Variables

Android Macros

Macro Description Default values

add_embt_predexed_jars(file_path)

Add jar files into classes.dex file. To clear the existing jar files in classes.dex, set EMBT_PREDEXED_JARS to “”.
file_path: jar file to be added to classes.dex file. file_path should be in fully qualified path form.
This macro can be called more than once.

Default jars added to classes.dex are:

  • "${BDS}/lib/android/<debug|release>/android-support-v4.dex.jar"
  • "${BDS}/lib/android/<debug|release>/cloud-messaging.dex.jar"
  • "${BDS}/lib/android/<debug|release>/fmx.dex.jar"
  • "${BDS}/lib/android/<debug|release>/google-analytics-v2.dex.jar"
  • "${BDS}/lib/android/<debug|release>/google-play-billing.dex.jar"
  • "${BDS}/lib/android/<debug|release>/google-play-licensing.dex.jar"
  • "${BDS}/lib/android/<debug|release>/google-play-services-ads-7.0.0.dex.jar"
  • "${BDS}/lib/android/<debug|release>/google-play-services-analytics-7.0.0.dex.jar"
  • "${BDS}/lib/android/<debug|release>/google-play-services-base-7.0.0.dex.jar"
  • "${BDS}/lib/android/<debug|release>/google-play-services-identity-7.0.0.dex.jar"
  • "${BDS}/lib/android/<debug|release>/google-play-services-maps-7.0.0.dex.jar"
  • "${BDS}/lib/android/<debug|release>/google-play-services-panorama-7.0.0.dex.jar"
  • "${BDS}/lib/android/<debug|release>/google-play-services-plus-7.0.0.dex.jar"
  • "${BDS}/lib/android/<debug|release>/google-play-services-wallet-7.0.0.dex.jar"
  • "${BDS}/lib/android/<debug|release>/google-play-services-gcm-7.0.0.dex.jar"

add_embt_additional_uses_permissions(permission)

Add additional uses permission to the Android manifest file. To clear the existing permission in the Android manifest file, set EMBT_ANDROID_USES_PERMISSIONS to “”.
permission: Android uses permission.
This macro can be called more than once.

Default permission added to the manifest file are:

  • android.permission.ACCESS_COARSE_LOCATION
  • android.permission.ACCESS_FINE_LOCATION
  • android.permission.CALL_PHONE
  • android.permission.CAMERA
  • android.permission.INTERNET
  • android.permission.READ_CALENDAR
  • android.permission.READ_EXTERNAL_STORAGE
  • android.permission.READ_PHONE_STATE
  • android.permission.WRITE_CALENDAR
  • android.permission.WRITE_EXTERNAL_STORAGE

add_embt_additional_files(file_path [destination_dir [destination_name]])

Add additional files to be deployed to the application bundle directory.
file_path: File to be deployed to the application bundle directory. file_path should be in fully qualified form.
destination_dir: If this parameter is set, file will be deployed to this destination directory relative to EMBT_PROJECT_LOCATION. If this parameter is not set, the file will be deployed to EMBT_PROJECT_LOCATION.
destination_name: If this parameter is set, destiname_name will be the name of the file in the application bundle directory. Otherwise, the name will be the file_path short filename.
This macro can be called more than once.

set_embt_target(target)

Sets the type of application to be build.
target: Type of application.
Valid input: “FMX”

add_fmx_app(source)

Adds the build target source files.
source: List of source files.

Android Variables

Variable Description Default values

APP

Project/Application name

EMBT_PROJECT_LOCATION

Application bundle directory.

“${CMAKE_CURRENT_BINARY_DIR}/Project_${APP}”

EMBT_TARGET

Fixed value: "Android" for bccaarm.cmake

EMBT_ANDROID_BUILD_TYPE

Sets the application build type.
Valid values: “Development”, “Application-Store”

“Application-Store”

EMBT_ANDROID_KEYSTORE

Sets the KeyStore file.

EMBT_ANDROID_STOREPASS

Sets the KeyStore password.

EMBT_ANDROID_ALIAS

Sets the Alias in KeyStore.

EMBT_ANDROID_KEYPASS

Sets the Alias password.

EMBT_ANDROID_SDK_NAME

Specifies the Android SDK name to use to compile the application.
If the Android SDK name is not specified, the default Android SDK as defined in RAD Studio will be used.

EMBT_PREDEXED_JARS

List or jars used to build classes.dex (see add_embt_predexed_jars macro)

EMBT_ANDROID_USES_PERMISSIONS

List of permission to be added to Android manifest file (see add_embt_additional_uses_permissons macro).

EMBT_ANDROID_APPLICATION_META_DATA

Application metadata to be added to Android manifest file.

none

EMBT_ANDROID_SERVICES

Services to be added to Android manifest file.

none

EMBT_ANDROID_DEBUGGABLE

Sets the AndroidManifest android:debuggable

“True” for Application-Store build type, “False” for Development build type.

EMBT_ANDROID_HARDWARE_ACCELERATED

Sets the AndroidManifest android:hardwareAccelerated

“True”

EMBT_ANDROID_INSTALL_LOCATION

Sets the AndroidManifest android:installLocation

“auto”

EMBT_ANDROID_LABEL

Sets the AndroidManifest android:label

"${APP}"

EMBT_ANDROID_LARGE_HEAP

Sets the AndroidManifest android:largeHeap

“False”

EMBT_ANDROID_PACKAGE

Sets the AndroidManifest package

"com.embarcadero.${APP}"

EMBT_ANDROID_PERSISTENT

Sets the AndroidManifest android:persistent

“False”

EMBT_ANDROID_RESTORE_ANY_VERSION

Sets the AndroidManifest android:restoreAnyVersion

“False”

EMBT_ANDROID_TARGET_SDK_VERSION

Sets the AndroidManifest android:targetSdkVersion

“14”

EMBT_ANDROID_VERSION_CODE

Sets the AndroidManifest android:versionCode

“1”

EMBT_ANDROID_VERSION_NAME

Sets the AndroidManifest android:versionName

"1.0.0"

EMBT_ANDROID_INCLUDE_SPLASH_IMAGE

Set True to include splash_image_def.xml and styles.xml file in apk bundle.

“True”

EMBT_ANDROID_SPLASH_DEFAULT

Set a custom splash_image_def.xml

“${BDS}/cmake/templates/splash_image_def.xml"

EMBT_ANDROID_SPLASH_GRAVITY - splash_image_def key

Set a splash_image_def android:gravity
Valid values: ”top”, ”bottom”, ”left”, ”right”, ”center_vertical”, ”fill_vertical”, ”center_horizontal”, ”fill_horizontal”, ”center”, ”fill”, ”clip_vertical”, ”clip_horizontal”. ”start”, ”end”.

“center”

EMBT_ANDROID_SPLASH_TILE_MODE

Set a splash_image_def android:tileMode
Valid values: "disabled", "clamp", "repeat", "mirror".

"disabled"

EMBT_ANDROID_STYLES

Set a custom styles.xml file. If custom styles.xml file is set, and EMBT_ANDROID_INCLUDE_SPLASH_IMAGE is set to False, _EMBT_ANDROID_THEME needs to be set to the correct value manually.

"${BDS}/cmake/templates/styles.xml"

EMBT_ANDROID_THEME

Sets the styles AppTheme
Valid values: "TitleBar", "No TitleBar"

“TitleBar”

Variables to set icon and image files

Variable Default value

EMBT_ANDROID_LAUNCHER_ICON_HDPI

"${BDS}/bin/Artwork/Android/FM_LauncherIcon_72x72.png"

EMBT_ANDROID_LAUNCHER_ICON_LDPI

"${BDS}/bin/Artwork/Android/FM_LauncherIcon_36x36.png"

EMBT_ANDROID_LAUNCHER_ICON_MDPI

"${BDS}/bin/Artwork/Android/FM_LauncherIcon_48x48.png"

EMBT_ANDROID_LAUNCHER_ICON_XHDPI

"${BDS}/bin/Artwork/Android/FM_LauncherIcon_96x96.png"

EMBT_ANDROID_LAUNCHER_ICON_XXHDPI

"${BDS}/bin/Artwork/Android/FM_LauncherIcon_144x144.png"

EMBT_ANDROID_SPLASH_IMAGE_LARGE

"${BDS}/bin/Artwork/Android/FM_SplashImage_640x480.png"

EMBT_ANDROID_SPLASH_IMAGE_NORMAL

"${BDS}/bin/Artwork/Android/FM_SplashImage_470x320.png"

EMBT_ANDROID_SPLASH_IMAGE_SMALL

"${BDS}/bin/Artwork/Android/FM_SplashImage_426x320.png"

EMBT_ANDROID_SPLASH_IMAGE_XLARGE

"${BDS}/bin/Artwork/Android/FM_SplashImage_960x720.png"

See Also

Using CMake with C++ Builder