-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
35 lines (35 loc) · 1.43 KB
/
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
33
34
35
cmake_minimum_required(VERSION 2.8.8)
project(networktables-pc)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Werror -pthread -lrt -fPIC")
file(GLOB_RECURSE SOURCES1 ${PROJECT_SOURCE_DIR}/networktables/*.cpp)
file(GLOB_RECURSE SOURCES2 ${PROJECT_SOURCE_DIR}/networktables2/*.cpp)
file(GLOB_RECURSE SOURCES3 ${PROJECT_SOURCE_DIR}/tables/*.cpp)
file(GLOB_RECURSE SHIM ${PROJECT_SOURCE_DIR}/networktablesshim/*.cpp)
file(GLOB_RECURSE TOOLS ${PROJECT_SOURCE_DIR}/nttools/*.cpp)
file(GLOB_RECURSE INCLUDESHIM ${PROJECT_SOURCE_DIR}/networktablesshim/*.h)
set(SOURCES
${SOURCES1}
${SOURCES2}
${SOURCES3}
${SHIM}
${TOOLS}
)
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/networktablesshim)
add_library(ntobjects OBJECT ${SOURCES})
add_library(networktables SHARED $<TARGET_OBJECTS:ntobjects>)
add_library(networktables_static STATIC $<TARGET_OBJECTS:ntobjects>)
add_executable(test_server ${PROJECT_SOURCE_DIR}/test/server.cpp)
add_executable(test_client ${PROJECT_SOURCE_DIR}/test/client.cpp)
target_link_libraries(test_server networktables_static)
target_link_libraries(test_client networktables_static)
install(TARGETS networktables networktables_static
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
install(FILES ${INCLUDESHIM} DESTINATION include/networktables)
install(DIRECTORY networktables networktables2 tables nttools
DESTINATION include/networktables
FILES_MATCHING PATTERN "*.h"
)