summaryrefslogtreecommitdiffstats
path: root/flow/gsl/CMakeLists.txt
diff options
context:
space:
mode:
authorsamelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-10-05 19:35:48 +0000
committersamelian <samelian@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-10-05 19:35:48 +0000
commit36bb41f5bea5485f7c47dd18f47fc6177a370270 (patch)
treeb68d307bf656672eb444be1393342607875621ed /flow/gsl/CMakeLists.txt
parent3a7fbece07c6265d8ca9537efa1d269957bc862a (diff)
downloadarts-36bb41f5bea5485f7c47dd18f47fc6177a370270.tar.gz
arts-36bb41f5bea5485f7c47dd18f47fc6177a370270.zip
[dependencies/arts] added initial cmake support
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/dependencies/arts@1182851 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'flow/gsl/CMakeLists.txt')
-rw-r--r--flow/gsl/CMakeLists.txt161
1 files changed, 161 insertions, 0 deletions
diff --git a/flow/gsl/CMakeLists.txt b/flow/gsl/CMakeLists.txt
new file mode 100644
index 0000000..36ee59c
--- /dev/null
+++ b/flow/gsl/CMakeLists.txt
@@ -0,0 +1,161 @@
+#################################################
+#
+# (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 )
+