-
Notifications
You must be signed in to change notification settings - Fork 812
/
CMakeLists.txt
85 lines (72 loc) · 2.9 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
# NOTE for OSX users:
# export MACOSX_DEPLOYMENT_TARGET=10.7 on .bash_profile if you want to compile use 10.7 sdk
# sdk location: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
# you can download old sdk from here: https://github.com/JuliaEichler/Mac_OSX_SDKs
# default is 10.7 for binary release.
# CMake arguments for WizNote
# APPSTORE_BUILD build for Apple Appsotre, would not use qt deploy
# XCODEBUILD adjust project params to suit for xcode
#UPDATE_TRANSLATIONS update transation files
# PLCrashReporter use PLCrashReporter for mac, need PLCrashReporter framework
if (APPLE)
cmake_minimum_required(VERSION 2.8.12)
else(APPLE)
cmake_minimum_required(VERSION 2.8.4)
endif(APPLE)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
# set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk")
# rpath resolve.
#set(CMAKE_BUILD_WITH_INSTALL_RPATH YES) // would cause wheelEvent problem on centos/fedora when compiled with qt5
if(APPLE)
set(CMAKE_INSTALL_NAME_DIR "@rpath/PlugIns")
SET(CMAKE_INSTALL_RPATH "@loader_path/..;@executable_path/..")
#SET(PLCrashReporter on)
else(APPLE)
set(CMAKE_INSTALL_RPATH "$ORIGIN;$ORIGIN/..")
set (openssl-linked on)
endif(APPLE)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif()
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(UNIX)
if(COMPILER_SUPPORTS_CXX11)
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
else(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif(APPLE)
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
endif()
if(APPLE)
if(APPSTORE_BUILD)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gdwarf-2")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -gdwarf-2")
add_definitions(-DBUILD4APPSTORE=TRUE)
endif(APPSTORE_BUILD)
if (PLCrashReporter)
add_definitions(-DUsePLCrashReporter=TRUE)
endif(PLCrashReporter)
add_definitions(-DUSECOCOATOOLBAR=TRUE)
endif(APPLE)
if(APPLE)
set(WIZNOTE_ROOT_DIR ${CMAKE_BINARY_DIR}/WizNote.app)
set(WIZNOTE_CONTENTS_DIR ${WIZNOTE_ROOT_DIR}/Contents)
set(WIZNOTE_RESOURCE_DIR ${WIZNOTE_ROOT_DIR}/Contents/Resources)
else(APPLE)
set(WIZNOTE_ROOT_DIR ${CMAKE_BINARY_DIR})
set(WIZNOTE_RESOURCE_DIR ${WIZNOTE_ROOT_DIR}/share)
endif(APPLE)
if (WIN32)
add_definitions(-DQUAZIP_STATIC)
endif()
add_subdirectory(lib)
add_subdirectory(src)