Commit 2d828d0e authored by oscar's avatar oscar

提交cmake变动

parent f3794ab0
cmake_minimum_required(VERSION 3.0.2) cmake_minimum_required(VERSION 3.0.2)
project(jfx_tracking) project(jfx_tracking)
set(KF_CUDA OFF)
add_definitions(-D_DEBUG) add_definitions(-D_DEBUG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0")
...@@ -16,6 +17,7 @@ find_package(OpenCV REQUIRED) ...@@ -16,6 +17,7 @@ find_package(OpenCV REQUIRED)
find_package(yaml-cpp REQUIRED) find_package(yaml-cpp REQUIRED)
include_directories(${YAML_CPP_INCLUDE_DIR}) include_directories(${YAML_CPP_INCLUDE_DIR})
#find_package(CUDA REQUIRED) #find_package(CUDA REQUIRED)
#if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") #if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
...@@ -72,12 +74,24 @@ catkin_package( ...@@ -72,12 +74,24 @@ catkin_package(
## Build ## ## Build ##
########### ###########
if(KF_CUDA)
add_definitions(-D_KF_IOU_CUDA_)
find_package(CUDA REQUIRED)
include_directories(/usr/local/cuda/include)
link_directories(/usr/local/cuda/lib64)
set(CUDA_NVCC_PLAGS ${CUDA_NVCC_PLAGS};-std=c++11;-g;-G;-gencode;arch=compute_75;code=sm_75)
include_directories(${PROJECT_SOURCE_DIR}/src/BaseTracker/kf_gpu)
cuda_add_library(kf_cuda SHARED ${PROJECT_SOURCE_DIR}/src/BaseTracker/bev_overlap_online.cu ${PROJECT_SOURCE_DIR}/src/BaseTracker/kalman_batch_ops.cu ${PROJECT_SOURCE_DIR}/src/BaseTracker/kalman_batch_ops.cu)
target_link_libraries(kf_cuda cudart cublas)
endif
include_directories( include_directories(
/usr/local/include /usr/local/include
src src
src/tracker src/tracker
src/BaseTracker src/BaseTracker
src/BaseTracker/kf_gpu
src/log src/log
src/common src/common
src/coordinate src/coordinate
...@@ -121,6 +135,10 @@ target_link_libraries(${PROJECT_NAME}_node ...@@ -121,6 +135,10 @@ target_link_libraries(${PROJECT_NAME}_node
yaml-cpp yaml-cpp
) )
if(KF_CUDA)
target_link_libraries(${PROJECT_NAME}_node kf_cuda)
endif
#add_executable(cv_test #add_executable(cv_test
# src/test.cpp # src/test.cpp
# ${COORDINATE_SRC_FILES} # ${COORDINATE_SRC_FILES}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment