Amarok – versatile and easy to use audio player
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.

ConfigureChecks.cmake 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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. ##### check for gcc visibility support #########
  12. # FIXME
  13. # This should check for [T]Qt3 visibility support
  14. if( WITH_GCC_VISIBILITY )
  15. if( NOT UNIX )
  16. tde_message_fatal(FATAL_ERROR "\ngcc visibility support was requested, but your system is not *NIX" )
  17. endif( NOT UNIX )
  18. set( __KDE_HAVE_GCC_VISIBILITY 1 )
  19. set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
  20. set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
  21. endif( )
  22. if( BUILD_TRANSLATIONS AND NOT DEFINED MSGFMT_EXECUTABLE )
  23. find_program( MSGFMT_EXECUTABLE msgfmt )
  24. if( NOT MSGFMT_EXECUTABLE )
  25. tde_message_fatal( "msgfmt program is required, but was not found on your system" )
  26. endif( )
  27. endif( )
  28. check_type_size( "int" SIZEOF_INT BUILTIN_TYPES_ONLY )
  29. check_type_size( "long" SIZEOF_LONG BUILTIN_TYPES_ONLY )
  30. check_include_file( stdint.h HAVE_STDINT_H )
  31. check_include_file( systems.h HAVE_SYSTEMS_H )
  32. ##### check for inotify ###########################
  33. if( WITH_INOTIFY )
  34. check_include_file( "inotify.h" INOTIFY_FOUND )
  35. check_include_file( "sys/inotify.h" INOTIFY_SYS_FOUND )
  36. if( NOT INOTIFY_FOUND )
  37. if( NOT INOTIFY_SYS_FOUND )
  38. message(FATAL_ERROR "\ninotify support was requested, but inotify was not found on your system" )
  39. endif( NOT INOTIFY_SYS_FOUND )
  40. endif( NOT INOTIFY_FOUND )
  41. if( INOTIFY_FOUND )
  42. set( HAVE_INOTIFY 1 )
  43. endif( INOTIFY_FOUND )
  44. if( INOTIFY_SYS_FOUND )
  45. set( HAVE_INOTIFY 1 )
  46. set( HAVE_SYS_INOTIFY 1 )
  47. endif( INOTIFY_SYS_FOUND )
  48. endif( )
  49. check_function_exists( statvfs HAVE_STATVFS )
  50. # sched_setaffinity buggy glibc check
  51. check_c_source_compiles("
  52. #define _GNU_SOURCE
  53. #include <sched.h>
  54. int main() {
  55. cpu_set_t mask;
  56. CPU_ZERO(&mask);
  57. CPU_SET(0, &mask);
  58. sched_setaffinity(0, sizeof(mask), &mask);
  59. return 0;
  60. } "
  61. SCHEDAFFINITY_3PARAMS )
  62. if( SCHEDAFFINITY_3PARAMS )
  63. set( SCHEDAFFINITY_SUPPORT 1 )
  64. else( )
  65. check_c_source_compiles("
  66. #define _GNU_SOURCE
  67. #include <sched.h>
  68. int main() {
  69. cpu_set_t mask;
  70. CPU_ZERO(&mask);
  71. CPU_SET(0, &mask);
  72. sched_setaffinity(0, &mask);
  73. return 0;
  74. } "
  75. SCHEDAFFINITY_SUPPORT )
  76. endif( )
  77. # fabsf
  78. tde_save( CMAKE_REQUIRED_LIBRARIES )
  79. set( CMAKE_REQUIRED_LIBRARIES m )
  80. check_function_exists( fabsf HAVE_FABSF )
  81. tde_restore( CMAKE_REQUIRED_LIBRARIES )
  82. # taglib
  83. pkg_search_module( TAGLIB taglib )
  84. if( TAGLIB_FOUND )
  85. if( ${TAGLIB_VERSION} VERSION_LESS "1.5" )
  86. tde_message_fatal( "taglib version must be at least 1.5" )
  87. else( )
  88. set( TAGLIB_15 1 )
  89. endif( )
  90. else( )
  91. tde_message_fatal( "taglib are required, but not found on your system" )
  92. endif( )
  93. # sqlite3
  94. pkg_search_module( SQLITE sqlite3 )
  95. if( NOT SQLITE_FOUND )
  96. tde_message_fatal( "sqlite3 are required, but not found on your system" )
  97. endif( )
  98. # libvisual
  99. if( WITH_LIBVISUAL )
  100. pkg_search_module( SDL sdl )
  101. if( NOT SDL_FOUND )
  102. check_include_file( SDL/SDL.h HAVE_SDL_H )
  103. if( NOT HAVE_SDL_H )
  104. tde_message_fatal( "SDL are required, but not found on your system" )
  105. endif ( )
  106. set ( SDL_INCLUDE_DIRS /usr/include/SDL )
  107. set ( SDL_LIBRARIES SDL pthread )
  108. endif( )
  109. pkg_search_module( LIBVISUAL libvisual-0.4 )
  110. if( LIBVISUAL_FOUND )
  111. if( ${LIBVISUAL_VERSION} VERSION_LESS "0.4.0" )
  112. tde_message_fatal( "libvisual version must be at least 0.4.0" )
  113. endif( )
  114. else( )
  115. tde_message_fatal( "libvisual are requested, but not found on your system" )
  116. endif( )
  117. set( HAVE_LIBVISUAL 1 )
  118. endif( )
  119. # xine-engine
  120. if( WITH_XINE )
  121. pkg_search_module( XINE libxine )
  122. if( XINE_FOUND )
  123. if( ${XINE_VERSION} VERSION_LESS "1.0.2" )
  124. tde_message_fatal( "your xine version is too old; at least 1.0.2 is required" )
  125. endif( )
  126. else( )
  127. tde_message_fatal( "xine is requested, but was not found on your system" )
  128. endif( )
  129. endif( )
  130. # akode-engine
  131. if( WITH_AKODE )
  132. pkg_search_module( AKODE akode )
  133. if( AKODE_FOUND )
  134. if( ${AKODE_VERSION} VERSION_LESS "2.0.0" )
  135. tde_message_fatal( "your akode version is too old; at least 2.0.0 is required" )
  136. endif( )
  137. else( )
  138. tde_message_fatal( "akode is requested, but was not found on your system" )
  139. endif( )
  140. endif( )
  141. # iPod
  142. if( WITH_IPOD )
  143. pkg_search_module( GPOD libgpod-1.0 )
  144. if( GPOD_FOUND )
  145. if( ${GPOD_VERSION} VERSION_LESS "0.4.2" )
  146. tde_message_fatal( "your libgpod version is too old; at least 0.4.2 is required" )
  147. elseif( NOT ${GPOD_VERSION} VERSION_LESS "0.6.0" )
  148. set( HAVE_GPOD_060 1 )
  149. endif( )
  150. else( )
  151. tde_message_fatal( "libgpod-1.0 is requested, but was not found on your system" )
  152. endif( )
  153. tde_save( CMAKE_REQUIRED_INCLUDES )
  154. set( CMAKE_REQUIRED_INCLUDES ${GPOD_INCLUDE_DIRS} )
  155. check_struct_has_member( "struct _Itdb_Track" mediatype "gpod/itdb.h" HAVE_ITDB_MEDIATYPE )
  156. tde_restore( CMAKE_REQUIRED_INCLUDES )
  157. set( GPOD_LIBRARY gpod )
  158. endif( )
  159. # common required stuff
  160. find_package( TQt )
  161. find_package( TDE )
  162. # check for Qt with OpenGL support
  163. tde_save( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
  164. set( CMAKE_REQUIRED_INCLUDES ${TQT_INCLUDE_DIRS} )
  165. set( CMAKE_REQUIRED_LIBRARIES -L${TQT_LIBRARY_DIRS} ${TQT_LIBRARIES} )
  166. check_cxx_source_compiles("
  167. #include <qgl.h>
  168. int main(int, char**) { (void)new QGLWidget((QWidget*)0, \"qgl\"); return 0; } "
  169. HAVE_QGLWIDGET )
  170. tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
  171. # konqsidebarplugin.h
  172. if( WITH_KONQSIDEBAR )
  173. tde_save( CMAKE_REQUIRED_DEFINITIONS CMAKE_REQUIRED_FLAGS CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
  174. set( CMAKE_REQUIRED_DEFINITIONS ${TQT_CFLAGS_OTHER} )
  175. set( CMAKE_REQUIRED_INCLUDES ${TDE_INCLUDE_DIR};${TQT_INCLUDE_DIRS};${CMAKE_INCLUDE_PATH} )
  176. set( CMAKE_REQUIRED_FLAGS "-include tqt.h" )
  177. set( CMAKE_REQUIRED_LIBRARIES -L${TQT_LIBRARY_DIRS} -L${TQT_LIBRARY_DIRS} ${TQT_LIBRARIES} )
  178. check_cxx_source_compiles("
  179. #include <konqsidebarplugin.h>
  180. int main(int, char**) { return 0; } "
  181. HAVE_KONQSIDEBARPLUGIN_H )
  182. tde_restore( CMAKE_REQUIRED_DEFINITIONS CMAKE_REQUIRED_FLAGS CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
  183. if( NOT HAVE_KONQSIDEBARPLUGIN_H )
  184. tde_message_fatal( "konqsidebarplugin.h are requested, but not found on your system" )
  185. endif( )
  186. endif( )
  187. ##### check for mp4v2 ###########################
  188. if( WITH_MP4V2 )
  189. check_include_file( "mp4v2/mp4v2.h" MP4V2_H_FOUND )
  190. if( MP4V2_H_FOUND )
  191. set( HAVE_MP4V2_H 1)
  192. else( MP4V2_H_FOUND )
  193. check_include_file( "mp4.h" MP4_H_FOUND )
  194. if( MP4_H_FOUND )
  195. set( HAVE_MP4_H 1)
  196. endif( MP4_H_FOUND )
  197. endif( MP4V2_H_FOUND )
  198. if( HAVE_MP4V2_H OR HAVE_MP4_H )
  199. set( HAVE_MP4V2 1 )
  200. else( )
  201. tde_message_fatal( "MP4V2 support was requested, but not found on your system" )
  202. endif( )
  203. endif( )