2023-02-06 08:42:56 +00:00
|
|
|
cmake_minimum_required(VERSION 3.10)
|
|
|
|
project(verlet CUDA CXX)
|
|
|
|
|
|
|
|
set(CMAKE_CUDA_STANDARD 17)
|
|
|
|
|
|
|
|
set(CMAKE_CUDA_ARCHITECTURES 75)
|
|
|
|
|
|
|
|
find_package(SDL2 REQUIRED)
|
|
|
|
|
|
|
|
add_subdirectory(glm)
|
|
|
|
|
2023-02-07 08:41:36 +00:00
|
|
|
set(CMAKE_CUDA_FLAGS ${CMAKE_CUDA_FLAGS} "")
|
2023-02-06 08:42:56 +00:00
|
|
|
|
2023-02-07 08:41:36 +00:00
|
|
|
# Simulator
|
2023-02-06 08:42:56 +00:00
|
|
|
|
2023-02-07 08:41:36 +00:00
|
|
|
add_executable(cudagravity_sim sim/main.cu common/particle.hpp common/definitions.hpp sim/cudaMemory.cuh sim/exportHelper.cu sim/exportHelper.cuh)
|
2023-02-06 08:42:56 +00:00
|
|
|
|
2023-02-07 08:41:36 +00:00
|
|
|
target_include_directories(cudagravity_sim PUBLIC common)
|
|
|
|
|
2023-02-08 08:27:56 +00:00
|
|
|
target_link_libraries(cudagravity_sim PUBLIC glm::glm)
|
2023-02-07 08:41:36 +00:00
|
|
|
|
|
|
|
set_target_properties(cudagravity_sim PROPERTIES
|
2023-02-06 08:42:56 +00:00
|
|
|
CUDA_SEPARABLE_COMPILATION ON)
|
2023-02-07 08:41:36 +00:00
|
|
|
|
|
|
|
# Viewer
|
|
|
|
|
2023-02-08 08:27:56 +00:00
|
|
|
find_package(PkgConfig)
|
|
|
|
pkg_check_modules(SDL2GFX REQUIRED SDL2_gfx)
|
|
|
|
|
2023-02-07 08:41:36 +00:00
|
|
|
add_executable(cudagravity_viewer viewer/main.cpp common/particle.hpp common/definitions.hpp)
|
2023-02-08 08:27:56 +00:00
|
|
|
target_include_directories(cudagravity_viewer PUBLIC common ${SDL2GFX_INCLUDE_DIRS}})
|
|
|
|
target_link_libraries(cudagravity_viewer PUBLIC glm::glm SDL2::SDL2 ${SDL2GFX_LIBRARIES})
|