You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
arts/flow/gsl/CMakeLists.txt

162 lines
3.4 KiB

#################################################
#
# (C) 2010 Serghei Amelian
# serghei (DOT) amelian (AT) gmail.com
#
# Improvements and feedback are welcome
#
# This file is released under GPL >= 2
#
#################################################
##### check for ogg/vorbis ######################
set( GSL_HAVE_OGGVORBIS 0 )
if( WITH_VORBIS )
pkg_search_module( VORBIS vorbis )
if( VORBIS_FOUND )
pkg_search_module( VORBISFILE vorbisfile )
if( VORBISFILE_FOUND )
set( GSL_HAVE_OGGVORBIS 1 )
try_compile(
GSL_HAVE_OGGVORBIS_RC3
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/check_for_ov_read_float.c
CMAKE_FLAGS "-DLINK_LIBRARIES=${VORBISFILE_LIBRARIES}"
)
else( VORBISFILE_FOUND )
message(FATAL_ERROR "\nOgg/Vorbis support are requested, but `libvorbisfile` not found" )
endif( VORBISFILE_FOUND )
else( VORBIS_FOUND )
message(FATAL_ERROR "\nOgg/Vorbis support are requested, but `libvorbis` but found" )
endif( VORBIS_FOUND )
endif( WITH_VORBIS )
##### check for libmad MPEG decoder #############
set( GSL_HAVE_LIBMAD 0 )
if( WITH_MAD )
pkg_search_module( MAD mad )
if( MAD_FOUND )
set( GSL_HAVE_LIBMAD 1 )
else( MAD_FOUND )
message(FATAL_ERROR "\nMAD support are requested, but `libmad` not found" )
endif( MAD_FOUND )
endif( WITH_MAD )
##### check for some type sizes #################
include( CheckTypeSize )
check_type_size( pthread_mutex_t GSL_SIZEOF_PTH_MUTEX_T )
check_type_size( pthread_cond_t GSL_SIZEOF_PTH_COND_T )
check_type_size( intmax_t GSL_SIZEOF_STD_INTMAX_T )
try_compile(
GSL_HAVE_MUTEXATTR_SETTYPE
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/check_for_pthread_mutexattr_settype.c
CMAKE_FLAGS "-DLINK_LIBRARIES=${CMAKE_THREAD_LIBS_INIT}"
)
set( GSL_USE_GSL_GLIB 1 )
set( GSL_USE_ARTS_THREADS 1 )
##### write configuration #######################
configure_file( gslconfig.h.in gslconfig.h )
##### compile ###################################
set( gsl_INCS
${CMAKE_CURRENT_BINARY_DIR}/gslconfig.h
gslcommon.h
gsldatacache.h
gsldatahandle.h
gsldefs.h
gslloader.h
gslmath.h
gslfilter.h
gsldatautils.h
gsldatahandle-vorbis.h
gslconvert.h
gslfft.h
gslieee754.h
gslsignal.h
gslmagic.h
gslengine.h
gslwaveosc.h
gslwavechunk.h
gsldatahandle-mad.h
gslosctable.h
gsloscillator.h
)
set( gsl_SRCS
gsldatacache.c
gsldatahandle.c
gslwavechunk.c
gsldatahandle-vorbis.c
gslmath.c
gslfilter.c
gslcommon.c
gsldatautils.c
gslmagic.c
gslloader-wav.c
gslloader-gslwave.c
gslloader-mad.c
gslloader-oggvorbis.c
gslconvert.c
gslfft.c
gslsignal.c
gslloader.c
gslwaveosc.c
gslengine.c
gsloputil.c
gslopmaster.c
gslopschedule.c
gsldatahandle-mad.c
gslosctable.c
gsloscillator.c
gslfilehash.c
gslartsthreads.cc
)
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/mcop
${CMAKE_SOURCE_DIR}/mcop # for thread.h
${CMAKE_CURRENT_BINARY_DIR}/.. # for gsl/gslconfig.h
${CMAKE_CURRENT_SOURCE_DIR}/.. # for gsl/gslcommon.h
${GLIB2_INCLUDE_DIRS}
)
add_library( gsl STATIC ${gsl_SRCS} )
set_target_properties( gsl PROPERTIES COMPILE_FLAGS -fPIC )
target_link_libraries( gsl ${GLIB2_LIBRARIES} ${GTHREAD2_LIBRARIES} ${VORBISFILE_LIBRARIES} ${MAD_LIBRARIES} )
##### install ###################################
install( FILES ${gsl_INCS} DESTINATION ${INCLUDE_INSTALL_DIR}/gsl )