#
# cmake configuration file
#
# This file is part of the IRCAM SDIF Library (http://www.ircam.fr/sdif)
#
# Copyright (C) 2006 by IRCAM - Centre Pompidou, Paris, France.
#
# created by Axel Roebel                     7.12.2006
#


SET(sdif_noinst_HEADERS 
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifFGet.h 	
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifErrMess.h 	
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifMatrix.h
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifTest.h 	
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifStreamID.h  
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifMatrixType.h 	
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifFPut.h 	
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifFRead.h	
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifFScan.h 	
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifFWrite.h 	
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifFile.h      
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifSelect.h	
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifFrame.h 	
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifFrameType.h 
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifGlobals.h 	
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifHard_OS.h 	
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifHash.h	
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifHighLevel.h 
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifList.h 	
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifRWLowLevel.h	
  ${CMAKE_CURRENT_SOURCE_DIR}/sdiftypes.h		
  ${CMAKE_CURRENT_SOURCE_DIR}/sdif_portability.h 
  ${CMAKE_CURRENT_SOURCE_DIR}/host_architecture.h)

SET(sdif_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/SdifCheck.c  
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifConvToText.c  
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifErrMess.c 
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifFGet.c          
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifFile.c        
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifFPrint.c
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifFPut.c          
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifFrame.c       
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifFrameType.c
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifFRead.c         
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifFScan.c       
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifFWrite.c
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifGlobals.c       
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifHard_OS.c     
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifHash.c
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifHighLevel.c     
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifList.c        
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifMatrix.c
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifMatrixType.c    
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifNameValue.c   
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifPreTypes.c
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifPrint.c         
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifRWLowLevel.c  
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifSelect.c
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifSignatureTab.c  
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifStreamID.c    
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifString.c
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifTest.c          
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifTextConv.c    
  ${CMAKE_CURRENT_SOURCE_DIR}/SdifTimePosition.c
)

IF(SDIF_BUILD_STATIC)
  ADD_LIBRARY(sdif_static${DEBUGEXT} STATIC ${sdif_SOURCES} )
  SET_TARGET_PROPERTIES(sdif_static${DEBUGEXT} PROPERTIES COMPILE_FLAGS "-DSDIF_IS_STATIC")
ENDIF(SDIF_BUILD_STATIC)
ADD_LIBRARY(sdif${DEBUGEXT} SHARED ${sdif_SOURCES} )

SET_TARGET_PROPERTIES(sdif${DEBUGEXT} PROPERTIES VERSION ${SDIF_VERSION} COMPILE_FLAGS -DDO_EXPORT_SDIF=1)

IF(APPLE AND NOT SDIF_BUILD_STATIC)
 SET_TARGET_PROPERTIES(sdif${DEBUGEXT} PROPERTIES INSTALL_NAME_DIR  ${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR} )
ENDIF(APPLE AND NOT SDIF_BUILD_STATIC)

INSTALL(TARGETS  sdif${DEBUGEXT}  
  LIBRARY   DESTINATION ${INSTALL_LIB_DIR}
  RUNTIME   DESTINATION ${INSTALL_BIN_DIR}
  ARCHIVE   DESTINATION ${INSTALL_LIB_DIR}
)

INCLUDE(STORE_FILES_LIST)
STORE_FILES_LIST(srcDOCFILES ${sdif_SOURCES} ${sdif_HEADERS}  ${sdif_noinst_HEADERS})
