-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
48 lines (40 loc) · 1.22 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
36
37
38
39
40
41
42
43
44
45
46
47
48
# CMake minimum version dependency
cmake_minimum_required( VERSION 3.0.0 FATAL_ERROR )
# Project name
project( "ESys" )
# Compiler and linker flags
set( CPP_COMPILE_FLAGS "-g -Wall -std=c++11" )
set( CPP_LINK_FLAGS "-pthread" )
# Header files locations
include_directories( include )
# Main project library
add_library( esys STATIC
src/app/SimpleApp.cpp
src/app/AppContext.cpp
src/sys/SystemInfo.cpp
src/sys/VersionInfo.cpp
src/sys/AbstractThread.cpp
src/sys/StopWatch.cpp
src/net/UdpSocket.cpp
src/net/Datagram.cpp
src/net/Address.cpp
)
# Demo application: sources
add_executable( esys-demo
example/main.cpp
)
# Demo application: required libraries
target_link_libraries( esys-demo
esys
)
# Set the compiler and linker flags for particular targets
set_target_properties( esys PROPERTIES COMPILE_FLAGS ${CPP_COMPILE_FLAGS} )
set_target_properties( esys-demo PROPERTIES COMPILE_FLAGS ${CPP_COMPILE_FLAGS} )
set_target_properties( esys-demo PROPERTIES LINK_FLAGS ${CPP_LINK_FLAGS} )
# Target install
install( TARGETS esys-demo DESTINATION bin )
install( TARGETS esys DESTINATION lib )
install( DIRECTORY
include/ DESTINATION include/${CMAKE_PROJECT_NAME}
FILES_MATCHING PATTERN "*.h"
)