mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2026-10-25 22:28:17 +08:00
Refactor CMakeLists.txt under 5_Domain_Specific
This commit is contained in:
@@ -1,3 +1,16 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
|
||||
|
||||
project(smokeParticles LANGUAGES C CXX CUDA)
|
||||
|
||||
find_package(CUDAToolkit REQUIRED)
|
||||
|
||||
set(CMAKE_CUDA_ARCHITECTURES 50 52 60 61 70 75 80 86 89 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)
|
||||
|
||||
@@ -5,21 +18,15 @@ find_package(OpenGL)
|
||||
find_package(GLUT)
|
||||
|
||||
# Source file
|
||||
set(SRC_FILES
|
||||
GLSLProgram.cpp
|
||||
ParticleSystem.cpp
|
||||
ParticleSystem_cuda.cu
|
||||
SmokeRenderer.cpp
|
||||
SmokeShaders.cpp
|
||||
framebufferObject.cpp
|
||||
particleDemo.cpp
|
||||
renderbuffer.cpp
|
||||
)
|
||||
|
||||
if(${OpenGL_FOUND})
|
||||
if (${GLUT_FOUND})
|
||||
# Add target for smokeParticles
|
||||
add_executable(smokeParticles ${SRC_FILES})
|
||||
add_executable(smokeParticles GLSLProgram.cpp ParticleSystem.cpp ParticleSystem_cuda.cu SmokeRenderer.cpp SmokeShaders.cpp framebufferObject.cpp particleDemo.cpp renderbuffer.cpp)
|
||||
|
||||
target_compile_options(smokeParticles PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
|
||||
|
||||
target_compile_features(smokeParticles PRIVATE cxx_std_17 cuda_std_17)
|
||||
|
||||
set_target_properties(smokeParticles PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
||||
|
||||
target_include_directories(smokeParticles PUBLIC
|
||||
|
||||
Reference in New Issue
Block a user