project(qcustomplot)

cmake_minimum_required(VERSION 2.6)

if (PACKAGING_NSIS)
    set(LIB_NAME library_qcustomplot)
else()
    set(LIB_NAME library-qcustomplot)
endif()

# Qt is required
find_package(Qt4 REQUIRED)
include(${QT_USE_FILE})

#headers
set(CUSTOM_PLOT_HEADERS 
  qcustomplot.h
  QCustomPlotAPI.h
)

# Qt headers
set(CUSTOM_PLOT_QT_HEADERS 
  qcustomplot.h
)

QT4_WRAP_CPP(CUSTOM_PLOT_QT_HEADERS_MOC ${CUSTOM_PLOT_QT_HEADERS})

# sources files
set(CUSTOM_PLOT_SOURCES
  qcustomplot.cpp
  ${CUSTOM_PLOT_HEADERS}
  ${CUSTOM_PLOT_QT_HEADERS_MOC}
)

add_definitions(-DCOMPILE_QCUSTOMPLOT)

# take all the headers for installation
file(GLOB HEADERS_H "src/*.h")
file(GLOB HEADERS_UPPERCASE "src/Qt*")

# add lib as a camitk tool
camitk_library(SHARED
               SOURCES ${CUSTOM_PLOT_SOURCES}
               TARGET_LINK_LIBRARIES ${QT_LIBRARIES}
               INCLUDE_DIRECTORIES ${QT_INCLUDE_DIR}
               HEADERS_TO_INSTALL ${CUSTOM_PLOT_HEADERS}
               CEP_NAME CEP_MODELING
               DESCRIPTION "Tool to draw dots (plots) in a Qt interface."
)    