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.

176 lines
4.9KB

  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. if( BUILD_TRANSLATIONS AND NOT DEFINED MSGFMT_EXECUTABLE )
  12. find_program( MSGFMT_EXECUTABLE msgfmt )
  13. if( NOT MSGFMT_EXECUTABLE )
  14. tde_message_fatal( "msgfmt program is required, but was not found on your system" )
  15. endif( )
  16. endif( )
  17. check_type_size( "int" SIZEOF_INT BUILTIN_TYPES_ONLY )
  18. check_type_size( "long" SIZEOF_LONG BUILTIN_TYPES_ONLY )
  19. check_include_file( stdint.h HAVE_STDINT_H )
  20. check_include_file( systems.h HAVE_SYSTEMS_H )
  21. check_include_file( linux/inotify.h HAVE_INOTIFY )
  22. check_function_exists( statvfs HAVE_STATVFS )
  23. # sched_setaffinity buggy glibc check
  24. check_c_source_compiles("
  25. #define _GNU_SOURCE
  26. #include <sched.h>
  27. int main() {
  28. cpu_set_t mask;
  29. CPU_ZERO(&mask);
  30. CPU_SET(0, &mask);
  31. sched_setaffinity(0, sizeof(mask), &mask);
  32. return 0;
  33. } "
  34. SCHEDAFFINITY_3PARAMS )
  35. if( SCHEDAFFINITY_3PARAMS )
  36. set( SCHEDAFFINITY_SUPPORT 1 )
  37. else( )
  38. check_c_source_compiles("
  39. #define _GNU_SOURCE
  40. #include <sched.h>
  41. int main() {
  42. cpu_set_t mask;
  43. CPU_ZERO(&mask);
  44. CPU_SET(0, &mask);
  45. sched_setaffinity(0, &mask);
  46. return 0;
  47. } "
  48. SCHEDAFFINITY_SUPPORT )
  49. endif( )
  50. # fabsf
  51. tde_save( CMAKE_REQUIRED_LIBRARIES )
  52. set( CMAKE_REQUIRED_LIBRARIES m )
  53. check_function_exists( fabsf HAVE_FABSF )
  54. tde_restore( CMAKE_REQUIRED_LIBRARIES )
  55. # taglib
  56. pkg_search_module( TAGLIB taglib )
  57. if( TAGLIB_FOUND )
  58. if( ${TAGLIB_VERSION} VERSION_LESS "1.5" )
  59. tde_message_fatal( "taglib version must be at least 1.5" )
  60. else( )
  61. set( TAGLIB_15 1 )
  62. endif( )
  63. else( )
  64. tde_message_fatal( "taglib are required, but not found on your system" )
  65. endif( )
  66. # sqlite3
  67. pkg_search_module( SQLITE sqlite3 )
  68. if( NOT SQLITE_FOUND )
  69. tde_message_fatal( "sqlite3 are required, but not found on your system" )
  70. endif( )
  71. # libvisual
  72. if( WITH_LIBVISUAL )
  73. pkg_search_module( SDL sdl )
  74. if( NOT SDL_FOUND )
  75. tde_message_fatal( "SDL are required, but not found on your system" )
  76. endif( )
  77. pkg_search_module( LIBVISUAL libvisual-0.4 )
  78. if( LIBVISUAL_FOUND )
  79. if( ${LIBVISUAL_VERSION} VERSION_LESS "0.4.0" )
  80. tde_message_fatal( "libvisual version must be at least 0.4.0" )
  81. endif( )
  82. else( )
  83. tde_message_fatal( "libvisual are requested, but not found on your system" )
  84. endif( )
  85. set( HAVE_LIBVISUAL 1 )
  86. endif( )
  87. # xine-engine
  88. if( WITH_XINE )
  89. pkg_search_module( XINE libxine )
  90. if( XINE_FOUND )
  91. if( ${XINE_VERSION} VERSION_LESS "1.0.2" )
  92. tde_message_fatal( "your xine version is too old; at least 1.0.2 is required" )
  93. endif( )
  94. else( )
  95. tde_message_fatal( "xine are requested, but not found on your system" )
  96. endif( )
  97. endif( )
  98. # iPod
  99. if( WITH_LIBGPOD )
  100. # tde_message_fatal( "iPod support is outdated, cannot be compiled against newer libgpod" )
  101. pkg_search_module( LIBGPOD libgpod-1.0 )
  102. if( LIBGPOD_FOUND )
  103. if( ${LIBGPOD_VERSION} VERSION_LESS "0.4.2" )
  104. tde_message_fatal( "your libgpod version is too old; at least 0.4.2 is required" )
  105. elseif( NOT ${LIBGPOD_VERSION} VERSION_LESS "0.6.0" )
  106. set( HAVE_LIBGPOD_060 1 )
  107. endif( )
  108. else( )
  109. tde_message_fatal( "libgpod-1.0 are requested, but not found on your system" )
  110. endif( )
  111. tde_save( CMAKE_REQUIRED_INCLUDES )
  112. set( CMAKE_REQUIRED_INCLUDES ${LIBGPOD_INCLUDE_DIRS} )
  113. check_struct_has_member( "struct _Itdb_Track" mediatype "gpod/itdb.h" HAVE_ITDB_MEDIATYPE )
  114. tde_restore( CMAKE_REQUIRED_INCLUDES )
  115. endif( )
  116. # common required stuff
  117. find_package( TQt )
  118. find_package( TDE )
  119. # check for Qt with OpenGL support
  120. tde_save( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
  121. set( CMAKE_REQUIRED_INCLUDES ${QT_INCLUDE_DIRS} )
  122. set( CMAKE_REQUIRED_LIBRARIES -L${QT_LIBRARY_DIRS} ${QT_LIBRARIES} )
  123. check_cxx_source_compiles("
  124. #include <qgl.h>
  125. int main(int, char**) { (void)new QGLWidget((QWidget*)0, \"qgl\"); return 0; } "
  126. HAVE_QGLWIDGET )
  127. tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
  128. # konqsidebarplugin.h
  129. if( WITH_KONQSIDEBAR )
  130. tde_save( CMAKE_REQUIRED_DEFINITIONS CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES CMAKE_REQUIRED_LIBRARIES )
  131. set( CMAKE_REQUIRED_DEFINITIONS ${TQT_CFLAGS_OTHER} )
  132. set( CMAKE_REQUIRED_INCLUDES ${TDE_INCLUDE_DIR};${TQT_INCLUDE_DIRS};${CMAKE_INCLUDE_PATH} )
  133. set( CMAKE_REQUIRED_FLAGS "-include tqt.h" )
  134. set( CMAKE_REQUIRED_LIBRARIES -L${TQT_LIBRARY_DIRS} ${TQT_LIBRARIES} )
  135. check_cxx_source_compiles("
  136. #include <konqsidebarplugin.h>
  137. int main(int, char**) { return 0; } "
  138. HAVE_KONQSIDEBARPLUGIN_H )
  139. tde_restore( CMAKE_REQUIRED_DEFINITIONS CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES CMAKE_REQUIRED_LIBRARIES )
  140. if( NOT HAVE_KONQSIDEBARPLUGIN_H )
  141. tde_message_fatal( "konqsidebarplugin.h are requested, but not found on your system" )
  142. endif( )
  143. endif( )