-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
32 lines (26 loc) · 987 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
cmake_minimum_required(VERSION 3.10)
# set the project name
project(TorchView)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg -no-pie")
find_package(RapidJSON REQUIRED)
# print out rapidjson include directories
message(STATUS "Rapid_INCLUDE_DIRS: ${RapidJSON_INCLUDE_DIRS}")
include_directories(${RapidJSON_INCLUDE_DIRS}
${CMAKE_CURRENT_LIST_DIR}/include
)
# file(GLOB header_files CONFIGURE_DEPENDS "${CMAKE_CURRENT_LIST_DIR}/include/*")
file(GLOB src_files CONFIGURE_DEPENDS "${CMAKE_CURRENT_LIST_DIR}/src/*")
# add the library
add_library(Convert SHARED
# ${header_files}
${src_files}
${Rapidjson_INCLUDE_DIRS}
# "test.cpp"
)
# install the library
add_custom_command(TARGET Convert POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:Convert> ${CMAKE_CURRENT_SOURCE_DIR}/lib/convert/$<TARGET_FILE_NAME:Convert>
COMMENT "Copying library to ${CMAKE_CURRENT_SOURCE_DIR}/lib/convert"
)