cmake_minimum_required(VERSION 2.8.3)
project(qt_pi_eeg)

set(CMAKE_CXX_FLAGS "-std=c++0x")
#-fpermissive
#ros setup
find_package(catkin REQUIRED COMPONENTS
roscpp
roslib
)

#Mcrypt library includes
find_package(PkgConfig REQUIRED)
find_path(Mcrypt_INCLUDE_DIR mcrypt.h PATHS /usr/include)
set(Mcrypt_LIB_PATHS /usr/lib)
find_library(Mcrypt_LIBS NAMES mcrypt rtfilter PATHS ${Mcrypt_LIB_PATHS})
include_directories(${Mcrypt_INCLUDE_DIRS})
link_directories(${Mcrypt_LIBS})

#Gattlib includes
pkg_search_module(GATTLIB REQUIRED gattlib)
pkg_search_module(GLIB REQUIRED glib-2.0)
include_directories(${GLIB_INCLUDE_DIRS})

include_directories(include
    ${catkin_INCLUDE_DIRS}
)

#ble_connect library generation
add_library(ble_connect include/ble_connect/ble_connect.h src/ble_connect.c)
target_link_libraries(ble_connect ${GATTLIB_LIBRARIES} ${GATTLIB_LDFLAGS} ${GLIB_LDFLAGS} pthread ${Mcrypt_LIBS})

#ble_connect_test executable generation
add_executable(ble_connect_test tests/ble_test.cpp)
target_link_libraries(ble_connect_test ble_connect)

