@@ -4,7 +4,7 @@ project(torchserve_cpp VERSION 0.1)
4
4
set (CMAKE_CXX_STANDARD 17)
5
5
set (CMAKE_CXX_STANDARD_REQUIRED True )
6
6
set (CMAKE_CXX_EXTENSIONS OFF )
7
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wextra -fPIC -D_GLIBCXX_USE_CXX11_ABI=1 " )
7
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wextra -fPIC" )
8
8
9
9
find_program (CLANG_TIDY_EXE NAMES "clang-tidy" REQUIRED)
10
10
set (CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE} " )
@@ -18,35 +18,56 @@ if(CLANG_FORMAT_EXE)
18
18
${PROJECT_SOURCE_DIR} /test /*.hh
19
19
)
20
20
21
- add_custom_target (format
22
- COMMAND
23
- ${CLANG_FORMAT_EXE} -i -style=google ${ALL_CXX_SOURCE_FILES}
24
- )
25
21
endif ()
26
22
27
23
28
24
find_package (Boost REQUIRED)
29
- find_package (folly REQUIRED)
30
- find_package (fmt REQUIRED)
31
- find_package (gflags REQUIRED)
32
25
find_package (Torch REQUIRED)
33
26
27
+ include (FetchContent)
28
+
29
+ FetchContent_Declare(
30
+ spdlog
31
+ GIT_REPOSITORY https://github.com/gabime/spdlog
32
+ GIT_TAG v1.13.0
33
+ )
34
+ FetchContent_GetProperties(spdlog)
35
+
36
+ if (NOT spdlog_POPULATED)
37
+ message (STATUS "Fetching spdlog..." )
38
+ FetchContent_Populate(spdlog)
39
+ add_subdirectory (${spdlog_SOURCE_DIR} ${spdlog_BINARY_DIR} )
40
+ endif ()
41
+
42
+
43
+ FetchContent_Declare(
44
+ json
45
+ GIT_REPOSITORY https://github.com/nlohmann/json
46
+ GIT_TAG v3.11.3
47
+ )
48
+ FetchContent_GetProperties(json)
49
+
50
+ if (NOT json_POPULATED)
51
+ message (STATUS "Fetching json..." )
52
+ FetchContent_Populate(json)
53
+ add_subdirectory (${json_SOURCE_DIR} ${json_BINARY_DIR} )
54
+ endif ()
55
+
56
+ include_directories ("${json_SOURCE_DIR} /include" "${spdlog_SOURCE_DIR} /include" )
57
+
34
58
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS} " )
35
59
36
60
include_directories (${TORCH_INCLUDE_DIRS} )
37
- include_directories (${FOLLY_INCLUDE_DIRS} )
38
61
include_directories (${GTEST_INCLUDE_DIRS} )
39
62
include_directories (${GMOCK_INCLUDE_DIRS} )
40
63
41
64
include_directories ("${CMAKE_INSTALL_PREFIX} /_deps" )
42
65
include_directories (${CMAKE_CURRENT_SOURCE_DIR} )
43
66
44
- set (FOLLY_LIBRARIES Folly::folly)
45
-
46
67
# add subdirectories in src
47
68
add_subdirectory (src/utils)
48
69
add_subdirectory (src/backends)
49
70
add_subdirectory (src/examples)
50
71
add_subdirectory (test )
51
72
52
- FILE (COPY src/resources/logging.config DESTINATION "${CMAKE_INSTALL_PREFIX} /resources" )
73
+ FILE (COPY src/resources/logging.yaml DESTINATION "${CMAKE_INSTALL_PREFIX} /resources" )
0 commit comments