forked from WizTeam/WizQTClient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
60 lines (50 loc) · 2.05 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
# 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.
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")
# 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/..")
else(APPLE)
set(CMAKE_INSTALL_RPATH "$ORIGIN;$ORIGIN/..;$ORIGIN/../lib/wiznote/plugins")
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()
if(NOT WIZNOTE_USE_QT5)
set(WIZNOTE_USE_QT5 OFF CACHE BOOL
"Build WizNote use Qt5, default is off.")
endif(NOT WIZNOTE_USE_QT5)
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)
endif(APPLE)
if(APPLE)
set(WIZNOTE_ROOT_DIR ${CMAKE_BINARY_DIR}/WizNote.app)
set(WIZNOTE_CONTENTS_DIR ${WIZNOTE_ROOT_DIR}/Contents)
set(WIZNOTE_PLUGIN_DIR ${WIZNOTE_ROOT_DIR}/Contents/PlugIns)
set(WIZNOTE_RESOURCE_DIR ${WIZNOTE_ROOT_DIR}/Contents/Resources)
else(APPLE)
set(WIZNOTE_ROOT_DIR ${CMAKE_BINARY_DIR})
set(WIZNOTE_PLUGIN_DIR ${WIZNOTE_ROOT_DIR}/lib/wiznote/plugins)
set(WIZNOTE_RESOURCE_DIR ${WIZNOTE_ROOT_DIR}/share)
endif(APPLE)
# must output to "lib" to make macdeployqt work correctly
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${WIZNOTE_PLUGIN_DIR})
add_subdirectory(lib)
add_subdirectory(src)