cmake_minimum_required(VERSION 3.14)
project(ExampleCustomDecoder)
set(CMAKE_C_STANDARD 11)

if (LIBBLUESPY)
elseif (WIN32)
    set(LIBBLUESPY "${CMAKE_CURRENT_LIST_DIR}/../libblueSPY.dll")
elseif(APPLE)
    set(LIBBLUESPY "${CMAKE_CURRENT_LIST_DIR}/../libblueSPY.dylib")
else()
    set(LIBBLUESPY "${CMAKE_CURRENT_LIST_DIR}/../libblueSPY.so")
endif()

if (NOT BLUESPY_INC_DIR)
    set(BLUESPY_INC_DIR "{CMAKE_CURRENT_LIST_DIR}/..")
endif()

add_library(ExampleCustomDecoder SHARED ${CMAKE_CURRENT_LIST_DIR}/example_custom_decoder.c)
target_link_libraries(ExampleCustomDecoder PUBLIC ${LIBBLUESPY})
target_include_directories(ExampleCustomDecoder PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ${BLUESPY_INC_DIR})

add_library(ExampleCustomDecoderCXX SHARED ${CMAKE_CURRENT_LIST_DIR}/example_custom_decoder.cpp)
target_link_libraries(ExampleCustomDecoderCXX PUBLIC ${LIBBLUESPY})
target_include_directories(ExampleCustomDecoderCXX PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ${BLUESPY_INC_DIR})
