forked from KandaoVR/qt-breakpad
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
105 lines (86 loc) · 2.87 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
100
101
102
103
104
105
cmake_minimum_required(VERSION 3.1.0)
project(QtBreakpadDemo)
set(VERSION 1.0.0)
ADD_DEFINITIONS(-DUNICODE)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
# configure file
set(APP_DISPLAY_NAME "Kandao QtBreakpad Demo")
configure_file (
"${PROJECT_SOURCE_DIR}/app/app_version.h.in"
"${PROJECT_SOURCE_DIR}/app/app_version.h"
)
# install prefix
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/install")
# qt5 required
find_package(Qt5Widgets CONFIG REQUIRED)
find_package(Qt5Network CONFIG REQUIRED)
############################################################
# build crash Handler
add_subdirectory (qtcrashhandler)
# build external breakpad repo
set(BREAKPAD_SOURCE_DIR "${PROJECT_SOURCE_DIR}/external/breakpad")
include_directories ("${BREAKPAD_SOURCE_DIR}/src")
add_subdirectory (external)
############################################################
# qtbreakpad handler
include_directories ("${PROJECT_SOURCE_DIR}/qtbreakpad/")
# sources
file(GLOB SOURCES
"${PROJECT_SOURCE_DIR}/testapp/main.cpp"
"${PROJECT_SOURCE_DIR}/qtbreakpad/*.cpp"
)
############################################################
# translate
# file(GLOB TS_FILES
# "./*.ts"
# )
# qt5_create_translation(QM_FILES RawPlus ${SOURCES} ${TS_FILES})
# if(APPLE)
# set_source_files_properties(
# ${QM_FILES}
# PROPERTIES
# MACOSX_PACKAGE_LOCATION "MacOS"
# )
# endif(APPLE)
############################################################
# app information
set(COMPANY "Kandao")
set(IDENTIFIER "com.kandao.qtbreakpaddemo")
# target on APPLE
if(APPLE)
set(MACOSX_BUNDLE_INFO_STRING "Kandao QtBreakpad Demo")
set(MACOSX_BUNDLE_BUNDLE_VERSION ${VERSION})
set(MACOSX_BUNDLE_ICON_FILE "QtBreakpadDemo.icns")
set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.kandao.qtbreakpaddemo")
set(MACOSX_BUNDLE_BUNDLE_NAME "Kandao QtBreakpad Demo")
# # icns
# set(ICON_FILE Resources/QtBreakpadDemo.icns)
# set_source_files_properties(${ICON_FILE}
# PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
# framework
find_library(corefoundation_lib CoreFoundation)
find_library(cfnetwork_lib CFNetwork)
set(FRAMEWORKS
${cfnetwork_lib}
${corefoundation_lib})
# target
add_executable(QtBreakpadDemo ${SOURCES} ${BREAKPAD_SRCS} ${ICON_FILE} ${QM_FILES})
endif(APPLE)
# target on WINDOWS
if(WIN32)
# set(WIN_RC QtBreakpadDemo.rc)
add_executable(QtBreakpadDemo ${SOURCES} ${BREAKPAD_SRCS} ${WIN_RC} ${QM_FILES})
endif(WIN32)
# target on LINUX
if(LINUX)
# set(WIN_RC QtBreakpadDemo.rc)
add_executable(QtBreakpadDemo ${SOURCES} ${BREAKPAD_SRCS} ${WIN_RC} ${QM_FILES})
endif(LINUX)
# linking
target_link_libraries(QtBreakpadDemo Qt5::Widgets Qt5::Network ${FRAMEWORKS} libbreakpad)
# configure install
install (TARGETS QtBreakpadDemo DESTINATION Demo)