cmake_minimum_required(VERSION 3.10)
project(MyGLFWProject)

# 设置C++标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 查找Vulkan SDK (Windows平台)
if(WIN32)
    # 尝试自动查找Vulkan SDK
    find_package(Vulkan REQUIRED)
    
    # 如果自动查找失败，可以手动指定路径
    if(NOT Vulkan_FOUND)
        message(WARNING "自动查找Vulkan失败，尝试手动指定")
        set(VULKAN_SDK_PATH "$ENV{VULKAN_SDK}")
        if(VULKAN_SDK_PATH)
            set(Vulkan_INCLUDE_DIRS "${VULKAN_SDK_PATH}/Include")
            set(Vulkan_LIBRARIES "${VULKAN_SDK_PATH}/Lib/vulkan-1.lib")
        else()
            message(FATAL_ERROR "未找到Vulkan SDK，请安装或设置VULKAN_SDK环境变量")
        endif()
    endif()
endif()

# 设置GLFW的路径
set(GLFW_INCLUDE_DIR "D:/code/vulkan_demo/glfw/include")
set(GLFW_LIBRARY "D:/code/vulkan_demo/glfw/lib/glfw3.lib")
set(GLM_INCLUDE_DIR "D:/code/vulkan_demo/glm")

# 添加可执行文件
add_executable(${PROJECT_NAME} main.cpp)

# 包含目录
target_include_directories(${PROJECT_NAME} PRIVATE
    ${GLFW_INCLUDE_DIR}
    ${Vulkan_INCLUDE_DIRS}
    ${GLM_INCLUDE_DIR}
)

# 链接库
target_link_libraries(${PROJECT_NAME} PRIVATE
    ${GLFW_LIBRARY}
    ${Vulkan_LIBRARIES}
)
