# Configure the variable
MESSAGE("gp_lib_config.h.cmake gp_lib_config.h")
configure_file (gp_lib_config.h.cmake ${CMAKE_SOURCE_DIR}/src/cpp/libgroupingprotein/gp_lib_config.h)

# (QT_USE_FILE is a variable defined by FIND_PACKAGE( Qt4 ) that contains a path to CMake script)
INCLUDE( ${QT_USE_FILE} )

#SET(PG_LIB_MOC_HDRS
#  pg_protseqengine.h
#)

SET(GP_SRC_LIB grouping/groupng.cpp
  pg_utils.cpp
  gp_lib_config.h
  gp_engine.cpp
  pg_protseqengine.cpp
  pg_protseqfilterpeptideorphans.cpp
  gp_params.cpp
  identification/peptide.cpp 
  identification/protein_match.cpp
  identification/peptide_set.cpp
  identification/sample.cpp
  sax/peptide_result_parser.cpp
  sax/protein_grouping_result.cpp
  filter/data_filter.cpp
  filter/fasta_filter.cpp
  filter/peptide_repro_filter.cpp
  filter/peptide_by_prot_filter.cpp
  grouping/group.cpp
  grouping/group_set.cpp
  grouping/threadsafe_group_set.cpp
  grouping/sub_group.cpp
  grouping/sub_group_set.cpp
)

set(CMAKE_MODULE_PATH ${gpf_SOURCE_DIR}/modules)

#set(Qwt5_DIR ${gpf_SOURCE_DIR}/Modules)
#FIND_PACKAGE(Qwt5 REQUIRED)

# this command will generate rules that will run rcc on all files from SAMPLE_RCS
# in result SAMPLE_RC_SRCS variable will contain paths to files produced by rcc
#QT4_ADD_RESOURCES( SAMPLE_RC_SRCS ${SAMPLE_RCS} )
  
# this will run uic on .ui files:
#QT4_WRAP_UI( SAMPLE_UI_HDRS ${SAMPLE_UIS} )
  
#QT4_WRAP_CPP( PG_LIB_MOC_SRCS ${PG_LIB_MOC_HDRS} )
  
# we need this to be able to include headers produced by uic in our code
# (CMAKE_BINARY_DIR holds a path to the build directory, while INCLUDE_DIRECTORIES() works just like INCLUDEPATH from qmake)

INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR})  



  ADD_LIBRARY(${GP_LIB_NAME} SHARED ${GP_SRC_LIB} )
  
  SET_TARGET_PROPERTIES(${GP_LIB_NAME} PROPERTIES 
    VERSION ${GP_LIB_VERSION}
    SOVERSION ${GP_LIB_SOVERSION}
    )

INSTALL(TARGETS ${GP_LIB_NAME} LIBRARY DESTINATION lib)