This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
86 lines (69 loc) · 2.38 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
#*********************************************************************
# Copyright (C) Anton Kovalev (vertver), 2022. All rights reserved.
# nfrage - engine code for NFRage project
#*********************************************************************
# LGPL v2.1 License
#****************************************************************/
cmake_minimum_required(VERSION 3.16)
project(nfrage C CXX)
if (APPLE)
enable_language(OBJC)
set(CMAKE_XCODE_SCHEME_ENABLE_GPU_FRAME_CAPTURE_MODE Metal)
endif()
if (WIN32)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# fix version c++
if (MSVC)
add_compile_options(/Zc:__cplusplus)
endif()
set(NFRAGE_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(NFRAGE_ENG_NAME "Engine")
set(NFRAGE_CORE_NAME "Core")
set(NFRAGE_AUDIO_NAME "Audio")
set(NFRAGE_FRONTEND_NAME "Frontend")
set(NFRAGE_MISC_NAME "Misc")
set(NFRAGE_RENDER_NAME "Render")
set(NFRAGE_WORLD_NAME "World")
set(NFRAGE_PHYSICS_NAME "Physics")
set(NFRAGE_UI_NAME "UI")
set(NFRAGE_RESOURCES_NAME "Resources")
set(NFRAGE_APPLICATION_NAME "AppLayer")
set(NFRAGE_PLUGINS_NAME "PluginsLayer")
set(NFRAGE_ENTRYPOINT_NAME "nfrage")
set(NFRAGE_FOLDER_TESTS FOLDER "Tests")
set(NFRAGE_FOLDER_THIRD_PARTY FOLDER "3rd-party")
set(NFRAGE_FOLDER_PREGEN FOLDER "Pre-gen shit")
option(NFRAGE_SHIPPING "Shipping build of NFRAGE" OFF)
option(NFRAGE_SHARED "Build all modules with dynamic linking" OFF)
option(NFRAGE_TOOLS "Shipping engine with extented support for " OFF)
add_compile_definitions("FMT_HEADER_ONLY")
if (NFRAGE_SHIPPING)
add_compile_definitions("NFRAGE_SHIPPING")
endif()
if (NFRAGE_SHARED)
add_compile_definitions("NFRAGE_SHARED")
endif()
if (NFRAGE_TOOLS)
add_compile_definitions("NFRAGE_TOOLS")
endif()
if (NFRAGE_SHARED)
set(NFRAGE_LINKING_MODE SHARED)
else()
set(NFRAGE_LINKING_MODE STATIC)
endif()
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bins/lib/$<0:>")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bins/lib/$<0:>")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bins/bin/$<0:>")
include_directories("submodules")
include_directories("include")
add_subdirectory("submodules")
if (UNIX)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
endif()
add_subdirectory("src")
add_subdirectory("plugins")