-
Notifications
You must be signed in to change notification settings - Fork 28
/
CMakeLists.txt
117 lines (107 loc) · 4.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
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
#
# Copyright (C) 2015 Maxim Noah Khailo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# In addition, as a special exception, the copyright holders give
# permission to link the code of portions of this program with the
# OpenSSL library under certain conditions as described in each
# individual source file, and distribute linked combinations
# including the two.
#
# You must obey the GNU General Public License in all respects for
# all of the code used other than OpenSSL. If you modify file(s) with
# this exception, you may extend this exception to your version of the
# file(s), but you are not obligated to do so. If you do not wish to do
# so, delete this exception statement from your version. If you delete
# this exception statement from all source files in the program, then
# also delete it here.
cmake_minimum_required(VERSION 2.8.11)
project(firestr)
if(APPLE)
add_definitions(-D_GLIBCXX_USE_NANOSLEEP)
link_directories(/usr/local/lib)
include_directories(/usr/local/include)
#botan from macports
include_directories(/usr/local/include/botan-2/)
elseif(CMAKE_HOST_WIN32)
link_directories(C:/snappy)
link_directories(C:/opus/lib)
link_directories(C:/Boost/lib)
link_directories(C:/botan/lib)
include_directories(C:/snappy)
include_directories(C:/opus/include)
include_directories(C:/botan/include)
include_directories(C:/Boost/include/boost-1_59)
add_definitions(-DWIN32_LEAN_AND_MEAN)
add_definitions(-DNOMINMAX)
set(CMAKE_CXX_FLAGS "/EHsc")
else()
#botan
add_definitions(-Wall -Werror -fPIC)
include_directories(/usr/include/botan-2/)
endif()
#setup boost
set(Boost_USE_STATIC_LIBS on)
find_package(Boost COMPONENTS system program_options filesystem regex thread REQUIRED)
link_directories(${Boost_LIBRARY_DIRS})
include_directories(${Boost_INCLUDE_DIRS})
#setup QT
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt5Core)
find_package(Qt5Widgets)
find_package(Qt5Network)
find_package(Qt5Multimedia)
find_package(Qt5MultimediaWidgets)
include_directories(${Qt5Core_INCLUDE_DIRS})
include_directories(${Qt5Widgets_INCLUDE_DIRS})
include_directories(${Qt5Network_INCLUDE_DIRS})
include_directories(${Qt5Multimedia_INCLUDE_DIRS})
include_directories(${Qt5MultimediaWidgets_INCLUDE_DIRS})
add_definitions(${Qt5Core_DEFINITIONS})
add_definitions(${Qt5Widgets_DEFINITIONS})
add_definitions(${Qt5Network_DEFINITIONS})
add_definitions(${Qt5Multimedia_DEFINITIONS})
add_definitions(${Qt5MultimediaWidgets_DEFINITIONS})
set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
set(ICON ${PROJECT_SOURCE_DIR}/src/gui/resources/firestr.svg)
set(DESKTOP ${PROJECT_SOURCE_DIR}/debian/firestr.desktop)
if(APPLE)
find_library(IOKIT NAMES IOKit)
find_library(CORE NAMES CoreFoundation)
find_library(CORE_SERVICES NAMES CoreServices)
set(MISC_LIBRARIES /usr/local/lib/libopus.a /usr/local/lib/libuuid.dylib libpthread.dylib /usr/local/lib/libbotan-2.a /usr/local/lib/libsnappy.a ${IOKIT} ${CORE} ${CORE_SERVICES})
elseif(CMAKE_HOST_WIN32)
set(MISC_LIBRARIES celt.lib silk_common.lib silk_float.lib opus.lib botan.lib snappy.lib)
else()
set(MISC_LIBRARIES libopus.so libuuid.so libpthread.so librt.so libbotan-2.so libcrypto.so libgmp.so libsnappy.so libXss.so libX11.so)
endif()
add_subdirectory(src)
if(APPLE)
else()
set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Maxim Noah Khailo <[email protected]>")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.17), libgcc1 (>= 1:4.1.1), libgmp10, libssl1.0.0 (>= 1.0.0), libstdc++6 (>= 4.8.1), libqt5core5, libqt5widgets5, libqt5network5")
set(CPACK_DEBIAN_PACKAGE_LICENSE "GPLv3")
set(CPACK_PACKAGE_CONTACT "[email protected]")
set(CPACK_PACKAGE_VERSION "0.2")
set(CPACK_PACKAGE_DESCRIPTION "A simple platform for p2p computation and communication.")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A simple platform fo p2p computation and communication.")
set(CPACK_PACKAGE_SOURCE "")
SET (CPACK_COMPONENTS_ALL Libraries ApplicationData)
include(CPack)
endif()