#
# LDASTools frameCPP - A library implementing the LIGO/Virgo frame specification
#
# Copyright (C) 2018 California Institute of Technology
#
# LDASTools frameCPP is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 (GPLv2) of the
# License or at your discretion, any later version.
#
# LDASTools frameCPP is distributed in the hope that it will be useful, but
# without any warranty or even the implied warranty of merchantability
# or fitness for a particular purpose. See the GNU General Public
# License (GPLv2) for more details.
#
# Neither the names of the California Institute of Technology (Caltech),
# The Massachusetts Institute of Technology (M.I.T), The Laser
# Interferometer Gravitational-Wave Observatory (LIGO), nor the names
# of its contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# You should have received a copy of the licensing terms for this
# software included in the file LICENSE located in the top-level
# directory of this package. If you did not, you can view a copy at
# http://dcc.ligo.org/M1500244/LICENSE
#

#------------------------------------------------------------------------
# form: <(c)urrent>:<(r)elease>:<(a)ge
#
# 1. Update the version information only immediately before a public
#    release of your software. More frequent updates are unnecessary,
#    and only guarantee that the current interface number gets larger
#    faster.
# 2. If the library source code has changed at all since the last
#    update, then increment revision (c:r:a becomes c:r+1:a).
# 3. If any interfaces [exported functions or data] have been added,
#    removed, or changed since the last update, increment current,
#    and set revision to 0.
# 4. If any interfaces have been added since the last public
#    release, then increment age.
# 5. If any interfaces have been removed since the last public
#    release, then set age to 0.
#------------------------------------------------------------------------
# => 1:0:0 -- 2009.12.03
#   In preperation for 1.18.0 release of ldas
# => 2:0:0 -- 2012.02.12
#   In preperation for 1.19.21 release of ldas
# => 3:0:0 -- 2012.02.12
#   In preperation for 1.19.31 release of ldas
# => 3:1:0 -- 2015.07.06
#   Corrected C prototypes for functions that take no arguments.
# => 3:2:0 -- 2016.10.10
#   Modified lower libraries
# 3:3:0 - 2017.11.06 (ldas-tools-framecpp-2.5.8)
#    Corrections for GCC 7.2.0 and XCode 9.0
# 3:4:0 - 2018.05.11 ( ldas-tools-framecpp-2.6.0 )
#    Removed hand rolled smart pointers in favor of boost smart pointers
# 3:5:0 - ldas-tools-framecpp-2.6.1
#    Corrected compression checking logic (#44)
#------------------------------------------------------------------------
set( libframecppc_la_CURRENT 3 )
set( libframecppc_la_REVISION 5 )
set( libframecppc_la_AGE 0 )

set( EXTRA_DIST
	framecppc.pc.in
	CInterface.txt
  )

set( HDR_DIR framecppc )
set( hdir ${CMAKE_INSTALL_INCLUDEDIR}/${HDR_DIR} )

#=========================================================================
# General files
#=========================================================================
set( libframecppc_la_SOURCES
	FrameC.cc
	FrameH.cc
	FrChan.cc
	FrDetector.cc
	FrEvent.cc
	FrHistory.cc
	FrTOC.cc
	Stream.cc
  )

list(APPEND noinst_HEADERS
	FrameCInternal.hh
	FrameHInternal.hh
	FrChanInternal.hh
	FrDetectorInternal.hh
	FrEventInternal.hh
	FrHistoryInternal.hh
	StreamInternal.hh
  )

set( h_HEADERS
	FrameC.h
	FrameH.h
	FrChan.h
	FrDetector.h
	FrEvent.h
	FrHistory.h
	FrTOC.h
	FrVect.h
	Stream.h
  )

cx_link_headers( ${HDR_DIR} ${h_HEADERS} )

#=========================================================================
# Wrap things up
#=========================================================================

set( libframecppc_la_LIBADD
	framecpp
  )

cx_target_library(
  TARGET framecppc
  CURRENT ${libframecppc_la_CURRENT}
  REVISION ${libframecppc_la_REVISION}
  AGE ${libframecppc_la_AGE}
  STATIC
  SOURCES ${libframecppc_la_SOURCES}
  LIBRARIES ${libframecppc_la_LIBADD}
  INCLUDE_DIRECTORIES BEFORE PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_BINARY_DIR}/include
    ${CMAKE_BINARY_DIR}
    ${LDASTOOLS_INCLUDE_DIRS}
  ABI_MESSAGE "FrameCPP C Library"
  ABI_HEADER_DIR ${HDR_DIR}
  ABI_LOCAL_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include/${HDR_DIR}
  ABI_HEADERS
  ${h_HEADERS}
  )
cx_install_header(
  FILES ${h_HEADERS}
  DESTINATION "${hdir}"
  )
cx_target_pkgconfig(
  framecppc
  )
