forked from MCWertGaming/snek
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
48 lines (44 loc) · 1.89 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
cmake_minimum_required(VERSION 3.16)
project(snek
VERSION 1.0.0
DESCRIPTION "SNEK - A simple snake clone, playable in the commandline with some unique game modes."
HOMEPAGE_URL "https://github.com/BlackVyperStudios/snek"
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED true)
add_subdirectory(snake)
add_subdirectory(menu)
add_subdirectory(frontend)
add_subdirectory(dependencies)
set(FRONTEND_TARGETS)
# enable warnings and set compile features
foreach(target snakelib menulib ${FRONTEND_TARGETS})
# Force Microsoft Visual Studio to decode sources files in UTF-8
if (MSVC)
target_compile_options(${target} PUBLIC "/utf-8")
endif()
# Add as many warning as possible:
if (WIN32)
if (MSVC)
target_compile_options(${target} PRIVATE "/W4")
target_compile_options(${target} PRIVATE "/WX")
target_compile_options(${target} PRIVATE "/wd4244")
target_compile_options(${target} PRIVATE "/wd4267")
target_compile_options(${target} PRIVATE "/D_CRT_SECURE_NO_WARNINGS")
endif()
# Force Win32 to UNICODE
target_compile_definitions(${target} PRIVATE UNICODE _UNICODE)
else()
target_compile_options(${target} PRIVATE "-Wall")
target_compile_options(${target} PRIVATE "-Wextra")
target_compile_options(${target} PRIVATE "-pedantic")
target_compile_options(${target} PRIVATE "-Werror")
target_compile_options(${target} PRIVATE "-Wno-sign-compare")
endif()
endforeach(target folf-namespace)
# install generation
include(GNUInstallDirs)
install(TARGETS snek
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)