-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
138 lines (119 loc) · 4.75 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# THE MESOS PROJECT.
####################
if (NOT WIN32)
cmake_minimum_required(VERSION 2.8.10)
else (NOT WIN32)
cmake_minimum_required(VERSION 3.6.0)
endif (NOT WIN32)
project(Mesos)
set(MESOS_MAJOR_VERSION 1)
set(MESOS_MINOR_VERSION 3)
set(MESOS_PATCH_VERSION 0)
set(PACKAGE_VERSION
${MESOS_MAJOR_VERSION}.${MESOS_MINOR_VERSION}.${MESOS_PATCH_VERSION})
set(MESOS_PACKAGE_VERSION ${PACKAGE_VERSION})
set(MESOS_PACKAGE_SOVERSION 0)
# CMAKE MODULE SETUP.
#####################
# Paths that are searched when `include(...)` is called.
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/3rdparty/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/3rdparty/libprocess/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/3rdparty/stout/cmake)
list(
APPEND
CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/3rdparty/libprocess/cmake/macros)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/examples/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/master/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/slave/cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/src/tests/cmake)
# Macros.
include(Common)
include(External)
include(PatchCommand)
include(Versions)
include(VsBuildCommand)
# Configuration.
include(MesosConfigure)
# SUBDIRECTORIES.
#################
add_subdirectory(3rdparty)
add_subdirectory(src)
# TESTS.
########
add_custom_target(
check ${STOUT_TESTS_TARGET}
COMMAND ${PROCESS_TESTS_TARGET}
COMMAND ${MESOS_TESTS_TARGET}
DEPENDS ${STOUT_TESTS_TARGET} ${PROCESS_TESTS_TARGET} ${MESOS_TESTS_TARGET}
)
add_custom_target(
tests
DEPENDS ${STOUT_TESTS_TARGET} ${PROCESS_TESTS_TARGET} ${MESOS_TESTS_TARGET}
)
# PACKAGING.
############
# List of sources we will ignore when generating a source package.
# We assume there are no artifacts from an autotools build.
#
# NOTE: An in-source build is not supported. The build directory
# must be different than the source directory.
set(CPACK_SOURCE_IGNORE_FILES
.clang-format;
.gitignore;
.reviewboardrc;
bootstrap.bat;
bootstrap;
configure.ac;
Doxyfile;
mesos.pc.in;
/.git/;
/docs/;
/m4/;
/mpi/;
/site/;
/support/;
${CMAKE_BINARY_DIR};
)
# Convert the ignore list to a string (as required by CPack).
set(CPACK_SOURCE_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES}")
# Set the basename of any packages to 'mesos-<version>'.
set(CPACK_PACKAGE_FILE_NAME "mesos-${MESOS_PACKAGE_VERSION}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
# By default, all forms of binary packages are disabled.
option(CPACK_BINARY_BUNDLE "Enable to build OSX bundles" OFF)
option(CPACK_BINARY_DEB "Enable to build Debian packages" OFF)
option(CPACK_BINARY_DRAGNDROP "Enable to build OSX Drag'n'Drop packages" OFF)
option(CPACK_BINARY_IFW "Enable to build IFW packages" OFF)
option(CPACK_BINARY_NSIS "Enable to build NSIS packages" OFF)
option(CPACK_BINARY_OSXX11 "Enable to build OSX X11 packages" OFF)
option(CPACK_BINARY_PACKAGEMAKER "Enable to build PackageMaker packages" OFF)
option(CPACK_BINARY_RPM "Enable to build RPM packages" OFF)
option(CPACK_BINARY_STGZ "Enable to build STGZ packages" OFF)
option(CPACK_BINARY_TBZ2 "Enable to build TBZ2 packages" OFF)
option(CPACK_BINARY_TGZ "Enable to build TGZ packages" OFF)
option(CPACK_BINARY_TXZ "Enable to build TXZ packages" OFF)
# Output a gzip'd tarball for the `package_source` target.
set(CPACK_SOURCE_TGZ ON)
# By default, other forms of source packages are disabled.
option(CPACK_SOURCE_TBZ2 "Enable to build TBZ2 source packages" OFF)
option(CPACK_SOURCE_TXZ "Enable to build TXZ source packages" OFF)
option(CPACK_SOURCE_TZ "Enable to build TZ source packages" OFF)
option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" OFF)
include(CPack)