CMakeLists.txt 807 字节
Newer Older
B
BohaoWu 已提交
1
cmake_minimum_required(VERSION 3.2)
B
BohaoWu 已提交
2 3 4
project(gpupreprocess)
include(cuda)
include(configure)
B
BohaoWu 已提交
5

B
BohaoWu 已提交
6 7
#C flags
set(CMAKE_C_FLAGS " -g -pipe -W -Wall -fPIC")
B
BohaoWu 已提交
8 9

#C++ flags.
B
BohaoWu 已提交
10
set(CMAKE_CXX_FLAGS " -g -pipe -W -Wall -fPIC -std=c++11")
B
BohaoWu 已提交
11 12

add_subdirectory(cuda)
B
BohaoWu 已提交
13
set(PYTHON_SO {PYTHON_LIBRARY})
B
BohaoWu 已提交
14 15
set(EXTRA_LIBS ${EXTRA_LIBS} gpu)
file(GLOB SOURCE_FILES pybind/*.cpp src/*.cpp)
B
BohaoWu 已提交
16

B
BohaoWu 已提交
17 18
include_directories("./include")
include_directories(${CUDA_INCLUDE_DIRS})
B
BohaoWu 已提交
19
include_directories(/usr${PYTHON_INCLUDE_DIR})
B
BohaoWu 已提交
20

B
BohaoWu 已提交
21 22
link_directories("-L${CUDA_TOOLKIT_ROOT_DIR}/lib64 -lcudart -lnppidei_static -lnppial_static -lnpps_static -lnppc_static -lculibos")
link_directories(${PYTHON_SO})
B
BohaoWu 已提交
23 24 25

#.so
add_library(gpupreprocess SHARED ${SOURCE_FILES})
B
BohaoWu 已提交
26 27
target_link_libraries(gpupreprocess ${EXTRA_LIBS})
target_link_libraries(gpupreprocess ${CUDA_LIBRARIES})