cmake_minimum_required(VERSION 3.1.0)
project(lfr_image_processing VERSION 0.1.0)

include(CTest)
enable_testing()

set(THREADS_PREFER_PTHREAD_FLAG ON)

find_package( OpenCV REQUIRED )
find_package(Threads REQUIRED)

add_subdirectory(Input)
add_subdirectory(Processing)
add_subdirectory(ControlModule)
add_subdirectory(Interpreter)
add_subdirectory(IntersectionHandler)
add_subdirectory(Utils)
add_subdirectory(Spielwiese)

add_executable(lfr_image_processing lfr.cpp autonomous_mode_main.cpp)
add_library(lfr_image_processing_lib lfr.cpp)

target_include_directories(lfr_image_processing PUBLIC ${OpenCV_INCLUDE_DIRS})
target_include_directories(lfr_image_processing PUBLIC ${Input_SOURCE_DIRS})
target_include_directories(lfr_image_processing PUBLIC ${Processing_SOURCE_DIRS})
target_include_directories(lfr_image_processing PUBLIC ${ControlModule_SOURCE_DIRS})
target_include_directories(lfr_image_processing PUBLIC ${Interpreter_SOURCE_DIRS})
target_include_directories(lfr_image_processing PUBLIC ${IntersectionHandler_SOURCE_DIRS})
target_include_directories(lfr_image_processing PUBLIC ${Utils_SOURCE_DIRS})
target_include_directories(lfr_image_processing PUBLIC .)

target_include_directories(lfr_image_processing_lib PUBLIC ${OpenCV_INCLUDE_DIRS})
target_include_directories(lfr_image_processing_lib PUBLIC ${Input_SOURCE_DIRS})
target_include_directories(lfr_image_processing_lib PUBLIC ${Processing_SOURCE_DIRS})
target_include_directories(lfr_image_processing_lib PUBLIC ${ControlModule_SOURCE_DIRS})
target_include_directories(lfr_image_processing_lib PUBLIC ${Interpreter_SOURCE_DIRS})
target_include_directories(lfr_image_processing_lib PUBLIC ${IntersectionHandler_SOURCE_DIRS})
target_include_directories(lfr_image_processing_lib PUBLIC .)

target_link_libraries( lfr_image_processing ${OpenCV_LIBS} Input Processing ControlModule Interpreter IntersectionHandler Utils Threads::Threads)
target_link_libraries( lfr_image_processing_lib ${OpenCV_LIBS} Input Processing ControlModule Interpreter IntersectionHandler Utils Threads::Threads)

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
