diff --git a/.gitignore b/.gitignore index ec5354deff606c0e4b2926d5441f10e0e448c94d..5986db2298b071f9b4ab16dc7ebfef12aae295a2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ lib/ bin/ !bin/*.bat build/ -build/* \ No newline at end of file +build/* +Utils/Version.h diff --git a/CMakeLists.txt b/CMakeLists.txt index c22e5c17980881985b2adb301f12524e44c55aa9..9f58d12786dedc5930adb566be091ea73590505e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,17 @@ set(EXT_CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE}) if (NOT ${CMAKE_BUILD_TYPE} STREQUAL "Debug") set(EXT_CMAKE_BUILD_TYPE "Release") endif() +## CUDA +find_package(CUDA REQUIRED) +if(${CUDA_FOUND}) + include_directories(${CUDA_INCLUDE_DIRS}) + link_directories($ENV{CUDA_PATH}/lib/x64) +else(${CUDA_FOUND}) + MESSAGE(STATUS "CUDA not found!") +endif(${CUDA_FOUND}) +# nvcc flags +#set(CUDA_NVCC_FLAGS -gencode arch=compute_20,code=sm_20;-G;-g) +#set(CUDA_NVCC_FLAGS -gencode arch=compute_52,code=sm_52;-G;-g) ## Discregrid if ((DEFINED Discregrid_INCLUDE_DIR) AND (DEFINED Discregrid_DEBUG_LIB) AND (DEFINED Discregrid_LIB)) diff --git a/PositionBasedDynamics/CMakeLists.txt b/PositionBasedDynamics/CMakeLists.txt index 2c2deca92ce2014f3856eb19dc4b6b4ac5a4c300..3a55c950b5cb9320b22dd9db1a473f8743dd6cbd 100644 --- a/PositionBasedDynamics/CMakeLists.txt +++ b/PositionBasedDynamics/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(PositionBasedDynamics +CUDA_ADD_LIBRARY(PositionBasedDynamics ${PROJECT_PATH}/Common/Common.h DirectPositionBasedSolverForStiffRodsInterface.h @@ -27,6 +27,8 @@ add_library(PositionBasedDynamics find_package( Eigen3 REQUIRED ) include_directories( ${EIGEN3_INCLUDE_DIR} ) +target_link_libraries(PositionBasedDynamics cuda.lib cudart_static.lib) + install(TARGETS PositionBasedDynamics RUNTIME DESTINATION bin