cmake_minimum_required(VERSION 2.8.3)
project(qt_pi_gui)

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

#Qt setup and MOC generation
find_package(Qt5 REQUIRED COMPONENTS Core Gui OpenGL)
set(MOC include/speller/speller.h include/mapview/mapview.h)
set(HPP include/mapview/vertex.h)
set(SRCS src/speller.cpp src/mapview.cpp )
set(CMAKE_INCLUDE_CURRENT_DIR ON)
qt5_wrap_cpp(MOC_HPP ${MOC})
qt5_add_resources(RCC resources/resources.qrc)

include_directories(include
    ${catkin_INCLUDE_DIRS}
)

#speller library generation
add_library(speller ${SRCS} ${FORMS_HPP} ${MOC_HPP} ${RCC} ${HPP})
target_link_libraries(speller Qt5::Widgets Qt5::Core Qt5::OpenGL Qt5::Gui ${catkin_LIBRARIES} ble_connect)

#QImage view test executable generation
add_executable(map_load_test tests/map_load_test.cpp)
target_link_libraries(map_load_test speller)

#main executable generation
add_executable(speller_ui src/main.cpp)
target_link_libraries(speller_ui speller)
