diff --git a/Samples/5_Domain_Specific/simpleVulkan/CMakeLists.txt b/Samples/5_Domain_Specific/simpleVulkan/CMakeLists.txt index e6595f70..387c748d 100644 --- a/Samples/5_Domain_Specific/simpleVulkan/CMakeLists.txt +++ b/Samples/5_Domain_Specific/simpleVulkan/CMakeLists.txt @@ -29,8 +29,17 @@ include(CheckIncludeFile) # Check for the GLFW/glfw3.h header check_include_file("GLFW/glfw3.h" HAVE_GLFW3_H) -# Find GLFW header and lib for Windows -if(WIN32 OR CMAKE_CROSSCOMPILING) +# Check for SUSE Linux +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + file(READ "/etc/os-release" OS_RELEASE_CONTENTS) + if(OS_RELEASE_CONTENTS MATCHES "ID=[^ ]*suse[^ ]*") + message(STATUS "SUSE Linux detected") + set(SUSE_LINUX TRUE) + endif() +endif() + +# Find GLFW header and lib for Windows and SUSE Linux +if(WIN32 OR CMAKE_CROSSCOMPILING OR SUSE_LINUX) set(GLFW_INCLUDE_DIRS "${GLFW_INCLUDE_DIR}" "${CMAKE_INCLUDE_PATH}") find_file(GLFW3_H "GLFW/glfw3.h" PATHS ${GLFW_INCLUDE_DIRS}) find_library(GLFW3_LIB @@ -64,7 +73,7 @@ if(${Vulkan_FOUND}) ${Vulkan_LIBRARIES} OpenGL::GL ) - if(WIN32 OR CMAKE_CROSSCOMPILING) + if(WIN32 OR CMAKE_CROSSCOMPILING OR SUSE_LINUX) target_include_directories(simpleVulkan PUBLIC ${GLFW_INCLUDE_DIRS} ) @@ -76,6 +85,12 @@ if(${Vulkan_FOUND}) glfw ) endif() + # Need to add X11 for SUSE Linux explicitly + if(SUSE_LINUX) + target_link_libraries(simpleVulkan + X11 + ) + endif() add_custom_command(TARGET simpleVulkan POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/sinewave.frag diff --git a/Samples/5_Domain_Specific/simpleVulkanMMAP/CMakeLists.txt b/Samples/5_Domain_Specific/simpleVulkanMMAP/CMakeLists.txt index 346c4749..a38c3606 100644 --- a/Samples/5_Domain_Specific/simpleVulkanMMAP/CMakeLists.txt +++ b/Samples/5_Domain_Specific/simpleVulkanMMAP/CMakeLists.txt @@ -28,8 +28,17 @@ include(CheckIncludeFile) # Check for the GLFW/glfw3.h header check_include_file("GLFW/glfw3.h" HAVE_GLFW3_H) -# Find GLFW header and lib for Windows -if(WIN32 OR CMAKE_CROSSCOMPILING) +# Check for SUSE Linux +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + file(READ "/etc/os-release" OS_RELEASE_CONTENTS) + if(OS_RELEASE_CONTENTS MATCHES "ID=[^ ]*suse[^ ]*") + message(STATUS "SUSE Linux detected") + set(SUSE_LINUX TRUE) + endif() +endif() + +# Find GLFW header and lib for Windows and SUSE Linux +if(WIN32 OR CMAKE_CROSSCOMPILING OR SUSE_LINUX) set(GLFW_INCLUDE_DIRS "${GLFW_INCLUDE_DIR}" "${CMAKE_INCLUDE_PATH}") find_file(GLFW3_H "GLFW/glfw3.h" PATHS ${GLFW_INCLUDE_DIRS}) find_library(GLFW3_LIB @@ -64,7 +73,7 @@ if(${Vulkan_FOUND}) OpenGL::GL CUDA::cuda_driver ) - if(WIN32 OR CMAKE_CROSSCOMPILING) + if(WIN32 OR CMAKE_CROSSCOMPILING OR SUSE_LINUX) target_include_directories(simpleVulkanMMAP PUBLIC ${GLFW_INCLUDE_DIRS} ) @@ -76,6 +85,12 @@ if(${Vulkan_FOUND}) glfw ) endif() + # Need to add X11 for SUSE Linux explicitly + if(SUSE_LINUX) + target_link_libraries(simpleVulkanMMAP + X11 + ) + endif() add_custom_command(TARGET simpleVulkanMMAP POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/montecarlo.frag diff --git a/Samples/5_Domain_Specific/vulkanImageCUDA/CMakeLists.txt b/Samples/5_Domain_Specific/vulkanImageCUDA/CMakeLists.txt index c1cd8895..240de1bd 100644 --- a/Samples/5_Domain_Specific/vulkanImageCUDA/CMakeLists.txt +++ b/Samples/5_Domain_Specific/vulkanImageCUDA/CMakeLists.txt @@ -28,8 +28,17 @@ include(CheckIncludeFile) # Check for the GLFW/glfw3.h header check_include_file("GLFW/glfw3.h" HAVE_GLFW3_H) -# Find GLFW header and lib for Windows -if(WIN32 OR CMAKE_CROSSCOMPILING) +# Check for SUSE Linux +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + file(READ "/etc/os-release" OS_RELEASE_CONTENTS) + if(OS_RELEASE_CONTENTS MATCHES "ID=[^ ]*suse[^ ]*") + message(STATUS "SUSE Linux detected") + set(SUSE_LINUX TRUE) + endif() +endif() + +# Find GLFW header and lib for Windows and SUSE Linux +if(WIN32 OR CMAKE_CROSSCOMPILING OR SUSE_LINUX) set(GLFW_INCLUDE_DIRS "${GLFW_INCLUDE_DIR}" "${CMAKE_INCLUDE_PATH}") find_file(GLFW3_H "GLFW/glfw3.h" PATHS ${GLFW_INCLUDE_DIRS}) find_library(GLFW3_LIB @@ -63,7 +72,7 @@ if(${Vulkan_FOUND}) ${Vulkan_LIBRARIES} OpenGL::GL ) - if(WIN32 OR CMAKE_CROSSCOMPILING) + if(WIN32 OR CMAKE_CROSSCOMPILING OR SUSE_LINUX) target_include_directories(vulkanImageCUDA PUBLIC ${GLFW_INCLUDE_DIRS} ) @@ -75,6 +84,12 @@ if(${Vulkan_FOUND}) glfw ) endif() + # Need to add X11 for SUSE Linux explicitly + if(SUSE_LINUX) + target_link_libraries(vulkanImageCUDA + X11 + ) + endif() add_custom_command(TARGET vulkanImageCUDA POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/shader.frag