diff options
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r-- | ConfigureChecks.cmake | 173 |
1 files changed, 139 insertions, 34 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 7f59dcfb..15729b8f 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -1,34 +1,139 @@ -include(CheckIncludeFile) -include(CheckIncludeFiles) -include(CheckSymbolExists) -include(CheckFunctionExists) -include(CheckLibraryExists) -include(CheckPrototypeExists) -include(CheckTypeSize) -include(MacroBoolTo01) - -# The FindKDE4.cmake module sets _KDE4_PLATFORM_DEFINITIONS with -# definitions like _GNU_SOURCE that are needed on each platform. -set(CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS}) - -#check for libz using the cmake supplied FindZLIB.cmake -macro_bool_to_01(ZLIB_FOUND HAVE_LIBZ) -macro_bool_to_01(JPEG_FOUND HAVE_LIBJPEG) -macro_bool_to_01(PNG_FOUND HAVE_LIBPNG) -macro_bool_to_01(CARBON_FOUND HAVE_CARBON) -macro_bool_to_01(NJB_FOUND HAVE_LIBNJB) -macro_bool_to_01(IFP_FOUND HAVE_IFP) -macro_bool_to_01(LIBVISUAL_FOUND HAVE_LIBVISUAL) -macro_bool_to_01(MTP_FOUND HAVE_MTP) - -#now check for dlfcn.h using the cmake supplied CHECK_include_FILE() macro -# If definitions like -D_GNU_SOURCE are needed for these checks they -# should be added to _KDE4_PLATFORM_DEFINITIONS when it is originally -# defined outside this file. Here we include these definitions in -# CMAKE_REQUIRED_DEFINITIONS so they will be included in the build of -# checks below. -set(CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS}) -if (WIN32) - set(CMAKE_REQUIRED_LIBRARIES ${KDEWIN32_LIBRARIES} ) - set(CMAKE_REQUIRED_INCLUDES ${KDEWIN32_INCLUDES} ) -endif (WIN32) +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +check_type_size( "int" SIZEOF_INT BUILTIN_TYPES_ONLY ) +check_type_size( "long" SIZEOF_LONG BUILTIN_TYPES_ONLY ) + +check_include_file( stdint.h HAVE_STDINT_H ) +check_include_file( systems.h HAVE_SYSTEMS_H ) +check_include_file( linux/inotify.h HAVE_INOTIFY ) + +check_function_exists( statvfs HAVE_STATVFS ) + + +# fabsf +tde_save( CMAKE_REQUIRED_LIBRARIES ) +set( CMAKE_REQUIRED_LIBRARIES m ) +check_function_exists( fabsf HAVE_FABSF ) +tde_restore( CMAKE_REQUIRED_LIBRARIES ) + + +# taglib +pkg_search_module( TAGLIB taglib ) +if( TAGLIB_FOUND ) + if( ${TAGLIB_VERSION} VERSION_LESS "1.5" ) + tde_message_fatal( "taglib version must be at least 1.5" ) + else( ) + set( TAGLIB_15 1 ) + endif( ) +else( ) + tde_message_fatal( "taglib are required, but not found on your system" ) +endif( ) + + +# sqlite3 +pkg_search_module( SQLITE sqlite3 ) +if( NOT SQLITE_FOUND ) + tde_message_fatal( "sqlite3 are required, but not found on your system" ) +endif( ) + + +# libvisual +if( WITH_LIBVISUAL ) + + pkg_search_module( SDL sdl ) + if( NOT SDL_FOUND ) + tde_message_fatal( "SDL are required, but not found on your system" ) + endif( ) + + pkg_search_module( LIBVISUAL libvisual-0.4 ) + if( LIBVISUAL_FOUND ) + if( ${LIBVISUAL_VERSION} VERSION_LESS "0.4.0" ) + tde_message_fatal( "libvisual version must be at least 0.4.0" ) + endif( ) + else( ) + tde_message_fatal( "libvisual are requested, but not found on your system" ) + endif( ) + set( HAVE_LIBVISUAL 1 ) + +endif( ) + + +# xine-engine +if( WITH_XINE ) + pkg_search_module( XINE libxine ) + if( XINE_FOUND ) + if( ${XINE_VERSION} VERSION_LESS "1.0.2" ) + tde_message_fatal( "your xine version is too old; at least 1.0.2 is required" ) + endif( ) + else( ) + tde_message_fatal( "xine are requested, but not found on your system" ) + endif( ) +endif( ) + + +# iPod +if( WITH_LIBGPOD ) + + tde_message_fatal( "iPod support is outdated, cannot be compiled against newer libgpod" ) + + pkg_search_module( LIBGPOD libgpod-1.0 ) + if( LIBGPOD_FOUND ) + if( ${LIBGPOD_VERSION} VERSION_LESS "0.4.2" ) + tde_message_fatal( "your libgpod version is too old; at least 0.4.2 is required" ) + elseif( NOT ${LIBGPOD_VERSION} VERSION_LESS "0.6.0" ) + set( HAVE_LIBGPOD_060 1 ) + endif( ) + else( ) + tde_message_fatal( "libgpod-1.0 are requested, but not found on your system" ) + endif( ) + + tde_save( CMAKE_REQUIRED_INCLUDES ) + set( CMAKE_REQUIRED_INCLUDES ${LIBGPOD_INCLUDE_DIRS} ) + check_struct_has_member( "struct _Itdb_Track" mediatype "gpod/itdb.h" HAVE_ITDB_MEDIATYPE ) + tde_restore( CMAKE_REQUIRED_INCLUDES ) + +endif( ) + + +# common required stuff +find_package( Qt ) +find_package( TQt ) +find_package( TDE ) + + +# check for Qt with OpenGL support +tde_save( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) +set( CMAKE_REQUIRED_INCLUDES ${QT_INCLUDE_DIRS} ) +set( CMAKE_REQUIRED_LIBRARIES -L${QT_LIBRARY_DIRS} ${QT_LIBRARIES} ) +check_cxx_source_compiles(" + #include <qgl.h> + int main(int, char**) { (void)new QGLWidget((QWidget*)0, \"qgl\"); return 0; } " + HAVE_QGLWIDGET ) +tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) + + +# konqsidebarplugin.h +if( WITH_KONQSIDEBAR ) + tde_save( CMAKE_REQUIRED_DEFINITIONS CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES CMAKE_REQUIRED_LIBRARIES ) + set( CMAKE_REQUIRED_DEFINITIONS ${TQT_CFLAGS_OTHER} ) + set( CMAKE_REQUIRED_INCLUDES ${TDE_INCLUDE_DIR};${TQT_INCLUDE_DIRS} ) + set( CMAKE_REQUIRED_FLAGS "-include tqt.h" ) + set( CMAKE_REQUIRED_LIBRARIES -L${QT_LIBRARY_DIRS} ${QT_LIBRARIES} ) + check_cxx_source_compiles(" + #include <konqsidebarplugin.h> + int main(int, char**) { return 0; } " + HAVE_KONQSIDEBARPLUGIN_H ) + tde_restore( CMAKE_REQUIRED_DEFINITIONS CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES CMAKE_REQUIRED_LIBRARIES ) + if( NOT HAVE_KONQSIDEBARPLUGIN_H ) + tde_message_fatal( "konqsidebarplugin.h are requested, but not found on your system" ) + endif( ) +endif( ) |