forked from ossia/score
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
140 lines (117 loc) · 4.26 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
139
140
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
set(CMAKE_MODULE_PATH
"${CMAKE_MODULE_PATH}"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Configurations"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Configurations/travis"
"${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libossia/cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libossia/cmake/cmake-modules")
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_MODULE_PATH}")
if(APPLE AND EXISTS /usr/local/opt/qt5)
list(APPEND CMAKE_PREFIX_PATH "/usr/local/opt/qt5")
endif()
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
"${CMAKE_MODULE_PATH}")
set(CMAKE_PREFIX_PATH
"${OSSIA_SDK}/SDL2/cmake"
"${OSSIA_SDK}/portaudio/lib/cmake"
"${OSSIA_SDK}/portaudio/lib/cmake/portaudio"
"${CMAKE_PREFIX_PATH}")
if(NOT SCORE_CONFIGURATION)
if(${CMAKE_BUILD_TYPE} MATCHES Debug)
set(SCORE_CONFIGURATION static-debug)
elseif(${CMAKE_BUILD_TYPE} MATCHES Release)
set(SCORE_CONFIGURATION static-release)
else()
set(SCORE_CONFIGURATION developer)
endif()
endif()
include("${SCORE_CONFIGURATION}")
project(score LANGUAGES C CXX)
cmake_policy(VERSION 3.13)
cmake_policy(SET CMP0025 NEW)
cmake_policy(SET CMP0063 NEW)
cmake_policy(SET CMP0079 NEW)
set(SCORE_VERSION_MAJOR 3)
set(SCORE_VERSION_MINOR 0)
set(SCORE_VERSION_PATCH 0)
set(SCORE_VERSION_EXTRA "alpha0")
set(SCORE_CODENAME "La poutine aux lardons : épistémologie d'une culture culinaire")
set(SCORE_VERSION
"${SCORE_VERSION_MAJOR}.${SCORE_VERSION_MINOR}.${SCORE_VERSION_PATCH}")
if(MSVC)
# TODO check /experimental:preprocessor at some point
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /std:c++latest /permissive- /volatile:iso")
add_definitions(/D_HAS_AUTO_PTR_ETC=1
/D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS=1
/DNOMINMAX
/DWIN32_LEAN_AND_MEAN
)
else()
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++2a -fno-stack-protector ")
endif()
if(MSYS OR MINGW)
find_package(ZLIB)
endif()
find_package(Qt5 5.12 REQUIRED
COMPONENTS
Core
Widgets
Gui
Network
Xml
# OPTIONAL_COMPONENTS
# Quick
# QuickControls2
# SerialPort
# Svg
# WebSockets
# Qml
# Test
)
include(3rdparty/libossia.cmake)
enable_testing()
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/ScoreFunctions.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/ScoreConfiguration.cmake")
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(3RDPARTY_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/")
set(SCORE_ROOT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(SCORE_ROOT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
set(SCORE_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src")
include_directories("${SCORE_ROOT_BINARY_DIR}")
include_directories(SYSTEM "${OSSIA_3RDPARTY_FOLDER}/variant/include")
include_directories(SYSTEM "${OSSIA_3RDPARTY_FOLDER}/nano-signal-slot")
include_directories(SYSTEM "${OSSIA_3RDPARTY_FOLDER}/brigand")
include_directories(SYSTEM "${OSSIA_3RDPARTY_FOLDER}/hopscotch-map/src")
include_directories(SYSTEM "${OSSIA_3RDPARTY_FOLDER}/readerwriterqueue")
include_directories(SYSTEM "${OSSIA_3RDPARTY_FOLDER}/exprtk")
include_directories(SYSTEM "${OSSIA_3RDPARTY_FOLDER}/multi_index/include")
set(SCORE_LIBRARIES_LIST CACHE INTERNAL "List of libraries")
set(SCORE_PLUGINS_LIST CACHE INTERNAL "List of plugins")
add_subdirectory(src)
if(SCORE_EMBEDDED)
return()
endif()
if(SCORE_TESTBED)
add_subdirectory(Tests/testbed)
endif()
if(EXISTS Documentation/Models/score.qmodel)
add_custom_target(Docs SOURCES Documentation/Models/score.qmodel)
endif()
set(INTEGRATION_TESTING 1)
if(INTEGRATION_TESTING)
file(COPY
"${CMAKE_CURRENT_SOURCE_DIR}/tests/testdata"
DESTINATION
"${CMAKE_CURRENT_BINARY_DIR}/tests/Integration/")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/tests")
file(GLOB_RECURSE TESTS_HDRS "${CMAKE_CURRENT_SOURCE_DIR}/tests/*.hpp")
add_custom_target(MocksHeaders SOURCES ${TESTS_HDRS})
setup_score_tests(tests/Integration)
endif()
include(GenerateQMake)
include(GenerateUnity)
include(CTest)