-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
42 lines (32 loc) · 1.16 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
cmake_minimum_required(VERSION 3.8)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(LightCombatManager LANGUAGES CXX)
find_package(Qt6 QUIET COMPONENTS Widgets)
if(${Qt6_FOUND})
find_package(QT NAMES Qt6 COMPONENTS SvgWidgets Widgets REQUIRED)
find_package(Qt6 COMPONENTS SvgWidgets Widgets REQUIRED)
else()
find_package(QT NAMES Qt5 COMPONENTS Svg Widgets REQUIRED)
find_package(Qt5 COMPONENTS Svg Widgets REQUIRED)
endif()
include(CTest)
enable_testing()
add_custom_target(checks COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
add_dependencies(checks tests)
add_subdirectory(src)
add_subdirectory(test)
if(MSVC)
target_compile_options(LightCombatManager PRIVATE /W4)
else()
target_compile_options(LightCombatManager PRIVATE -Wall -Wextra -Wpedantic)
endif()
# Install and uninstall options
install(TARGETS LightCombatManager)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)