File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 3.10 )
2
- project (gSLICr )
3
-
4
- set (CMAKE_CXX_STANDARD 11 )
2
+ project (gSLICr LANGUAGES CXX CUDA )
5
3
6
4
IF (MSVC_IDE )
7
5
set (OpenCV_STATIC OFF )
@@ -16,10 +14,9 @@ if(APPLE)
16
14
set (CUDA_HOST_COMPILER /usr/bin/clang )
17
15
endif (APPLE )
18
16
19
- find_package (CUDA REQUIRED )
20
17
find_package (OpenCV REQUIRED )
21
18
22
- include_directories (${CUDA_INCLUDE_DIRS } )
19
+ include_directories (${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES } )
23
20
include_directories (${OpenCV_INCLUDE_DIRS} )
24
21
add_subdirectory (ORUtils )
25
22
@@ -40,10 +37,13 @@ gSLICr_Lib/gSLICr.h
40
37
list (APPEND "-ftree-vectorize" )
41
38
SOURCE_GROUP (engines FILES ${GSLICR_LIB} )
42
39
43
- cuda_add_library (gSLICr_lib
44
- ${GSLICR_LIB}
45
- NVTimer.h )
40
+ add_library (gSLICr_lib ${GSLICR_LIB} NVTimer.h )
46
41
target_link_libraries (gSLICr_lib ${CUDA_LIBRARY} )
42
+ target_compile_features (gSLICr_lib PUBLIC cxx_std_11 )
43
+ set_target_properties (gSLICr_lib
44
+ PROPERTIES CUDA_SEPARABLE_COMPILATION ON
45
+ POSITION_INDEPENDENT_CODE ON
46
+ )
47
47
48
48
add_executable (demo demo.cpp )
49
49
target_link_libraries (demo gSLICr_lib ${OpenCV_LIBS} )
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ SOURCE_GROUP("" FILES ${ORUTILS_HEADERS})
38
38
add_library (ORUtils ${ORUTILS_OBJECTS} )
39
39
40
40
IF (WITH_CUDA )
41
- # include_directories(${CUDA_INCLUDE_DIRS })
41
+ # include_directories(${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES })
42
42
# cuda_add_library(ITMLib
43
43
# ${ITMLIB_CPU_OBJECTS}
44
44
# ${ITMLIB_CUDA_OBJECTS}
You can’t perform that action at this time.
0 commit comments