light/Engine/CMakeLists.txt

58 lines
1.6 KiB
Text
Raw Normal View History

cmake_minimum_required(VERSION 3.16)
2021-09-09 19:46:02 +04:30
2022-05-26 10:52:16 +04:30
if(CMAKE_COMPILER_IS_GNUCC)
add_compile_options(-w)
2021-09-09 19:46:02 +04:30
endif()
2021-09-09 19:46:02 +04:30
if(MSVC)
2022-05-26 10:52:16 +04:30
add_compile_options(/MP)
add_compile_options(/W0)
2021-09-09 19:46:02 +04:30
endif()
file(GLOB_RECURSE ENGINE_ALL_FILES true ABSOLUTE ${ENGINE_DIR}src/*)
file(GLOB_RECURSE ENGINE_RES_FILES true ABSOLUTE ${ENGINE_DIR}res/*)
list(LENGTH ENGINE_ALL_FILES ENGINE_ALL_FILES_COUNT)
if(NOT WIN32)
2022-05-26 10:52:16 +04:30
set(DX_DIR ${ENGINE_DIR}src/Platform/GraphicsAPI/DirectX/)
set(WIN_DIR ${ENGINE_DIR}src/Platform/OS/Windows/)
list(
REMOVE_ITEM ENGINE_ALL_FILES
${DX_DIR}dxBlender.cpp
${DX_DIR}dxBuffers.cpp
${DX_DIR}dxFramebuffer.cpp
${DX_DIR}dxGraphicsContext.cpp
${DX_DIR}dxRenderCommand.cpp
${DX_DIR}dxShader.cpp
${DX_DIR}dxSharedContext.cpp
${DX_DIR}dxTexture.cpp
${DX_DIR}dxUserInterface.cpp
${DX_DIR}dxVertexLayout.cpp
${WIN_DIR}wWindow.cpp
)
else()
2022-05-26 10:52:16 +04:30
file(GLOB_RECURSE HLSL_FILES true ABSOLUTE ${ENGINE_DIR}res/*.hlsl)
set_source_files_properties(${HLSL_FILES} PROPERTIES VS_TOOL_OVERRIDE "None")
2021-09-09 19:46:02 +04:30
endif()
list(LENGTH ENGINE_ALL_FILES ENGINE_ALL_FILES_COUNT)
include_directories(
2022-05-26 10:52:16 +04:30
${ENGINE_DIR}src/Engine/
${ENGINE_DIR}src/Platform/GraphicsAPI/
${ENGINE_DIR}src/Platform/OS/
${DEPENDENCIES_DIR}entt/src/
${DEPENDENCIES_DIR}GLAD/include/
${DEPENDENCIES_DIR}GLFW/include/
${DEPENDENCIES_DIR}glm/
${DEPENDENCIES_DIR}imgui/
${DEPENDENCIES_DIR}spdlog/include/
${DEPENDENCIES_DIR}stb_image/
${DEPENDENCIES_DIR}yaml-cpp/include/
${DEPENDENCIES_DIR}shaderc/libshaderc/include
2021-09-09 19:46:02 +04:30
)
source_group(TREE ${ENGINE_DIR} FILES ${ENGINE_ALL_FILES} ${ENGINE_RES_FILES})
add_library(Engine STATIC ${ENGINE_ALL_FILES} ${ENGINE_RES_FILES})