project(qcustomplot)

cmake_minimum_required(VERSION 2.6)

# 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)

# add lib as a camitk tool
camitk_tool(SHARED
            SOURCES ${CUSTOM_PLOT_SOURCES}
            TARGET_LINK_LIBRARIES ${QT_LIBRARIES}
            INCLUDE_DIRECTORIES ${QT_INCLUDE_DIR}
)

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

#--------------
# installation
#--------------
export_headers(${CUSTOM_PLOT_HEADERS}
                COMPONENT qcustomplot)

# lib installation
install(TARGETS qcustomplot
        RUNTIME DESTINATION bin
        LIBRARY DESTINATION lib
        ARCHIVE DESTINATION lib/${CAMITK_SHORT_VERSION_STRING}
        COMPONENT qcustomplot
)





    