# CamCap (C) 2017 Stephane Charette <stephanecharette@gmail.com>
# $Id: CMakeLists.txt 2144 2017-02-08 16:47:25Z stephane $

# Get a sorted list of our own source files
FILE ( GLOB CAMCAP_LIB_CPP *.cpp )
FILE ( GLOB CAMCAP_LIB_HPP *.hpp )
LIST ( SORT CAMCAP_LIB_CPP )
LIST ( SORT CAMCAP_LIB_HPP )

SET ( CAMCAP_LIB_NAME	camcap )
SET ( CAMCAP_LIB_STATIC	${CAMCAP_LIB_NAME} )
SET ( CAMCAP_LIB_SHARED	${CAMCAP_LIB_NAME}_shared )

# this creates the static library (.a)
ADD_LIBRARY				( ${CAMCAP_LIB_STATIC} STATIC ${CAMCAP_LIB_CPP} )

# this creates the shared library (.so)
ADD_LIBRARY				( ${CAMCAP_LIB_SHARED} SHARED ${CAMCAP_LIB_CPP} )
SET_TARGET_PROPERTIES	( ${CAMCAP_LIB_SHARED} PROPERTIES OUTPUT_NAME "${CAMCAP_LIB_NAME}" )
SET_TARGET_PROPERTIES	( ${CAMCAP_LIB_SHARED} PROPERTIES PREFIX "lib" )


INSTALL ( TARGETS ${CAMCAP_LIB_STATIC}			DESTINATION lib )
INSTALL ( TARGETS ${CAMCAP_LIB_SHARED} LIBRARY	DESTINATION lib )
INSTALL ( FILES ${CAMCAP_LIB_HPP}				DESTINATION include )
