-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
118 lines (97 loc) · 3.35 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
##
# MIT License
#
# Copyright (c) 2018 Matt Chiasson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
##
cmake_minimum_required(VERSION 3.2)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(Hunter/HunterGate)
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.23.249.tar.gz"
SHA1 "d45d77d8bba9da13e9290a180e0477e90accd89b"
LOCAL
)
include(BuildOptions)
project(Tunis)
hunter_add_package(glm)
hunter_add_package(stb)
hunter_add_package(flatbuffers)
find_package(glm CONFIG REQUIRED)
find_package(stb CONFIG REQUIRED)
find_package(Flatbuffers CONFIG REQUIRED)
add_subdirectory(schema)
add_subdirectory(tools)
file(GLOB_RECURSE CI_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ci/*)
file(GLOB_RECURSE CMAKE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} cmake/*)
file(GLOB_RECURSE INCLUDE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} include/*)
file(GLOB_RECURSE BACKEND_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/${TUNIS_BACKEND}/*)
add_library(Tunis
LICENSE
README.md
.travis.yml
.appveyor.yml
${CI_FILES}
${CMAKE_FILES}
${INCLUDE_FILES}
src/TunisColor.cpp
${BACKEND_SRC}
# fast-poly2tri
3rdparty/fast-poly2tri/MPE_fastpoly2tri.h
# StructureOfArrays from https://github.com/Lunarsong/StructureOfArrays
3rdparty/StructureOfArrays/include/mapped_soa.h
3rdparty/StructureOfArrays/include/soa.h
# concurrent queue
3rdparty/concurrentqueue/concurrentqueue.h
)
target_include_directories(Tunis
PUBLIC include
PUBLIC include/${TUNIS_BACKEND}
PUBLIC 3rdparty/StructureOfArrays/include
PUBLIC 3rdparty/fast-poly2tri
PUBLIC 3rdparty/concurrentqueue
PRIVATE src
PRIVATE src/${TUNIS_BACKEND}
PRIVATE ${Tunis_BINARY_DIR}/schema
)
target_link_libraries(Tunis
PUBLIC
glm
stb::stb
PRIVATE
TunisFonts
)
if (TUNIS_PROFILING)
hunter_add_package(easy_profiler)
find_package(easy_profiler CONFIG REQUIRED)
target_link_libraries(Tunis PUBLIC easy_profiler)
target_compile_definitions(Tunis PUBLIC TUNIS_PROFILING=1)
endif()
find_package(OpenMP)
if (TARGET OpenMP::OpenMP_CXX)
target_link_libraries(Tunis PUBLIC OpenMP::OpenMP_CXX)
endif()
include(src/${TUNIS_BACKEND}/Backend.cmake)
tunis_backend_dependencies()
if (TUNIS_BUILD_SAMPLES)
add_subdirectory(samples)
endif()