Update to add Cuda to build system
This commit is contained in:
parent
8408036078
commit
68f8b02f0a
8 changed files with 120 additions and 17 deletions
|
@ -1,17 +1,34 @@
|
|||
cmake_minimum_required(VERSION 3.9)
|
||||
project(MyProject)
|
||||
project(MyProject LANGUAGES CUDA CXX)
|
||||
|
||||
add_compile_options(-Wall -Wextra -Wpedantic)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CUDA_ARCHITECTURES 61)
|
||||
set(CUDA_SEPARABLE_COMPILATION ON)
|
||||
|
||||
|
||||
set(SOURCE_FILES main.cpp)
|
||||
add_executable(${CMAKE_PROJECT_NAME}_run ${SOURCE_FILES})
|
||||
|
||||
include_directories(src)
|
||||
include_directories(kernels)
|
||||
include_directories(/usr/local/cuda-12.8/include)
|
||||
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(kernels)
|
||||
add_subdirectory(tests)
|
||||
|
||||
target_link_libraries(${CMAKE_PROJECT_NAME}_run ${CMAKE_PROJECT_NAME}_lib)
|
||||
add_executable(${CMAKE_PROJECT_NAME}_run main.cpp)
|
||||
|
||||
|
||||
|
||||
target_link_libraries(
|
||||
${CMAKE_PROJECT_NAME}_run
|
||||
PRIVATE
|
||||
${CMAKE_PROJECT_NAME}_lib
|
||||
${CMAKE_PROJECT_NAME}_cuda_lib
|
||||
${CUDA_LIBRARIES}
|
||||
)
|
||||
|
||||
# Doxygen Build
|
||||
option(BUILD_DOC "Build Documentation" ON)
|
||||
|
@ -35,4 +52,4 @@ if(DOXYGEN_FOUND)
|
|||
VERBATIM)
|
||||
else(DOXYGEN_FOUND)
|
||||
message("Doxygen needs to be installed to generate the documentation.")
|
||||
endif(DOXYGEN_FOUND)
|
||||
endif(DOXYGEN_FOUND)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue