cmake_minimum_required(VERSION 3.15)

project(startCode)

set(as_subproject QGLVIEWER)
macro(find_package)
  if(NOT "${ARGV0}" IN_LIST as_subproject)
	_find_package(${ARGV})
  else()
	set(${ARGV0}_FOUND true)
  endif()
endmacro()

add_subdirectory(external/libQGLViewer)
add_subdirectory(external/DGtal)

# Make sure the compiler can find include files.
include_directories(${PROJECT_SOURCE_DIR}/Volumes/)
include_directories(${PROJECT_BINARY_DIR}/Volumes/)

# ConfigExamples.h instanciation.
configure_file(${PROJECT_SOURCE_DIR}/ConfigExamples.h.in
  ${PROJECT_SOURCE_DIR}/ConfigExamples.h)

find_package(Qt5 REQUIRED COMPONENTS Widgets)
add_executable(startCode startCode.cpp)
target_link_libraries(startCode PRIVATE libQGLViewer DGtal Qt5::Widgets)
target_compile_definitions(startCode PRIVATE
  WITH_QT5 true
  WITH_VISU3D_QGLVIEWER true)
