-
Notifications
You must be signed in to change notification settings - Fork 17
/
CMakeLists.txt
86 lines (63 loc) · 2.23 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
cmake_minimum_required(VERSION 3.1)
project(DSPatcher)
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W4")
elseif(MINGW)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -pedantic -Wall -Wextra -Wnon-virtual-dtor -Wno-unknown-pragmas")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -pthread -pedantic -Wall -Wextra -Wnon-virtual-dtor")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-return-type-c-linkage -Wno-gnu-zero-variadic-macro-arguments -Wno-vla -Wno-vla-extension")
endif()
if(NOT CMAKE_PREFIX_PATH)
if(APPLE)
find_program(BREW_EXECUTABLE brew)
if(BREW_EXECUTABLE)
execute_process(COMMAND ${BREW_EXECUTABLE} --prefix qt5 OUTPUT_VARIABLE QT5_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
if(QT5_PREFIX)
set(CMAKE_PREFIX_PATH "${QT5_PREFIX}")
else()
execute_process(COMMAND ${BREW_EXECUTABLE} --prefix qt OUTPUT_VARIABLE QT_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
if(QT_PREFIX)
set(CMAKE_PREFIX_PATH "${QT_PREFIX}")
else()
file(GLOB QT_VERSIONS "$ENV{HOME}/Qt/5.*")
endif()
endif()
else()
file(GLOB QT_VERSIONS "$ENV{HOME}/Qt/5.*")
endif()
elseif(WIN32)
file(GLOB QT_VERSIONS "C:/Qt/5.*")
endif()
if(QT_VERSIONS)
list(GET QT_VERSIONS 0 QT_VERSION_PATH)
file(GLOB QT_COMPILERS RELATIVE ${QT_VERSION_PATH} ${QT_VERSION_PATH}/*)
if(MSVC)
foreach(QT_COMPILER ${QT_COMPILERS})
if(${QT_COMPILER} MATCHES "msvc")
set(CMAKE_PREFIX_PATH "${QT_VERSION_PATH}/${QT_COMPILER}")
break()
endif()
endforeach()
elseif(MINGW)
foreach(QT_COMPILER ${QT_COMPILERS})
if(${QT_COMPILER} MATCHES "mingw")
set(CMAKE_PREFIX_PATH "${QT_VERSION_PATH}/${QT_COMPILER}")
break()
endif()
endforeach()
else()
list(GET QT_COMPILERS 0 QT_COMPILER)
set(CMAKE_PREFIX_PATH "${QT_VERSION_PATH}/${QT_COMPILER}")
endif()
endif(QT_VERSIONS)
endif(NOT CMAKE_PREFIX_PATH)
find_package(Qt5Widgets REQUIRED)
add_subdirectory(DSPatchables)
add_subdirectory(DSPatcher)
add_subdirectory(QtPatcher)
add_subdirectory(UiComponents)