在windows环境下基于Clion的Vulkan配置

1)下载和安装mingw64;

2)下载预编译的GLFM,把include里内容放在mingw64\include\,把lib里内容放在mingw64\lib\;

3)下载GLM,把GLM里内容放在mingw64\include\;

4)安装Vulkan SDK,把include里内容放在mingw64\include\,把lib里内容放在mingw64\lib\;

5)cmakelists.txt

cmake_minimum_required(VERSION 3.14)
project(vulkan_test)

# 获取OS信息
if (CMAKE_HOST_WIN32)
    set(WINDOWS 1)
elseif(CMAKE_HOST_APPLE)
    set(MACOS 1)
elseif(CMAKE_HOST_UNIX)
    set(LINUX 1)
endif()

set(CMAKE_CXX_STANDARD 17)

add_executable(vulkan_test main.cpp)

### GLFW
target_link_libraries(vulkan_test glfw3)


####  GLM
set(GLM_INCLUDE_DIRS C:/msys64/mingw64/include/glm)
include_directories(${GLM_INCLUDE_DIRS})

####Vulkan
find_package(Vulkan REQUIRED)
target_include_directories(${PROJECT_NAME} PUBLIC ${Vulkan_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} Vulkan::Vulkan)

 

展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客
应支付0元
点击重新获取
扫码支付

支付成功即可阅读