mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2025-04-10 18:22:11 +01:00
Update CMakeLists.txt for Tegra sample simpleGLES
This commit is contained in:
parent
bb121fe02b
commit
89a84131fb
@ -6,24 +6,52 @@ project(simpleGLES LANGUAGES C CXX CUDA)
|
||||
|
||||
find_package(CUDAToolkit REQUIRED)
|
||||
|
||||
set(CMAKE_CUDA_ARCHITECTURES 50 52 60 61 70 75 80 86 89 90)
|
||||
set(CMAKE_CUDA_ARCHITECTURES 53 61 70 72 75 80 86 87 90)
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
# set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G") # enable cuda-gdb (expensive)
|
||||
endif()
|
||||
|
||||
# Include directories and libraries
|
||||
include_directories(../../../Common)
|
||||
include_directories(../../../../Common)
|
||||
|
||||
find_package(EGL)
|
||||
find_package(X11)
|
||||
find_package(OpenGL)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
# Source file
|
||||
# Add target for simpleGLES
|
||||
add_executable(simpleGLES simpleGLES.cu)
|
||||
if(${OpenGL_FOUND})
|
||||
if(${EGL_FOUND})
|
||||
if(${X11_FOUND})
|
||||
# Add target for simpleGLES
|
||||
add_executable(simpleGLES simpleGLES.cu)
|
||||
|
||||
target_compile_options(simpleGLES PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||
target_compile_options(simpleGLES PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||
|
||||
target_compile_features(simpleGLES PRIVATE cxx_std_17 cuda_std_17)
|
||||
target_compile_features(simpleGLES PRIVATE cxx_std_17 cuda_std_17)
|
||||
|
||||
set_target_properties(simpleGLES PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||
set_target_properties(simpleGLES PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||
|
||||
target_include_directories(simpleGLES PUBLIC
|
||||
${EGL_INCLUDE_DIR}
|
||||
${OPENGL_INCLUDE_DIR}
|
||||
${CUDAToolkit_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_libraries(simpleGLES
|
||||
${EGL_LIBRARY}
|
||||
${X11_LIBRARIES}
|
||||
${OPENGL_LIBRARIES}
|
||||
)
|
||||
else()
|
||||
message(STATUS "X11 libraries not found - will not build sample 'simpleGLES'")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "EGL not found - will not build sample 'simpleGLES'")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "OpenGL not found - will not build sample 'simpleGLES'")
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Will not build sample simpleGLES - requires Linux OS")
|
||||
endif()
|
||||
endif()
|
||||
|
Loading…
x
Reference in New Issue
Block a user