-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
46 lines (31 loc) · 1000 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
cmake_minimum_required(VERSION 3.5)
project(nxudp)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/Modules")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
find_package(asio REQUIRED)
find_package(Threads REQUIRED)
include_directories(${ASIO_INCLUDE_DIRS})
set(NXUDP_SOURCES
src/export.h
src/program_options.h
src/program_options.cpp
src/client.h
src/client.cpp
src/server.h
src/server.cpp
src/int_buffer.h
src/int_buffer.cpp
src/print_stream.h)
if(WIN32)
# used in export.h for exporting nxudp library target
add_definitions(-DNXUDP_EXPORTS)
endif()
add_library(nxudp SHARED ${NXUDP_SOURCES})
target_link_libraries(nxudp Threads::Threads)
add_executable(app src/main.cpp)
target_link_libraries(app nxudp Threads::Threads)
add_dependencies(app nxudp)
install(TARGETS app nxudp
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib)