-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
45 lines (36 loc) · 1.23 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
project(speedwire-router)
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 11)
# This CMake configuration assumes the following directory layout
#
# - speedwire-router
# - libspeedwire
# - <relative build path>
# determine relative build and install paths
message("CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE}")
message("CMAKE_BINARY_DIR ${CMAKE_BINARY_DIR}")
message("CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}")
# dependencies (adapt to your needs)
add_subdirectory("libspeedwire")
# project sources and include path
set(PROJECT_SOURCES
src/BounceDetector.cpp
src/PacketPatcher.cpp
src/SpeedwirePacketReceiver.cpp
src/SpeedwirePacketSender.cpp
src/main.cpp
)
set(PROJECT_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include)
# build configuration
add_executable(${PROJECT_NAME} ${PROJECT_SOURCES})
add_dependencies(${PROJECT_NAME} speedwire)
target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_INCLUDE_DIR} speedwire)
if (MSVC)
target_link_libraries(${PROJECT_NAME} speedwire ws2_32.lib Iphlpapi.lib)
else()
target_link_libraries(${PROJECT_NAME} speedwire)
endif()
set_target_properties(${PROJECT_NAME}
PROPERTIES OUTPUT_NAME ${PROJECT_NAME}
)
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})