cmake_minimum_required(VERSION 2.8.12)

project(upload-recreate)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_definitions(-DWT_NO_SLOT_MACROS)

set(WT_CONNECTOR "wthttp" CACHE STRING "Connector used (wthttp or wtfcgi)")

set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)

find_package(Qt5Core)
find_package(Wt)
find_package(Boost REQUIRED COMPONENTS thread system regex)

if(Boost_FOUND)
  include_directories(${Boost_INCLUDE_DIRS})
  link_directories(${Boost_LIBRARY_DIRS})
endif(Boost_FOUND)

add_executable(${PROJECT_NAME} "main.cpp" "DispatchThread.C" "WQApplication.C")

target_link_libraries(${PROJECT_NAME} Qt5::Core
		      ${Boost_LIBRARIES} ${WT_CONNECTOR} wt)
