-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
85 lines (76 loc) · 3.63 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
cmake_minimum_required(VERSION 3.26.4)
set(VCPKG_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg" CACHE STRING "vcpkg dir")
function(copy_folder_post_build folder)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/${folder}
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>/${folder})
endfunction()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Editor)
set(CMAKE_TOOLCHAIN_FILE ${VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_COMPILE_WARNING_AS_ERROR OFF)
project(NeoDoa)
message("Generating for ${CMAKE_CXX_COMPILER_ID}")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
if(WIN32 AND NOT MSVC_VERSION VERSION_LESS 142)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_compile_options(/W4)
add_compile_options(/wd4456) # declaration of 'LOCAL_VARIABLE_NAME' hides previous local declaration
add_compile_options(/wd4457) # declaration of 'LOCAL_VARIABLE_NAME' hides function parameter
add_compile_options(/wd4458) # declaration of 'FUNCTION_PARAMETER_NAME' hides class member
add_compile_options(/wd4459) # declaration of 'FUNCTION_PARAMETER_NAME' hides global declaration
add_compile_options($<$<CONFIG:Debug>:/ZI>)
add_link_options($<$<CONFIG:Debug>:/INCREMENTAL>)
endif()
else()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options(-fmax-errors=0)
add_compile_options(-Wall)
add_compile_options(-Wextra)
add_compile_options(-Wpedantic)
add_compile_options(-Wno-changes-meaning)
endif()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_compile_options(-ferror-limit=0)
add_compile_options(-Wall)
add_compile_options(-Wextra)
add_compile_options(-Wpedantic)
add_compile_options(-Wno-invalid-utf8)
add_compile_options(-Wno-braced-scalar-init)
add_compile_options(-Wno-missing-field-initializers)
add_compile_options(-Wno-gnu-zero-variadic-macro-arguments)
endif()
endif()
add_compile_options("$<$<CONFIG:DEBUG>:-DDEBUG>")
add_compile_options("$<$<CONFIG:DEBUG>:-D_DEBUG>")
add_compile_options("$<$<CONFIG:RELEASE>:-DNDEBUG>")
add_compile_options("$<$<CONFIG:RELEASE>:-D_NDEBUG>")
add_compile_definitions(ASSIMP_BUILD_ZLIB=ON)
add_compile_definitions(IMGUI_DEFINE_MATH_OPERATORS)
add_compile_definitions(GLFW_INCLUDE_NONE)
add_compile_definitions(GLM_ENABLE_EXPERIMENTAL)
add_compile_definitions(OPENGL_4_6_SUPPORT)
add_subdirectory(Submodules/angelscript_addons_impl)
add_subdirectory(Submodules/debugbreak)
add_subdirectory(Submodules/detector)
add_subdirectory(Submodules/EZEasing)
add_subdirectory(Submodules/IconFontCppHeaders)
add_subdirectory(Submodules/imgInspect)
add_subdirectory(Submodules/stb_impl)
add_subdirectory(Utility)
add_subdirectory(Engine)
add_subdirectory(Editor)
add_subdirectory(Launcher)
set_target_properties(angelscript_addons_impl PROPERTIES FOLDER Submodules)
set_target_properties(debugbreak PROPERTIES FOLDER Submodules)
set_target_properties(detector PROPERTIES FOLDER Submodules)
set_target_properties(EZEasing PROPERTIES FOLDER Submodules)
set_target_properties(IconFontCppHeaders PROPERTIES FOLDER Submodules)
set_target_properties(imgInspect PROPERTIES FOLDER Submodules)
set_target_properties(stb_impl PROPERTIES FOLDER Submodules)
set_target_properties(Editor PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>)
set_target_properties(Launcher PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>)