Particle_Simulator/Cpp_Stuff/src/CMakeLists.txt

32 lines
1.3 KiB
CMake
Raw Normal View History

2024-11-23 21:59:28 -05:00
# set(CMAKE_CXX_OMPILER "nvcc")
find_package(SDL2 REQUIRED)
# find_package(CUDA REQUIRED)
find_package(CUDAToolkit REQUIRED)
file(GLOB project_cuda_src "**/*.cu")
file(GLOB project_cpp_src "**/*.cpp")
# set(project_src ${project_cpp_src} ${project_cuda_src})
2025-04-04 00:03:25 -04:00
include_directories(${CMAKE_PROJECT_NAME} "${PROJECT_SOURCE_DIR}/include")
2024-11-23 21:59:28 -05:00
include_directories(${CMAKE_PROJECT_NAME} ${SDL2_INCLUDE_DIRS})
#include_directories(${CMAKE_PROJECT_NAME} ${CUDA_INCLUDE_DIRS})
message(STATUS "${SDL2_LIBRARIES}")
message(STATUS "${CUDA_LIBRARIES}")
message(STATUS "${CUDAToolkit_ROOT}")
enable_language(CUDA)
# add_library(cuda_lib STATIC ${project_cuda_src})
# add_library(particle_sim STATIC ${project_src})
# add_executable(particle_sim_exe "main.cpp" ${project_src})
add_executable(particle_sim_exe "main.cpp" ${project_cuda_src} ${project_cpp_src})
set_target_properties(particle_sim_exe PROPERTIES CXX_STANDARD 17)
target_compile_options(particle_sim_exe PRIVATE -dlink)
target_link_libraries( particle_sim_exe PRIVATE ${SDL2_LIBRARIES} )
target_link_libraries( particle_sim_exe PRIVATE ${SDL2_LIBRARIES} )
# target_link_libraries( particle_sim_exe PRIVATE -lcublas -lcudrt -lnppc -lnpps -lcurand)
target_link_libraries( particle_sim_exe PRIVATE CUDA::cublas CUDA::nppc CUDA::npps CUDA::curand)
set_target_properties( particle_sim_exe PROPERTIES CUDA_SEPARABLE_COMPILATION ON)