Skip to content

Commit

Permalink
fix windows
Browse files Browse the repository at this point in the history
  • Loading branch information
cocoa-xu committed Jun 14, 2024
1 parent 7804c0c commit e768568
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,17 @@ set(EVISION_LIBRARIES "${OpenCV_LIBS}")
if(EVISION_ENABLE_CUDA)
find_package(CUDA REQUIRED)
include_directories("${CUDA_INCLUDE_DIRS}")
execute_process(COMMAND bash -c "nvcc -shared -Xcompiler -fPIC -DCUDA_ENABLED -c \"${C_SRC}/modules/evision_cuda.cc\" -o \"${C_SRC}/modules/evision_cuda.o\"" RESULT_VARIABLE STATUS)

if(WIN32)
if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
set(MSVC_LIB_LINK "/MD")
else()
set(MSVC_LIB_LINK "/MDd")
endif()
execute_process(COMMAND nvcc -shared -Xcompiler -fPIC -DCUDA_ENABLED "${MSVC_LIB_LINK}" -c "${C_SRC}/modules/evision_cuda.cc" -o "${C_SRC}/modules/evision_cuda.o" RESULT_VARIABLE STATUS)
else()
execute_process(COMMAND bash -c "nvcc -shared -Xcompiler -fPIC -DCUDA_ENABLED -c \"${C_SRC}/modules/evision_cuda.cc\" -o \"${C_SRC}/modules/evision_cuda.o\"" RESULT_VARIABLE STATUS)
endif()
if(STATUS STREQUAL "0")
message(STATUS "Successfully compiled evision_cuda.cc using nvcc")
else()
Expand Down

0 comments on commit e768568

Please sign in to comment.