-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
63 lines (50 loc) · 1.18 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
project(RHD2000Electroplating)
cmake_minimum_required(VERSION 3.12)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(PROJECT_VERSION 1.0.1)
#
# Options
#
option(MAINTAINER "Enable maintainer mode" OFF)
option(MORE_WARNINGS "Enable more compiler warnings" ON)
#
# Compiler flags
#
if (MORE_WARNINGS OR MAINTAINER)
add_definitions("-Wall")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_definitions("-Wextra")
endif()
endif()
if (MAINTAINER)
if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_definitions("-Werror")
endif()
endif()
# Windows compat stuff
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_definitions("-Wno-old-style-cast"
"-Wno-c++98-compat"
)
endif()
endif()
#
# Dependencies
#
include(GNUInstallDirs)
find_package(Threads)
find_package(Qt5 COMPONENTS Core Widgets Multimedia REQUIRED)
#
# Config
#
configure_file(config.h.in ${CMAKE_BINARY_DIR}/config.h)
include_directories(${CMAKE_BINARY_DIR})
#
# Subdirectories
#
add_subdirectory(src)
add_subdirectory(data)