cmake_minimum_required(VERSION 3.26)

set(PROJECT_N ComKit)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)


set(CMAKE_CXX_FLAGS_RELEASE "${ENV} -O3 -Wall")



project(${PROJECT_N})

include_directories(${PROJECT_SOURCE_DIR}/Helper)
include_directories(${PROJECT_SOURCE_DIR}/third/imgui)
include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories(${PROJECT_SOURCE_DIR}/third)
file(GLOB_RECURSE IMGUI_SRCS ${PROJECT_SOURCE_DIR}/third/imgui/*.cpp)
file(GLOB_RECURSE SRCS ${PROJECT_SOURCE_DIR}/src/*.cc)
file(GLOB_RECURSE THIRD_SRCS ${PROJECT_SOURCE_DIR}/third/*.cpp)

IF(WIN32)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
add_executable(${PROJECT_N}
    ${SRCS}
    ${IMGUI_SRCS}
    ${PROJECT_SRCS}
    ${THIRD_SRCS}
)

target_link_libraries(${PROJECT_N}
        d3d11.dll
        d3dcompiler.dll
        dxgi.dll
)
ELSE(UNIX)

ENDIF()