mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2025-07-02 05:10:31 +08:00
Add glfw3 existence checks to Vulkan samples
This commit is contained in:
parent
450038ea73
commit
62b96a65b5
@ -19,15 +19,22 @@ include_directories(../../../Common)
|
|||||||
find_package(Vulkan)
|
find_package(Vulkan)
|
||||||
find_package(OpenGL)
|
find_package(OpenGL)
|
||||||
|
|
||||||
|
# Include the check_include_file macro
|
||||||
|
include(CheckIncludeFile)
|
||||||
|
|
||||||
|
# Check for the GLFW/glfw3.h header
|
||||||
|
check_include_file("GLFW/glfw3.h" HAVE_GLFW3_H)
|
||||||
|
|
||||||
# Source file
|
# Source file
|
||||||
if(${Vulkan_FOUND})
|
if(${Vulkan_FOUND})
|
||||||
if(${OPENGL_FOUND})
|
if(${OPENGL_FOUND})
|
||||||
|
if(${HAVE_GLFW3_H})
|
||||||
# Add target for simpleVulkan
|
# Add target for simpleVulkan
|
||||||
add_executable(simpleVulkan main.cpp SineWaveSimulation.cu VulkanBaseApp.cpp)
|
add_executable(simpleVulkan main.cpp SineWaveSimulation.cu VulkanBaseApp.cpp)
|
||||||
|
|
||||||
target_compile_options(simpleVulkan PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
target_compile_options(simpleVulkan PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||||
|
|
||||||
target_compile_features(simpleVulkan PRIVATE cxx_std_17 cuda_std_17)
|
target_compile_features(simpleVulkan PRIVATE cxx_std_17 cuda_std_17)
|
||||||
|
|
||||||
set_target_properties(simpleVulkan PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
set_target_properties(simpleVulkan PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||||
|
|
||||||
@ -50,6 +57,9 @@ target_compile_features(simpleVulkan PRIVATE cxx_std_17 cuda_std_17)
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/frag.spv
|
${CMAKE_CURRENT_SOURCE_DIR}/frag.spv
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
)
|
)
|
||||||
|
else()
|
||||||
|
message(STATUS "glfw3 not found - will not build sample 'simpleVulkan'")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
message(STATUS "GLFW not found - will not build sample 'simpleVulkan'")
|
message(STATUS "GLFW not found - will not build sample 'simpleVulkan'")
|
||||||
endif()
|
endif()
|
||||||
|
@ -19,15 +19,22 @@ include_directories(../../../Common)
|
|||||||
find_package(Vulkan)
|
find_package(Vulkan)
|
||||||
find_package(OpenGL)
|
find_package(OpenGL)
|
||||||
|
|
||||||
|
# Include the check_include_file macro
|
||||||
|
include(CheckIncludeFile)
|
||||||
|
|
||||||
|
# Check for the GLFW/glfw3.h header
|
||||||
|
check_include_file("GLFW/glfw3.h" HAVE_GLFW3_H)
|
||||||
|
|
||||||
# Source file
|
# Source file
|
||||||
if(${Vulkan_FOUND})
|
if(${Vulkan_FOUND})
|
||||||
if(${OPENGL_FOUND})
|
if(${OPENGL_FOUND})
|
||||||
|
if(${HAVE_GLFW3_H})
|
||||||
# Add target for simpleVulkanMMAP
|
# Add target for simpleVulkanMMAP
|
||||||
add_executable(simpleVulkanMMAP ../../../Common/helper_multiprocess.cpp MonteCarloPi.cu VulkanBaseApp.cpp main.cpp)
|
add_executable(simpleVulkanMMAP ../../../Common/helper_multiprocess.cpp MonteCarloPi.cu VulkanBaseApp.cpp main.cpp)
|
||||||
|
|
||||||
target_compile_options(simpleVulkanMMAP PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
target_compile_options(simpleVulkanMMAP PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||||
|
|
||||||
target_compile_features(simpleVulkanMMAP PRIVATE cxx_std_17 cuda_std_17)
|
target_compile_features(simpleVulkanMMAP PRIVATE cxx_std_17 cuda_std_17)
|
||||||
|
|
||||||
set_target_properties(simpleVulkanMMAP PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
set_target_properties(simpleVulkanMMAP PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||||
|
|
||||||
@ -51,6 +58,9 @@ target_compile_features(simpleVulkanMMAP PRIVATE cxx_std_17 cuda_std_17)
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}/frag.spv
|
${CMAKE_CURRENT_SOURCE_DIR}/frag.spv
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
)
|
)
|
||||||
|
else()
|
||||||
|
message(STATUS "glfw3 not found - will not build sample 'simpleVulkanMMAP'")
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
message(STATUS "GLFW not found - will not build sample 'simpleVulkanMMAP'")
|
message(STATUS "GLFW not found - will not build sample 'simpleVulkanMMAP'")
|
||||||
endif()
|
endif()
|
||||||
|
@ -19,15 +19,22 @@ include_directories(../../../Common)
|
|||||||
find_package(Vulkan)
|
find_package(Vulkan)
|
||||||
find_package(OpenGL)
|
find_package(OpenGL)
|
||||||
|
|
||||||
|
# Include the check_include_file macro
|
||||||
|
include(CheckIncludeFile)
|
||||||
|
|
||||||
|
# Check for the GLFW/glfw3.h header
|
||||||
|
check_include_file("GLFW/glfw3.h" HAVE_GLFW3_H)
|
||||||
|
|
||||||
# Source file
|
# Source file
|
||||||
if(${Vulkan_FOUND})
|
if(${Vulkan_FOUND})
|
||||||
if(${OPENGL_FOUND})
|
if(${OPENGL_FOUND})
|
||||||
|
if(${HAVE_GLFW3_H})
|
||||||
# Add target for vulkanImageCUDA
|
# Add target for vulkanImageCUDA
|
||||||
add_executable(vulkanImageCUDA vulkanImageCUDA.cu)
|
add_executable(vulkanImageCUDA vulkanImageCUDA.cu)
|
||||||
|
|
||||||
target_compile_options(vulkanImageCUDA PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
target_compile_options(vulkanImageCUDA PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||||
|
|
||||||
target_compile_features(vulkanImageCUDA PRIVATE cxx_std_17 cuda_std_17)
|
target_compile_features(vulkanImageCUDA PRIVATE cxx_std_17 cuda_std_17)
|
||||||
|
|
||||||
set_target_properties(vulkanImageCUDA PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
set_target_properties(vulkanImageCUDA PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||||
|
|
||||||
@ -52,7 +59,10 @@ target_compile_features(vulkanImageCUDA PRIVATE cxx_std_17 cuda_std_17)
|
|||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
message(STATUS "GLFW not found - will not build sample 'vulkanImageCUDA'")
|
message(STATUS "glfw3 not found - will not build sample 'vulkanImageCUDA'")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(STATUS "OpenGL not found - will not build sample 'vulkanImageCUDA'")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
message(STATUS "Vulkan not found - will not build sample 'vulkanImageCUDA'")
|
message(STATUS "Vulkan not found - will not build sample 'vulkanImageCUDA'")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user