-
Notifications
You must be signed in to change notification settings - Fork 57
/
CMakeLists.txt
81 lines (67 loc) · 2.67 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
# Set the deployment target
# According to
# https://cmake.org/cmake/help/v3.0/variable/CMAKE_OSX_DEPLOYMENT_TARGET.html
# this has to be done before the first project() invocation.
#
# However, inside the mendeley desktop build system this means that the following
# line will actually be ignored, since we're doing that already on the top level
# of the build system.
if(NOT MENDELEY_DESKTOP_BUILD)
if(SUPPORT_OSX_SNOW_LEOPARD)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
else()
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
endif()
endif()
project(updater)
cmake_minimum_required(VERSION 2.6)
enable_testing()
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
# If the SIGN_UPDATER option is enabled, the updater.exe
# binary is digitally signed on Windows after it has been built.
#
# The script used to sign the binary is specified by BINARY_SIGNING_TOOL.
# This tool must take a single argument which is the filename of the
# binary to sign.
option(SIGN_UPDATER "Enable signing of the updater binary" OFF)
set(BINARY_SIGNING_TOOL sign-updater.bat CACHE PATH "Path to the tool used to sign the updater")
include_directories(external)
include_directories(external/TinyThread/source)
if (WIN32)
include_directories(external/zlib/)
include_directories(external/bzip2)
include_directories(external/win32cpp/include)
# - Link the updater binary statically with the Visual C++ runtime
# so that the executable can function standalone.
# - Enable PDB generation for release builds
#
# The /MT flag is specified separately for each build
# type rather than setting it in the CMAKE_(C|CXX)_FLAGS vars
# because otherwise they are overridden by the /MT switch in the
# default flags for CMAKE_(C|CXX)_FLAGS_(DEBUG|RELWITHDEBINFO)
set(CMAKE_CXX_FLAGS_DEBUG "/MTd")
set(CMAKE_C_FLAGS_DEBUG "/MTd")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/MT")
set(CMAKE_CXX_FLAGS_RELEASE "/MT /Zi /O2 /Ob2 /D NDEBUG")
set(CMAKE_C_FLAGS_RELEASE "/MT /Zi /O2 /Ob2 /D NDEBUG")
remove_definitions(-DUNICODE -D_UNICODE)
else()
# optimize for reduced code size
set(CMAKE_CXX_FLAGS_RELEASE "-Os")
set(CMAKE_C_FLAGS_RELEASE "-Os")
endif()
if(NOT MENDELEY_DESKTOP_BUILD)
if (APPLE)
# Build the updater as a dual 32/64bit binary. If only one architecture
# is required, removing the other architecture will reduce the size
# of the updater binary
set(CMAKE_OSX_ARCHITECTURES i386;x86_64)
endif()
endif()
add_subdirectory(src)
add_subdirectory(external/AnyOption)
add_subdirectory(external/minizip)
add_subdirectory(external/tinyxml)
add_subdirectory(external/TinyThread)