INCLUDE(FortranSettings)

TRIBITS_SUBPACKAGE(Fastq)

INCLUDE_DIRECTORIES(
  "${CMAKE_CURRENT_SOURCE_DIR}"
  )

SET(HEADERS "")

APPEND_GLOB(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.f ${CMAKE_CURRENT_SOURCE_DIR}/*.F)
list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/fastq.f")

TRIBITS_ADD_LIBRARY(
  fastqlib
  STATIC
  HEADERS ${HEADERS}
  SOURCES ${SOURCES}
  )

TRIBITS_ADD_EXECUTABLE(
  fastq_x11
  NOEXEPREFIX
  NOEXESUFFIX
  LINKER_LANGUAGE Fortran
  SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/fastq.f
	  ${CMAKE_CURRENT_SOURCE_DIR}/cgi/x11_cgisx11.c
  COMM serial mpi
  INSTALLABLE
  )

TRIBITS_ADD_EXECUTABLE(
  fastq_xcps
  NOEXEPREFIX
  NOEXESUFFIX
  LINKER_LANGUAGE Fortran
  SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/fastq.f
	  ${CMAKE_CURRENT_SOURCE_DIR}/cgi/vdx11cps.F
	  ${CMAKE_CURRENT_SOURCE_DIR}/cgi/vdicps_dual.f
  COMM serial mpi
  INSTALLABLE
  )

TRIBITS_ADD_EXECUTABLE(
  fastq_cps
  NOEXEPREFIX
  NOEXESUFFIX
  LINKER_LANGUAGE Fortran
  SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/fastq.f
	  ${CMAKE_CURRENT_SOURCE_DIR}/cgi/vdicps.f
  COMM serial mpi
  INSTALLABLE
  )

SET_PROPERTY(TARGET fastq_x11  PROPERTY POSITION_INDEPENDENT_CODE TRUE)
SET_PROPERTY(TARGET fastq_xcps PROPERTY POSITION_INDEPENDENT_CODE TRUE)
SET_PROPERTY(TARGET fastq_cps  PROPERTY POSITION_INDEPENDENT_CODE TRUE)

TRIBITS_SUBPACKAGE_POSTPROCESS()

