-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
34 lines (30 loc) · 1.12 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
project(bird-rtrlib-cli)
cmake_minimum_required(VERSION 2.6)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=gnu99")
include_directories(.)
if(APPLE OR (UNIX AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Linux"))
find_package(Argp)
if(ARGP_FOUND)
message(STATUS "argp found.")
else()
message(FATAL_ERROR "argp not found!")
endif(ARGP_FOUND)
else()
set(ARGP_INCLUDE_DIRS "")
set(ARGP_LIBRARIES "")
endif(APPLE OR (UNIX AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Linux"))
if(NOT RTRLIB_INCLUDE AND NOT RTRLIB_LIBRARY)
find_package(Rtr)
if(RTR_FOUND)
message(STATUS "rtrlib found.")
else()
message(FATAL_ERROR "rtrlib not found!")
endif(RTR_FOUND)
else()
set(RTR_INCLUDE_DIRS ${RTRLIB_INCLUDE})
set(RTR_LIBRARIES ${RTRLIB_LIBRARY})
endif(NOT RTRLIB_INCLUDE AND NOT RTRLIB_LIBRARY)
include_directories(${ARGP_INCLUDE_DIRS} ${RTR_INCLUDE_DIRS} ${INCLUDE_DIRECTORIES})
add_executable(bird-rtrlib-cli bird-rtrlib-cli.c bird.c rtr.c cli.c config.c)
target_link_libraries(bird-rtrlib-cli ${ARGP_LIBRARIES} ${RTR_LIBRARIES})