-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
65 lines (55 loc) · 1.94 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
# This file is part of fus.
#
# fus 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.
#
# fus 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 fus. If not, see <https://www.gnu.org/licenses/>.
cmake_minimum_required(VERSION 3.2)
project(fus)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${fus_BINARY_DIR}/bin)
# Required third party libraries
find_package(gflags REQUIRED)
find_package(libuv REQUIRED)
if (NOT WIN32)
find_package(LibUUID REQUIRED)
endif()
include(OpenSSL) # some extra logic in there
find_package(string_theory REQUIRED)
# Optional Stuff
option(FUS_DB_SQLITE3 "Use SQLite3 Database Engine" ON)
if(FUS_DB_SQLITE3)
find_package(SQLite3 REQUIRED)
set(FUS_HAVE_SQLITE 1)
else()
find_package(SQLite3 QUIET)
set(FUS_HAVE_SQLITE 0)
endif()
# Compile time config
option(FUS_ALLOW_DECRYPTED_CLIENTS OFF)
include(TestBigEndian)
TEST_BIG_ENDIAN(FUS_BIG_ENDIAN)
include_directories("${PROJECT_BINARY_DIR}/include")
configure_file("${PROJECT_SOURCE_DIR}/src/fus_config.h.in" "${PROJECT_BINARY_DIR}/include/fus_config.h")
# Might as well request C++17 so the mice can play.
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Prevent Win32 junk from leaking in
if(WIN32)
add_definitions(-DNOMINMAX)
endif()
# Disable MSVC++ warning C4200
# "nonstandard extension used: zero-sized array in struct/union"
if(MSVC)
add_compile_options(/wd4200)
endif()
# Allow the libs and exes to fondle themselves
add_subdirectory(src)