You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.2 KiB
38 lines
1.2 KiB
cmake_minimum_required(VERSION 3.21)
|
|
project(NurbsPerformer LANGUAGES CXX CUDA)
|
|
|
|
set(CMAKE_CUDA_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
# set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler=\"/Zc:__cplusplus\"")
|
|
|
|
file(GLOB_RECURSE SOURCES "src/*.cpp" "src/*.cu")
|
|
file(GLOB_RECURSE HEADERS "include/*.h" "include/*.hpp" "include/*.cuh")
|
|
|
|
message(STATUS "Sources: ${SOURCES}")
|
|
message(STATUS "Headers: ${HEADERS}")
|
|
|
|
# add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
|
|
# add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
|
|
|
|
####### exe or lib #######
|
|
|
|
add_executable(NurbsPerformer tests/main.cpp ${SOURCES} ${HEADERS})
|
|
|
|
# 指定静态库位置
|
|
# set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
# #生成静态库
|
|
# add_library(NurbsPerformer ${SOURCES} ${HEADERS})
|
|
|
|
include_directories(include "$ENV{CUDA_PATH}/include" "E:/CLib/glm" "E:/CLib/tinynurbs/include")
|
|
|
|
set_target_properties(NurbsPerformer PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
|
|
|
|
# find_package(CUDA REQUIRED)
|
|
# target_link_libraries(NurbsPerformer ${CUDA_LIBRARIES})
|
|
|
|
if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
|
|
set(CMAKE_CUDA_ARCHITECTURES 70 75 80)
|
|
endif(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
|
|
|
|
target_link_libraries(NurbsPerformer ${CUDA_LIBRARIES})
|