cmake_minimum_required(VERSION 2.8)

project(FlexiportExample)

# Search for dependencies
find_package(Flexiport)

# Set compiler flags
include_directories(${Flexiport_INCLUDE_DIRS})
add_definitions(${Flexiport_DEFINITIONS})

# Serial example
add_executable(${PROJECT_NAME}_serial_example serial_example.cpp)
target_link_libraries(${PROJECT_NAME}_serial_example
    ${Flexiport_LIBRARIES})

# TCP example
add_executable(${PROJECT_NAME}_tcp_example tcp_example.cpp)
target_link_libraries(${PROJECT_NAME}_tcp_example
    ${Flexiport_LIBRARIES})

# UDP example
add_executable(${PROJECT_NAME}_udp_example udp_example.cpp)
target_link_libraries(${PROJECT_NAME}_udp_example
    ${Flexiport_LIBRARIES})

if(NOT WIN32)
    # PortToPort example (not available on Windows)
    add_executable(${PROJECT_NAME}_porttoport porttoport.cpp)
    target_link_libraries(${PROJECT_NAME}_porttoport
        ${Flexiport_LIBRARIES})
endif(NOT WIN32)

