CMakeLists.txt 1.4 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
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
S
superjom 已提交
23 24 25 26
        ${PROJECT_SOURCE_DIR}/visualdl/backend/logic/pybind.cc
        ${PROJECT_SOURCE_DIR}/visualdl/backend/utils/filesystem.h
        ${PROJECT_SOURCE_DIR}/visualdl/backend/utils/concurrency.h
        )
S
superjom 已提交
27 28
target_link_libraries(core PRIVATE pybind11::module im storage sdk protobuf glog)
set_target_properties(core PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
S
superjom 已提交
29 30

add_executable(vl_test
S
superjom 已提交
31
        ${PROJECT_SOURCE_DIR}/visualdl/backend/test.cc
S
superjom 已提交
32
        ${PROJECT_SOURCE_DIR}/visualdl/backend/storage/storage_test.cc
S
superjom 已提交
33
        ${PROJECT_SOURCE_DIR}/visualdl/backend/utils/test_concurrency.cc
S
superjom 已提交
34
        ${PROJECT_SOURCE_DIR}/visualdl/backend/logic/im_test.cc)
S
superjom 已提交
35
target_link_libraries(vl_test storage im gtest glog protobuf gflags pthread)