MESSAGE(STATUS "\nStart processing lib dir.\n")

########################################################
# Files

file(GLOB moblib_SRCS *.cpp)

set(CMAKE_INCLUDE_CURRENT_DIR ON)


########################################################
# Build

set(CMAKE_BUILD_TYPE, "debug")
if(CMAKE_BUILD_TYPE STREQUAL "debug")
  add_definitions(-g -O0)
endif()

# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)

find_package(Qt5 COMPONENTS Xml Svg Sql)

add_library(moblib STATIC 
  ${moblib_SRCS})

qt5_use_modules(moblib Xml)
qt5_use_modules(moblib Svg)
qt5_use_modules(moblib Sql)

include_directories(
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_BINARY_DIR} # for the config.h file generated from config.h.in
  ${Qt5Xml_INCLUDE_DIRS}
  ${Qt5Svg_INCLUDE_DIRS}
  ${Qt5Sql_INCLUDE_DIRS})

message(STATUS "Qt5Xml: " ${Qt5Xml_INCLUDE_DIRS})
message(STATUS "Qt5Svg: " ${Qt5Svg_INCLUDE_DIRS})
message(STATUS "Qt5Sql: " ${Qt5Sql_INCLUDE_DIRS})

target_link_libraries(moblib
  Qt5::Xml
  Qt5::Svg
  Qt5::Sql)


MESSAGE(STATUS "\nFinished processing lib dir.\n")
