aRts audio server
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.
 
 
 
 
 
 

203 lines
5.7 KiB

  1. #################################################
  2. #
  3. # (C) 2010 Serghei Amelian
  4. # serghei (DOT) amelian (AT) gmail.com
  5. #
  6. # Improvements and feedback are welcome
  7. #
  8. # This file is released under GPL >= 2
  9. #
  10. #################################################
  11. cmake_minimum_required( VERSION 2.6 )
  12. ##### include our cmake modules #################
  13. set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
  14. include( TDEMacros )
  15. ##### project settings ##########################
  16. project( arts )
  17. set( ARTS_MAJOR_VERSION 1 )
  18. set( ARTS_MINOR_VERSION 5 )
  19. set( ARTS_MICRO_VERSION 10 )
  20. set( ARTS_VERSION "${ARTS_MAJOR_VERSION}.${ARTS_MINOR_VERSION}.${ARTS_MICRO_VERSION}" )
  21. ##### user requested options ####################
  22. option( WITH_ALSA "Enable ALSA support" ON )
  23. option( WITH_AUDIOFILE "Enable audiofile (wav) support" ON )
  24. option( WITH_VORBIS "Enable Ogg/Vorbis support" ON )
  25. option( WITH_MAD "Enable MAD mp3 decoder support" ON )
  26. ##### paths setup ###############################
  27. tde_setup_install_path( EXEC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" )
  28. tde_setup_install_path( BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" )
  29. tde_setup_install_path( LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
  30. tde_setup_install_path( INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/${CMAKE_PROJECT_NAME}" )
  31. tde_setup_install_path( PKGCONFIG_INSTALL_DIR "/usr/lib${LIB_SUFFIX}/pkgconfig" )
  32. ##### check for include files ###################
  33. include( CheckIncludeFile )
  34. check_include_file( "sys/time.h" HAVE_SYS_TIME_H )
  35. check_include_file( "time.h" TIME_WITH_SYS_TIME )
  36. check_include_file( "stdio.h" HAVE_STDIO_H )
  37. check_include_file( "stdlib.h" HAVE_STDLIB_H )
  38. check_include_file( "string.h" HAVE_STRING_H )
  39. check_include_file( "strings.h" HAVE_STRINGS_H )
  40. check_include_file( "ctype.h" HAVE_CTYPE_H )
  41. check_include_file( "malloc.h" HAVE_MALLOC_H )
  42. check_include_file( "memory.h" HAVE_MEMORY_H )
  43. check_include_file( "dlfcn.h" HAVE_DLFCN_H )
  44. ##### check for system libraries ################
  45. include( CheckLibraryExists )
  46. set( DL_LIBRARIES dl )
  47. check_library_exists( ${DL_LIBRARIES} dlopen /lib HAVE_LIBDL )
  48. if( NOT HAVE_LIBDL )
  49. unset( DL_LIBRARIES )
  50. endif( NOT HAVE_LIBDL )
  51. find_package( Threads )
  52. ##### check for functions #######################
  53. include( CheckFunctionExists )
  54. set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} )
  55. set( CMAKE_REQUIRED_LIBRARIES dl )
  56. check_function_exists( dlerror HAVE_DLERROR )
  57. check_function_exists( strcmp HAVE_STRCMP )
  58. check_function_exists( strchr HAVE_STRCHR )
  59. check_function_exists( index HAVE_INDEX )
  60. check_function_exists( strrchr HAVE_STRRCHR )
  61. check_function_exists( rindex HAVE_RINDEX )
  62. check_function_exists( memcpy HAVE_MEMCPY )
  63. check_function_exists( bcopy HAVE_BCOPY )
  64. set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} )
  65. unset( bak_CMAKE_REQUIRED_LIBRARIES )
  66. ##### check for modules #########################
  67. include( FindPkgConfig )
  68. ##### check for audiofile #######################
  69. set( HAVE_LIBAUDIOFILE 0 )
  70. if( WITH_AUDIOFILE )
  71. pkg_search_module( AUDIOFILE audiofile )
  72. if( AUDIOFILE_FOUND )
  73. set( HAVE_LIBAUDIOFILE 1 )
  74. else( AUDIOFILE_FOUND )
  75. message(FATAL_ERROR "\naudiofile (wav) support are requested, but `libaudiofile` not found" )
  76. endif( AUDIOFILE_FOUND )
  77. endif( WITH_AUDIOFILE )
  78. ##### check for alsa ############################
  79. set( HAVE_LIBASOUND2 0 )
  80. if( WITH_ALSA )
  81. pkg_search_module( ALSA alsa )
  82. if( ALSA_FOUND )
  83. # there is support only for ALSA 1.x
  84. set( HAVE_LIBASOUND2 1 )
  85. set( ALSA_PCM_OLD_SW_PARAMS_API 1 )
  86. set( ALSA_PCM_OLD_HW_PARAMS_API 1 )
  87. check_include_file( "alsa/asoundlib.h" HAVE_ALSA_ASOUNDLIB_H )
  88. if( NOT HAVE_ALSA_ASOUNDLIB_H )
  89. check_include_file( "sys/asoundlib.h" HAVE_SYS_ASOUNDLIB_H )
  90. endif( NOT HAVE_ALSA_ASOUNDLIB_H )
  91. set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} )
  92. set( CMAKE_REQUIRED_LIBRARIES ${ALSA_LIBRARIES} )
  93. check_function_exists( snd_pcm_resume HAVE_SND_PCM_RESUME )
  94. set( CMAKE_REQUIRED_LIBRARIES ${bak_CMAKE_REQUIRED_LIBRARIES} )
  95. unset( bak_CMAKE_REQUIRED_LIBRARIES )
  96. else( ALSA_FOUND )
  97. message(FATAL_ERROR "\nALSA support are requested, but not found on your system" )
  98. endif( ALSA_FOUND )
  99. endif( WITH_ALSA )
  100. ##### check for glib/gthread modules ############
  101. pkg_search_module( GLIB2 glib-2.0 )
  102. if( GLIB2_FOUND )
  103. pkg_search_module( GTHREAD2 gthread-2.0 )
  104. if( NOT GTHREAD2_FOUND )
  105. message(FATAL_ERROR "\ngthread-2.0 are required, but not found on your system" )
  106. endif( NOT GTHREAD2_FOUND )
  107. else( GLIB2_FOUND )
  108. message(FATAL_ERROR "\nglib-2.0 are required, but not found on your system" )
  109. endif( GLIB2_FOUND )
  110. ##### check for TQt #############################
  111. include( CheckCXXSourceCompiles )
  112. find_package( TQt )
  113. ##### write config.h file #######################
  114. configure_file( config.h.cmake config.h @ONLY )
  115. ##### write pkgconfig file ######################
  116. string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_EXEC_PREFIX ${EXEC_INSTALL_PREFIX} )
  117. string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_INCLUDE_DIR ${INCLUDE_INSTALL_DIR} )
  118. string( REGEX REPLACE "^${CMAKE_INSTALL_PREFIX}" "\${prefix}" PC_LIB_DIR ${LIB_INSTALL_DIR} )
  119. configure_file( arts.pc.cmake arts.pc @ONLY )
  120. install( FILES ${CMAKE_CURRENT_BINARY_DIR}/arts.pc DESTINATION ${PKGCONFIG_INSTALL_DIR} )
  121. ##### global compiler settings ##################
  122. add_definitions(
  123. -DHAVE_CONFIG_H
  124. )
  125. set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
  126. ##### project subdirectories ####################
  127. add_subdirectory( libltdl )
  128. add_subdirectory( mcop )
  129. add_subdirectory( mcopidl )
  130. add_subdirectory( flow )
  131. add_subdirectory( mcop_mt )
  132. add_subdirectory( soundserver )
  133. add_subdirectory( artsc )
  134. add_subdirectory( gmcop )
  135. add_subdirectory( qtmcop )