-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCMakeLists.txt
99 lines (87 loc) · 2.52 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Copyright (c) 2014, Ruslan Baratov
# All rights reserved.
cmake_minimum_required(VERSION 2.8.11)
project(testapp)
### Emulate toolchain
set(CMAKE_OSX_SYSROOT "iphoneos")
set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator")
set(CMAKE_DEBUG_POSTFIX d)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
### -- end
if(NOT XCODE_VERSION)
message(FATAL_ERROR "Xcode only")
endif()
set(
SOURCES
sources/AppDelegate.hpp
sources/AppDelegate.mm
sources/ViewController.hpp
sources/ViewController.mm
sources/main.mm
)
set(
IMAGES
images/iphone/[email protected] # Retina, 640x960
images/iphone/[email protected] # Retina 4-inch, 640x1136
# See plist.in:
images/ipad/Default-Portrait~ipad.png # Portrait Non-Retina, 768x1024
images/ipad/Default-Portrait@2x~ipad.png # Portrait Retina, 1536x2048
images/ipad/Default-Landscape~ipad.png # Landscape Non-Retina, 1024x768
images/ipad/Default-Landscape@2x~ipad.png # Landscape Retina, 2048x1536
)
set(
ICONS
icons/app/Icon~iphone.png # iPhone Retina, 120x120
icons/app/Icon~ipad.png # iPad Non-Retina, 76x76
icons/app/Icon@2x~ipad.png # iPad Retina, 152x152
icons/spotlight/Icon.png # iPhone/iPad Retina, 80x80
icons/spotlight/Icon~ipad.png # iPad Non-Retina, 40x40
icons/settings/[email protected] # iPhone Retina, 58x58
icons/settings/Icon-Small.png # iPad Non-Retina 29x29
)
set(
STORYBOARDS
storyboards/MainStoryboard_iPad.storyboard
storyboards/MainStoryboard_iPhone.storyboard
)
add_executable(
testapp
${ICONS}
${IMAGES}
${SOURCES}
${STORYBOARDS}
)
set_target_properties(
testapp
PROPERTIES
MACOSX_BUNDLE YES
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_LIST_DIR}/plist.in"
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer"
XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2"
XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES
XCODE_ATTRIBUTE_INSTALL_PATH "${CMAKE_BINARY_DIR}/ProductRelease"
XCODE_ATTRIBUTE_COMBINE_HIDPI_IMAGES "NO"
RESOURCE "${IMAGES};${STORYBOARDS};${ICONS}"
)
set_target_properties(
testapp
PROPERTIES
XCODE_ATTRIBUTE_PRODUCT_NAME
"TestApp"
XCODE_ATTRIBUTE_BUNDLE_IDENTIFIER
"com.github.ruslo.TestApp"
)
set_target_properties(
testapp
PROPERTIES
XCODE_ATTRIBUTE_PRODUCT_NAME[variant=Debug]
"TestApp-Dbg"
XCODE_ATTRIBUTE_BUNDLE_IDENTIFIER[variant=Debug]
"com.github.ruslo.TestApp.debug"
)
target_link_libraries(
testapp
"-framework CoreGraphics"
"-framework Foundation"
"-framework UIKit"
)