Use CMake's find_package to locate vulkan for samples and tests. (#308)

This commit is contained in:
Andreas Süßenbach 2019-04-01 08:52:22 +02:00 committed by Markus Tavenrath
parent 2d8483e06f
commit fba738079a
20 changed files with 24 additions and 20 deletions

View File

@ -32,4 +32,4 @@ add_executable(01_InitInstance
)
set_target_properties(01_InitInstance PROPERTIES FOLDER "Samples")
target_link_libraries(01_InitInstance "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib")
target_link_libraries(01_InitInstance "${Vulkan_LIBRARIES}")

View File

@ -34,4 +34,4 @@ add_executable(02_EnumerateDevices
)
set_target_properties(02_EnumerateDevices PROPERTIES FOLDER "Samples")
target_link_libraries(02_EnumerateDevices "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib")
target_link_libraries(02_EnumerateDevices "${Vulkan_LIBRARIES}")

View File

@ -34,4 +34,4 @@ add_executable(03_InitDevice
)
set_target_properties(03_InitDevice PROPERTIES FOLDER "Samples")
target_link_libraries(03_InitDevice "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib")
target_link_libraries(03_InitDevice "${Vulkan_LIBRARIES}")

View File

@ -34,4 +34,4 @@ add_executable(04_InitCommandBuffer
)
set_target_properties(04_InitCommandBuffer PROPERTIES FOLDER "Samples")
target_link_libraries(04_InitCommandBuffer "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib")
target_link_libraries(04_InitCommandBuffer "${Vulkan_LIBRARIES}")

View File

@ -34,4 +34,4 @@ add_executable(05_InitSwapchain
)
set_target_properties(05_InitSwapchain PROPERTIES FOLDER "Samples")
target_link_libraries(05_InitSwapchain "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib")
target_link_libraries(05_InitSwapchain "${Vulkan_LIBRARIES}")

View File

@ -34,4 +34,4 @@ add_executable(06_InitDepthBuffer
)
set_target_properties(06_InitDepthBuffer PROPERTIES FOLDER "Samples")
target_link_libraries(06_InitDepthBuffer "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib")
target_link_libraries(06_InitDepthBuffer "${Vulkan_LIBRARIES}")

View File

@ -34,4 +34,4 @@ add_executable(07_InitUniformBuffer
)
set_target_properties(07_InitUniformBuffer PROPERTIES FOLDER "Samples")
target_link_libraries(07_InitUniformBuffer "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib")
target_link_libraries(07_InitUniformBuffer "${Vulkan_LIBRARIES}")

View File

@ -34,4 +34,4 @@ add_executable(08_InitPipelineLayout
)
set_target_properties(08_InitPipelineLayout PROPERTIES FOLDER "Samples")
target_link_libraries(08_InitPipelineLayout "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib")
target_link_libraries(08_InitPipelineLayout "${Vulkan_LIBRARIES}")

View File

@ -36,4 +36,4 @@ add_executable(09_InitDescriptorSet
)
set_target_properties(09_InitDescriptorSet PROPERTIES FOLDER "Samples")
target_link_libraries(09_InitDescriptorSet "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib")
target_link_libraries(09_InitDescriptorSet "${Vulkan_LIBRARIES}")

View File

@ -34,4 +34,4 @@ add_executable(10_InitRenderPass
)
set_target_properties(10_InitRenderPass PROPERTIES FOLDER "Samples")
target_link_libraries(10_InitRenderPass "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib")
target_link_libraries(10_InitRenderPass "${Vulkan_LIBRARIES}")

View File

@ -37,5 +37,5 @@ add_executable(11_InitShaders
set_target_properties(11_InitShaders PROPERTIES FOLDER "Samples")
target_include_directories(11_InitShaders PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(11_InitShaders PUBLIC glslang SPIRV "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib"
target_link_libraries(11_InitShaders PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}"
)

View File

@ -35,5 +35,5 @@ add_executable(12_InitFrameBuffers
set_target_properties(12_InitFrameBuffers PROPERTIES FOLDER "Samples")
target_include_directories(12_InitFrameBuffers PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(12_InitFrameBuffers PUBLIC glslang SPIRV "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib"
target_link_libraries(12_InitFrameBuffers PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}"
)

View File

@ -36,5 +36,5 @@ add_executable(13_InitVertexBuffer
set_target_properties(13_InitVertexBuffer PROPERTIES FOLDER "Samples")
target_include_directories(13_InitVertexBuffer PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(13_InitVertexBuffer PUBLIC glslang SPIRV "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib"
target_link_libraries(13_InitVertexBuffer PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}"
)

View File

@ -40,5 +40,5 @@ add_executable(14_InitPipeline
set_target_properties(14_InitPipeline PROPERTIES FOLDER "Samples")
target_include_directories(14_InitPipeline PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(14_InitPipeline PUBLIC glslang SPIRV "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib"
target_link_libraries(14_InitPipeline PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}"
)

View File

@ -40,5 +40,5 @@ add_executable(15_DrawCube
set_target_properties(15_DrawCube PROPERTIES FOLDER "Samples")
target_include_directories(15_DrawCube PUBLIC ${CMAKE_SOURCE_DIR}/glslang)
target_link_libraries(15_DrawCube PUBLIC glslang SPIRV "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib"
target_link_libraries(15_DrawCube PUBLIC glslang SPIRV "${Vulkan_LIBRARIES}"
)

View File

@ -14,6 +14,8 @@
cmake_minimum_required(VERSION 3.2)
find_package(Vulkan REQUIRED)
project(Vulkan-Hpp_Samples)
option (SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP OFF)
@ -30,7 +32,7 @@ if (SAMPLES_BUILD_WITH_LOCAL_VULKAN_HPP)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../Vulkan-Docs/include")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..")
else()
include_directories("$ENV{VK_SDK_PATH}/include")
include_directories("${Vulkan_INCLUDE_DIRS}")
endif()
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../glm")

View File

@ -14,6 +14,8 @@
cmake_minimum_required(VERSION 3.2)
find_package(Vulkan REQUIRED)
project(Vulkan-Hpp_Tests)
option (TESTS_BUILD_WITH_LOCAL_VULKAN_HPP OFF)
@ -30,7 +32,7 @@ if (TESTS_BUILD_WITH_LOCAL_VULKAN_HPP)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../Vulkan-Docs/include")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..")
else()
include_directories("$ENV{VK_SDK_PATH}/include")
include_directories("${Vulkan_INCLUDE_DIRS}")
endif()
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../glm")

View File

@ -32,4 +32,4 @@ add_executable(DeviceFunctions
)
set_target_properties(DeviceFunctions PROPERTIES FOLDER "Tests")
target_link_libraries(DeviceFunctions "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib")
target_link_libraries(DeviceFunctions "${Vulkan_LIBRARIES}")

View File

@ -32,4 +32,4 @@ add_executable(NoExceptions
)
set_target_properties(NoExceptions PROPERTIES FOLDER "Tests")
target_link_libraries(NoExceptions "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib")
target_link_libraries(NoExceptions "${Vulkan_LIBRARIES}")

View File

@ -32,4 +32,4 @@ add_executable(StructureChain
)
set_target_properties(StructureChain PROPERTIES FOLDER "Tests")
target_link_libraries(StructureChain "$ENV{VULKAN_SDK}/Lib/vulkan-1.lib")
target_link_libraries(StructureChain "${Vulkan_LIBRARIES}")