@ -1,34 +1,18 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# #
# ( C ) 2 0 1 0 S e r g h e i A m e l i a n
# ( C ) 2 0 1 0 S e r g h e i A m e l i a n #
# serghei ( DOT ) amelian ( AT ) g m a i l . c o m
# serghei ( DOT ) amelian ( AT ) g m a i l . c o m #
#
# #
# I m p r o v e m e n t s a n d f e e d b a c k a r e w e l c o m e
# I m p r o v e m e n t s a n d f e e d b a c k a r e w e l c o m e #
#
# #
# T h i s f i l e i s r e l e a s e d u n d e r G P L > = 2
# T h i s f i l e i s r e l e a s e d u n d e r G P L > = 2 #
#
# #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
cmake_minimum_required ( VERSION 2.8.12 )
cmake_minimum_required ( VERSION 2.8.12 )
# # # # # i n c l u d e e s s e n t i a l c m a k e m o d u l e s # # # # # # # # # # #
# # # # # g e n e r a l p a c k a g e s e t u p
include ( CheckCXXSourceCompiles )
include ( CheckFunctionExists )
include ( CheckSymbolExists )
include ( CheckPrototypeDefinition )
include ( CheckIncludeFile )
include ( CheckLibraryExists )
include ( FindPkgConfig )
# # # # # i n c l u d e o u r c m a k e m o d u l e s # # # # # # # # # # # # # # # # #
set ( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
include ( TDEMacros )
# # # # # p r o j e c t s e t t i n g s # # # # # # # # # # # # # # # # # # # # # # # # # #
project ( arts )
project ( arts )
@ -38,20 +22,24 @@ set( ARTS_MICRO_VERSION 10 )
set ( ARTS_VERSION "${ARTS_MAJOR_VERSION}.${ARTS_MINOR_VERSION}.${ARTS_MICRO_VERSION}" )
set ( ARTS_VERSION "${ARTS_MAJOR_VERSION}.${ARTS_MINOR_VERSION}.${ARTS_MICRO_VERSION}" )
# # # # # us e r r e q u e s t e d o p t i o n s # # # # # # # # # # # # # # # # # # # #
# # # # # in c l u d e e s s e n t i a l c m a k e m o d u l e s
option ( WITH_ALL_OPTIONS "Enable all optional support" OFF )
include ( FindPkgConfig )
option ( WITH_ALSA "Enable ALSA support" ON )
include ( CheckFunctionExists )
option ( WITH_AUDIOFILE "Enable audiofile (wav) support" ON )
include ( CheckSymbolExists )
option ( WITH_VORBIS "Enable Ogg/Vorbis support" ON )
include ( CheckIncludeFile )
option ( WITH_MAD "Enable MAD mp3 decoder support" ON )
include ( CheckIncludeFiles )
option ( WITH_ESOUND "Enable ESOUND support" ${ WITH_ALL_OPTIONS } )
include ( CheckLibraryExists )
option ( WITH_JACK "Enable JACK support" ${ WITH_ALL_OPTIONS } )
include ( CheckPrototypeDefinition )
option ( WITH_SNDIO "Enable SNDIO support" OFF )
include ( CheckCSourceCompiles )
option ( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${ WITH_ALL_OPTIONS } )
# # # # # i n c l u d e o u r c m a k e m o d u l e s
# # # # # p a t h s s e t u p # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
set ( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
include ( TDEMacros )
# # # # # s e t u p i n s t a l l p a t h s
tde_setup_install_path ( EXEC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" )
tde_setup_install_path ( EXEC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" )
tde_setup_install_path ( BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" )
tde_setup_install_path ( BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" )
@ -60,184 +48,60 @@ tde_setup_install_path( INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/$
tde_setup_install_path ( PKGCONFIG_INSTALL_DIR "${LIB_INSTALL_DIR}/pkgconfig" )
tde_setup_install_path ( PKGCONFIG_INSTALL_DIR "${LIB_INSTALL_DIR}/pkgconfig" )
# # # # # s e t u p a r c h i t e c t u r e f l a g s # # # # # # # # # # # # # # # # # #
# # # # # o p t i o n a l s t u f f
tde_setup_architecture_flags ( )
include ( TestBigEndian )
test_big_endian ( WORDS_BIGENDIAN )
tde_setup_largefiles ( )
# # # # # c h e c k f o r i n c l u d e f i l e s # # # # # # # # # # # # # # # # # # #
check_include_file ( "sys/time.h" HAVE_SYS_TIME_H )
check_include_file ( "time.h" TIME_WITH_SYS_TIME )
check_include_file ( "stdio.h" HAVE_STDIO_H )
check_include_file ( "stdlib.h" HAVE_STDLIB_H )
check_include_file ( "string.h" HAVE_STRING_H )
check_include_file ( "strings.h" HAVE_STRINGS_H )
check_include_file ( "ctype.h" HAVE_CTYPE_H )
check_include_file ( "malloc.h" HAVE_MALLOC_H )
check_include_file ( "memory.h" HAVE_MEMORY_H )
check_include_file ( "dlfcn.h" HAVE_DLFCN_H )
check_include_file ( "sys/soundcard.h" HAVE_SYS_SOUNDCARD_H )
check_include_file ( "pthread.h" HAVE_LIBPTHREAD )
# # # # # c h e c k f o r s y s t e m l i b r a r i e s # # # # # # # # # # # # # # # #
set ( DL_LIBRARIES dl )
check_library_exists ( ${ DL_LIBRARIES } dlopen /lib HAVE_LIBDL )
if ( NOT HAVE_LIBDL )
unset ( DL_LIBRARIES )
check_function_exists ( dlopen HAVE_DLOPEN )
if ( HAVE_DLOPEN )
set ( HAVE_LIBDL 1 )
endif ( HAVE_DLOPEN )
endif ( NOT HAVE_LIBDL )
find_package ( Threads )
# # # # # c h e c k f o r f u n c t i o n s # # # # # # # # # # # # # # # # # # # # # # #
set ( bak_CMAKE_REQUIRED_LIBRARIES ${ CMAKE_REQUIRED_LIBRARIES } )
set ( CMAKE_REQUIRED_LIBRARIES ${ DL_LIBRARIES } )
check_function_exists ( dlerror HAVE_DLERROR )
check_function_exists ( strcmp HAVE_STRCMP )
check_function_exists ( strchr HAVE_STRCHR )
check_function_exists ( index HAVE_INDEX )
check_function_exists ( strrchr HAVE_STRRCHR )
check_function_exists ( rindex HAVE_RINDEX )
check_function_exists ( memcpy HAVE_MEMCPY )
check_function_exists ( bcopy HAVE_BCOPY )
set ( CMAKE_REQUIRED_LIBRARIES ${ bak_CMAKE_REQUIRED_LIBRARIES } )
unset ( bak_CMAKE_REQUIRED_LIBRARIES )
check_prototype_definition ( ioctl "int ioctl(int d, int request, ...)" "-1" "unistd.h;sys/ioctl.h" HAVE_IOCTL_INT_INT_DOTS )
check_prototype_definition ( ioctl "int ioctl(int d, unsigned long request, ...)" "-1" "unistd.h;sys/ioctl.h" HAVE_IOCTL_INT_ULONG_DOTS )
# # # # # c h e c k f o r a u d i o f i l e # # # # # # # # # # # # # # # # # # # # # # #
set ( HAVE_LIBAUDIOFILE 0 )
if ( WITH_AUDIOFILE )
pkg_search_module ( AUDIOFILE audiofile )
if ( AUDIOFILE_FOUND )
set ( HAVE_LIBAUDIOFILE 1 )
else ( AUDIOFILE_FOUND )
message ( FATAL_ERROR "\naudiofile (wav) support are requested, but `libaudiofile` not found" )
endif ( AUDIOFILE_FOUND )
endif ( WITH_AUDIOFILE )
# # # # # c h e c k f o r a l s a # # # # # # # # # # # # # # # # # # # # # # # # # # # #
set ( HAVE_LIBASOUND2 0 )
if ( WITH_ALSA )
pkg_search_module ( ALSA alsa )
if ( ALSA_FOUND )
# t h e r e i s s u p p o r t o n l y f o r A L S A 1 . x
set ( HAVE_LIBASOUND2 1 )
set ( ALSA_PCM_OLD_SW_PARAMS_API 1 )
set ( ALSA_PCM_OLD_HW_PARAMS_API 1 )
check_include_file ( "alsa/asoundlib.h" HAVE_ALSA_ASOUNDLIB_H )
if ( NOT HAVE_ALSA_ASOUNDLIB_H )
check_include_file ( "sys/asoundlib.h" HAVE_SYS_ASOUNDLIB_H )
endif ( NOT HAVE_ALSA_ASOUNDLIB_H )
set ( bak_CMAKE_REQUIRED_LIBRARIES ${ CMAKE_REQUIRED_LIBRARIES } )
set ( CMAKE_REQUIRED_LIBRARIES ${ ALSA_LIBRARIES } )
check_function_exists ( snd_pcm_resume HAVE_SND_PCM_RESUME )
set ( CMAKE_REQUIRED_LIBRARIES ${ bak_CMAKE_REQUIRED_LIBRARIES } )
unset ( bak_CMAKE_REQUIRED_LIBRARIES )
else ( ALSA_FOUND )
message ( FATAL_ERROR "\nALSA support are requested, but not found on your system" )
endif ( ALSA_FOUND )
option ( WITH_ALL_OPTIONS "Enable all optional support" ON )
option ( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${ WITH_ALL_OPTIONS } )
endif ( WITH_ALSA )
option ( WITH_ALSA "Enable ALSA support" ${ WITH_ALL_OPTIONS } )
option ( WITH_AUDIOFILE "Enable audiofile (wav) support" ${ WITH_ALL_OPTIONS } )
option ( WITH_VORBIS "Enable Ogg/Vorbis support" ${ WITH_ALL_OPTIONS } )
# # # # # c h e c k f o r e s o u n d # # # # # # # # # # # # # # # # # # # # # # #
option ( WITH_MAD "Enable MAD mp3 decoder support" ${ WITH_ALL_OPTIONS } )
option ( WITH_ESOUND "Enable ESOUND support" ${ WITH_ALL_OPTIONS } )
set ( HAVE_LIBESD 0 )
option ( WITH_JACK "Enable JACK support" ${ WITH_ALL_OPTIONS } )
if ( WITH_ESOUND )
option ( WITH_SNDIO "Enable SNDIO support" OFF )
option ( WITH_NAS "Enable Network Audio System support" ${ WITH_ALL_OPTIONS } )
pkg_search_module ( ESOUND esound )
option ( WITH_OSS "Enable Open Sound System support" OFF )
if ( ESOUND_FOUND )
option ( WITH_TOSS "Enable Threaded Open Sound System support" OFF )
set ( HAVE_LIBESD 1 )
else ( ESOUND_FOUND )
message ( FATAL_ERROR "\nESOUND support is requested, but `libesd` not found" )
endif ( ESOUND_FOUND )
endif ( WITH_ESOUND )
# # # # # c h e c k f o r J A C K # # # # # # # # # # # # # # # # # # # # # # # # # # # #
set ( HAVE_LIBJACK 0 )
if ( WITH_JACK )
pkg_search_module ( LIBJACK jack )
if ( LIBJACK_FOUND )
set ( HAVE_LIBJACK 1 )
else ( LIBJACK_FOUND )
message ( FATAL_ERROR "\nJACK support is requested, but `jack.pc` was not found" )
endif ( LIBJACK_FOUND )
endif ( WITH_JACK )
# # # # # u s e r r e q u e s t e d m o d u l e s
# # # # # c h e c k f o r S N D I O # # # # # # # # # # # # # # # # # # # # # # # # # # #
option ( BUILD_ALL "Build all" ON )
option ( BUILD_DOC "Build documentation" ${ BUILD_ALL } )
option ( BUILD_TRANSLATIONS "Build translations" ${ BUILD_ALL } )
set ( HAVE_LIBSNDIO 0 )
if ( WITH_SNDIO )
check_include_file ( "sndio.h" HAVE_SNDIO_H )
if ( HAVE_SNDIO_H )
set ( HAVE_LIBSNDIO 1 )
set ( LIBSNDIO_LIBRARIES "sndio" )
else ( HAVE_SNDIO_H )
tde_message_fatal ( "SNDIO support is requested, but `sndio.h` was not found" )
endif ( HAVE_SNDIO_H )
endif ( WITH_SNDIO )
# # # # # c o n f i g u r e c h e c k s
# # # # # c h e c k f o r g l i b / g t h r e a d m o d u l e s # # # # # # # # # # # #
include ( ConfigureChecks.cmake )
pkg_search_module ( GLIB2 glib-2.0 )
if ( GLIB2_FOUND )
# # # # # # g l o b a l c o m p i l e r s e t t i n g s
pkg_search_module ( GTHREAD2 gthread-2.0 )
if ( NOT GTHREAD2_FOUND )
message ( FATAL_ERROR "\ngthread-2.0 are required, but not found on your system" )
endif ( NOT GTHREAD2_FOUND )
else ( GLIB2_FOUND )
message ( FATAL_ERROR "\nglib-2.0 are required, but not found on your system" )
endif ( GLIB2_FOUND )
add_definitions ( -DHAVE_CONFIG_H )
# # # # # c h e c k f o r T Q t # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
set ( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )
find_package ( TQt )
# # # # # d i r e c t o r i e s
# # # # # c h e c k f o r g c c v i s i b i l i t y s u p p o r t # # # # # # # # #
add_subdirectory ( libltdl )
add_subdirectory ( mcop )
add_subdirectory ( mcopidl )
add_subdirectory ( flow )
# add_subdirectory ( mcop_mt )
# add_subdirectory ( soundserver )
# add_subdirectory ( artsc )
# add_subdirectory ( gmcop )
# add_subdirectory ( qtmcop )
if ( WITH_GCC_VISIBILITY )
tde_conditional_add_subdirectory ( BUILD_DOC doc )
tde_setup_gcc_visibility ( )
# tde_conditional_add_subdirectory ( BUILD_TRANSLATIONS translations )
endif ( )
# # # # # w r i t e c o n f i g . h f i l e # # # # # # # # # # # # # # # # # # # # # # #
# # # # # w r i t e c o n f i g u r e f i l e s
configure_file ( config.h.cmake config.h @ONLY )
configure_file ( config.h.cmake config.h @ONLY )
@ -277,25 +141,3 @@ string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_INCLUDE_DIR ${I
string ( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_LIB_DIR ${ LIB_INSTALL_DIR } )
string ( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_LIB_DIR ${ LIB_INSTALL_DIR } )
configure_file ( arts.pc.cmake arts.pc @ONLY )
configure_file ( arts.pc.cmake arts.pc @ONLY )
install ( FILES ${ CMAKE_CURRENT_BINARY_DIR } /arts.pc DESTINATION ${ PKGCONFIG_INSTALL_DIR } )
install ( FILES ${ CMAKE_CURRENT_BINARY_DIR } /arts.pc DESTINATION ${ PKGCONFIG_INSTALL_DIR } )
# # # # # g l o b a l c o m p i l e r s e t t i n g s # # # # # # # # # # # # # # # # # #
add_definitions (
- D H A V E _ C O N F I G _ H
)
set ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
# # # # # p r o j e c t s u b d i r e c t o r i e s # # # # # # # # # # # # # # # # # # # #
add_subdirectory ( libltdl )
add_subdirectory ( mcop )
add_subdirectory ( mcopidl )
add_subdirectory ( flow )
add_subdirectory ( mcop_mt )
add_subdirectory ( soundserver )
add_subdirectory ( artsc )
add_subdirectory ( gmcop )
add_subdirectory ( qtmcop )