This repository has been archived by the owner on Oct 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
74 lines (62 loc) · 2.64 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
# Copyright (c) 2017-2019, EPFL/Blue Brain Project
#
# This file is part of Rockets <https://github.com/BlueBrain/Rockets>
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License version 3.0 as published
# by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(Rockets VERSION 1.0.0)
set(Rockets_VERSION_ABI 1)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/common)
if(NOT EXISTS ${CMAKE_SOURCE_DIR}/CMake/common/Common.cmake)
message(FATAL_ERROR "CMake/common missing, run: git submodule update --init")
endif()
set(ROCKETS_DEB_DEPENDS libboost-test-dev libwebsockets-dev libuv1-dev)
set(ROCKETS_PORT_DEPENDS libwebsockets)
# disable noisy warnings from ChoosePython
set(CHOOSE_PYTHON_DONE ON)
include(FindBoostConfig)
include(Common)
set(ROCKETS_DESCRIPTION "Rockets - REST and websockets C++ library")
set(ROCKETS_MAINTAINER "Blue Brain Project <[email protected]>")
set(ROCKETS_LICENSE LGPL)
common_find_package(Boost SYSTEM COMPONENTS unit_test_framework)
if(APPLE)
common_find_package(OpenSSL REQUIRED) # libwebsockets depends on that
endif()
common_find_package(Libwebsockets SYSTEM)
if(NOT Libwebsockets_FOUND) # Ubuntu package only has libwebsockets.pc
common_find_package_disable(Libwebsockets)
common_find_package(libwebsockets SYSTEM REQUIRED)
set(Libwebsockets_VERSION ${libwebsockets_VERSION})
endif()
common_find_package_post()
# Prefer pthread and add '-pthread' to import target
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
set(ROCKETS_DEPENDENT_LIBRARIES Threads)
option(ROCKETS_BUILD_APPLICATIONS "Build example applications" ON)
if(ROCKETS_BUILD_APPLICATIONS)
add_subdirectory(apps)
endif()
add_subdirectory(rockets)
add_subdirectory(tests)
set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md")
set(ROCKETS_PACKAGE_DEB_DEPENDS libwebsockets-dev)
include(CommonCPack)
set(COMMON_PROJECT_DOMAIN ch.epfl.bluebrain)
set(DOXYGEN_MAINPAGE_MD README.md)
set(DOXYGEN_EXTRA_INPUT ${PROJECT_SOURCE_DIR}/README.md)
include(DoxygenRule)