mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2025-07-01 20:20:29 +08:00
Add glfw3 existence checks to Vulkan samples
This commit is contained in:
parent
450038ea73
commit
62b96a65b5
@ -19,9 +19,16 @@ include_directories(../../../Common)
|
||||
find_package(Vulkan)
|
||||
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
|
||||
if(${Vulkan_FOUND})
|
||||
if(${OPENGL_FOUND})
|
||||
if(${HAVE_GLFW3_H})
|
||||
# Add target for simpleVulkan
|
||||
add_executable(simpleVulkan main.cpp SineWaveSimulation.cu VulkanBaseApp.cpp)
|
||||
|
||||
@ -50,6 +57,9 @@ target_compile_features(simpleVulkan PRIVATE cxx_std_17 cuda_std_17)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/frag.spv
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
else()
|
||||
message(STATUS "glfw3 not found - will not build sample 'simpleVulkan'")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "GLFW not found - will not build sample 'simpleVulkan'")
|
||||
endif()
|
||||
|
@ -19,9 +19,16 @@ include_directories(../../../Common)
|
||||
find_package(Vulkan)
|
||||
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
|
||||
if(${Vulkan_FOUND})
|
||||
if(${OPENGL_FOUND})
|
||||
if(${HAVE_GLFW3_H})
|
||||
# Add target for simpleVulkanMMAP
|
||||
add_executable(simpleVulkanMMAP ../../../Common/helper_multiprocess.cpp MonteCarloPi.cu VulkanBaseApp.cpp main.cpp)
|
||||
|
||||
@ -51,6 +58,9 @@ target_compile_features(simpleVulkanMMAP PRIVATE cxx_std_17 cuda_std_17)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/frag.spv
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
else()
|
||||
message(STATUS "glfw3 not found - will not build sample 'simpleVulkanMMAP'")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "GLFW not found - will not build sample 'simpleVulkanMMAP'")
|
||||
endif()
|
||||
|
@ -19,9 +19,16 @@ include_directories(../../../Common)
|
||||
find_package(Vulkan)
|
||||
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
|
||||
if(${Vulkan_FOUND})
|
||||
if(${OPENGL_FOUND})
|
||||
if(${HAVE_GLFW3_H})
|
||||
# Add target for vulkanImageCUDA
|
||||
add_executable(vulkanImageCUDA vulkanImageCUDA.cu)
|
||||
|
||||
@ -52,7 +59,10 @@ target_compile_features(vulkanImageCUDA PRIVATE cxx_std_17 cuda_std_17)
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
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()
|
||||
else()
|
||||
message(STATUS "Vulkan not found - will not build sample 'vulkanImageCUDA'")
|
||||
|
Loading…
x
Reference in New Issue
Block a user