CMakeLists.txt 1.2 KB
Newer Older
S
superjom 已提交
1
cmake_minimum_required(VERSION 3.5)
S
superjom 已提交
2 3 4
project(VisualDL)

set(CMAKE_CXX_STANDARD 11)
S
superjom 已提交
5
set(CMAKE_CXX_FLAGS "-fPIC")
S
superjom 已提交
6 7

include_directories(${CMAKE_CURRENT_SOURCE_DIR})
S
superjom 已提交
8 9
include_directories(${PROJECT_SOURCE_DIR}/thirdparty/local/include)
include_directories(/usr/include/python2.7)
S
superjom 已提交
10

S
superjom 已提交
11 12
set(PYBIND11_CPP_STANDARD -std=c++11)
add_subdirectory(${PROJECT_SOURCE_DIR}/thirdparty/pybind11-2.2.1)
S
superjom 已提交
13

S
superjom 已提交
14
link_directories(${PROJECT_SOURCE_DIR}/thirdparty/local/lib)
S
superjom 已提交
15

S
superjom 已提交
16 17 18 19 20 21 22 23 24 25
add_library(storage
        ${PROJECT_SOURCE_DIR}/visualdl/backend/storage/storage.cc
        ${PROJECT_SOURCE_DIR}/visualdl/backend/storage/storage.pb.cc)
add_library(sdk ${PROJECT_SOURCE_DIR}/visualdl/backend/logic/sdk.cc)
add_library(im ${PROJECT_SOURCE_DIR}/visualdl/backend/logic/im.cc)

pybind11_add_module(core
        ${PROJECT_SOURCE_DIR}/visualdl/backend/logic/pybind.cc)
target_link_libraries(core PRIVATE pybind11::module im storage sdk protobuf glog)
set_target_properties(core PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
S
superjom 已提交
26 27

add_executable(vl_test
S
superjom 已提交
28 29
        ${PROJECT_SOURCE_DIR}/visualdl/backend/test.cc
        ${PROJECT_SOURCE_DIR}/visualdl/backend/logic/im_test.cc)
S
superjom 已提交
30
target_link_libraries(vl_test storage im gtest glog protobuf gflags)