cmake_minimum_required(VERSION 3.8)
cmake_policy(SET CMP0063 NEW) # Honor visibility properties.

project(bl_qt CXX)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
conan_define_targets()

list(APPEND CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}")
find_package(Qt REQUIRED COMPONENTS Core Gui)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_AUTOMOC TRUE)
set(CMAKE_AUTORCC TRUE)

set(SAMPLES_DIR "${CMAKE_CURRENT_LIST_DIR}" CACHE PATH "Samples directory")
set(BLEND2D_DIR "${SAMPLES_DIR}/../../blend2d" CACHE PATH "Location of 'blend2d'")

set(BLEND2D_STATIC TRUE)
include("${BLEND2D_DIR}/CMakeLists.txt")

set(SAMPLES_TARGETS
  "bl-qt-gradients"
  "bl-qt-ellipticarc"
  "bl-qt-stroke"
  "bl-qt-text"

  "bl-qt-bounces"
  "bl-qt-circles"
  "bl-qt-particles"
  "bl-qt-polys"
  "bl-qt-rects"
  "bl-qt-tiger"
)

foreach(target ${SAMPLES_TARGETS})
  add_executable(${target} WIN32 src/${target}.cpp src/qblcanvas.cpp)
  set_property(TARGET ${target} PROPERTY CXX_VISIBILITY_PRESET hidden)
  target_link_libraries(${target} 
	blend2d::blend2d
	CONAN_LIB::qt_Qt5Core
	CONAN_LIB::qt_Qt5Gui
	CONAN_LIB::qt_Qt5Widgets
	CONAN_LIB::qt_Qt5FontDatabaseSupport
	CONAN_LIB::qt_Qt5WindowsUIAutomationSupport
	CONAN_LIB::qt_Qt5EventDispatcherSupport
	CONAN_LIB::qt_Qt5ThemeSupport
	CONAN_LIB::qt_qtmain
	CONAN_LIB::qt_qwindows
	Ws2_32.lib Imm32.lib Dwmapi.lib Wtsapi32.lib
	)
endforeach()
