diff options
author | gregory guy <[email protected]> | 2020-01-29 01:10:31 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2020-03-04 23:49:15 +0100 |
commit | 16ec57d25f13f92bd0d84317f1679fef3b98eeaa (patch) | |
tree | 49e41122369e3ef7e0bce7c20cd92eaf1ece3b17 /ConfigureChecks.cmake | |
parent | af56fd3c134a4304763d656f99b694f85acf8238 (diff) | |
download | amarok-16ec57d25f13f92bd0d84317f1679fef3b98eeaa.tar.gz amarok-16ec57d25f13f92bd0d84317f1679fef3b98eeaa.zip |
Conversion to the cmake building system based on S.Amelian's work.
The embedded sqlite3 has been upgraded to 3.4.2 .
Added few man pages taken from the Debian packaging system.
Rework of the README and INSTALL files.
Signed-off-by: gregory guy <[email protected]>
Signed-off-by: Slávek Banko <[email protected]>
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r-- | ConfigureChecks.cmake | 221 |
1 files changed, 172 insertions, 49 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index c71a6d50..37976154 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -9,26 +9,27 @@ # ################################################# -##### check for gcc visibility support ######### -# FIXME -# This should check for [T]Qt3 visibility support +# required stuff +find_package( TQt ) +find_package( TDE ) + +tde_setup_architecture_flags( ) + +include(TestBigEndian) +test_big_endian(WORDS_BIGENDIAN) + +tde_setup_largefiles( ) + + +##### check for gcc visibility support if( WITH_GCC_VISIBILITY ) - if( NOT UNIX ) - tde_message_fatal(FATAL_ERROR "\ngcc visibility support was requested, but your system is not *NIX" ) - endif( NOT UNIX ) - set( __KDE_HAVE_GCC_VISIBILITY 1 ) - set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden") - set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden") -endif( ) + tde_setup_gcc_visibility( ) +endif( WITH_GCC_VISIBILITY ) -if( BUILD_TRANSLATIONS AND NOT DEFINED MSGFMT_EXECUTABLE ) - find_program( MSGFMT_EXECUTABLE msgfmt ) - if( NOT MSGFMT_EXECUTABLE ) - tde_message_fatal( "msgfmt program is required, but was not found on your system" ) - endif( ) -endif( ) +find_package( Threads ) +find_package( X11 ) check_type_size( "int" SIZEOF_INT BUILTIN_TYPES_ONLY ) check_type_size( "long" SIZEOF_LONG BUILTIN_TYPES_ONLY ) @@ -102,16 +103,10 @@ if( TAGLIB_FOUND ) tde_message_fatal( "taglib version must be at least 1.5" ) else( ) set( TAGLIB_15 1 ) + message( STATUS "Found TAGLIB: ${TAGLIB_INCLUDE_DIRS}" ) 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" ) + tde_message_fatal( "taglib is required, but not found on your system" ) endif( ) @@ -122,7 +117,7 @@ if( WITH_LIBVISUAL ) if( NOT SDL_FOUND ) check_include_file( SDL/SDL.h HAVE_SDL_H ) if( NOT HAVE_SDL_H ) - tde_message_fatal( "SDL are required, but not found on your system" ) + tde_message_fatal( "SDL is required, but not found on your system" ) endif ( ) set ( SDL_INCLUDE_DIRS /usr/include/SDL ) set ( SDL_LIBRARIES SDL pthread ) @@ -134,7 +129,7 @@ if( WITH_LIBVISUAL ) 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" ) + tde_message_fatal( "libvisual is requested, but not found on your system" ) endif( ) set( HAVE_LIBVISUAL 1 ) @@ -166,9 +161,12 @@ if( WITH_AKODE ) endif( ) -# iPod +##### check for libgpod - iPod + if( WITH_IPOD ) +pkg_search_module( GLIB2 glib-2.0 ) + pkg_search_module( GPOD libgpod-1.0 ) if( GPOD_FOUND ) if( ${GPOD_VERSION} VERSION_LESS "0.4.2" ) @@ -190,20 +188,29 @@ if( WITH_IPOD ) endif( ) -# common required stuff -find_package( TQt ) -find_package( TDE ) +if( WITH_OPENGL ) +set( OpenGL_GL_PREFERENCE LEGACY ) +find_package( GLUT ) +find_package( OpenGL ) +##### check for OpenGL support within tqt -# check for Qt with OpenGL support tde_save( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) set( CMAKE_REQUIRED_INCLUDES ${TQT_INCLUDE_DIRS} ) set( CMAKE_REQUIRED_LIBRARIES -L${TQT_LIBRARY_DIRS} ${TQT_LIBRARIES} ) + check_cxx_source_compiles(" - #include <qgl.h> - int main(int, char**) { (void)new QGLWidget((QWidget*)0, \"qgl\"); return 0; } " - HAVE_QGLWIDGET ) +#include <cstdlib> +#include <tqgl.h> +int main( int, char** ) +{ + (void) new TQGLWidget( (TQWidget*)0, \"qgl\" ) ; + return EXIT_SUCCESS ; +}" +HAVE_TQGLWIDGET ) + tde_restore( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) +endif( WITH_OPENGL ) # konqsidebarplugin.h @@ -219,26 +226,142 @@ if( WITH_KONQSIDEBAR ) HAVE_KONQSIDEBARPLUGIN_H ) tde_restore( CMAKE_REQUIRED_DEFINITIONS CMAKE_REQUIRED_FLAGS CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES ) if( NOT HAVE_KONQSIDEBARPLUGIN_H ) - tde_message_fatal( "konqsidebarplugin.h are requested, but not found on your system" ) + tde_message_fatal( "Konqueror sidebar is requested, but konqsidebarplugin.h was not found on your system" ) endif( ) endif( ) -##### check for mp4v2 ########################### if( WITH_MP4V2 ) - check_include_file( "mp4v2/mp4v2.h" MP4V2_H_FOUND ) - if( MP4V2_H_FOUND ) +##### check for mp4v2 + +check_include_file( "mp4v2/mp4v2.h" MP4V2_H_FOUND ) +if( MP4V2_H_FOUND ) set( HAVE_MP4V2_H 1) - else( MP4V2_H_FOUND ) - check_include_file( "mp4.h" MP4_H_FOUND ) - if( MP4_H_FOUND ) - set( HAVE_MP4_H 1) - endif( MP4_H_FOUND ) - endif( MP4V2_H_FOUND ) - - if( HAVE_MP4V2_H OR HAVE_MP4_H ) + + find_path( MP4V2_INCLUDE_DIR "mp4v2/mp4v2.h" ) + set( MP4V2_INCLUDE_DIRS "${MP4V2_INCLUDE_DIR}" ) + + find_library( MP4V2_LIBRARY mp4v2 ) + set( MP4V2_LIBRARIES "${MP4V2_LIBRARY}" ) +endif() + +check_include_file( "mp4.h" MP4_H_FOUND ) +if( MP4_H_FOUND ) + set( HAVE_MP4_H 1) + + find_path( MP4_INCLUDE_DIR "mp4.h" ) + set( MP4V2_INCLUDE_DIRS "${MP4_INCLUDE_DIR}" ) + + find_library( MP4_LIBRARY mp4 ) + set( MP4V2_LIBRARIES "${MP4_LIBRARY}" ) +endif() + +if( HAVE_MP4V2_H OR HAVE_MP4_H ) set( HAVE_MP4V2 1 ) - else( ) - tde_message_fatal( "MP4V2 support was requested, but not found on your system" ) - endif( ) + else() + tde_message_fatal( "MP4V2 support was requested but was not found on your system" ) +endif() +endif( WITH_MP4V2 ) + + +if( WITH_MYSQL ) +#### check for MySql or Mariadb + +find_program( MYSQL_CONFIG NAMES mariadb_config mysql_config ) +if( NOT MYSQL_CONFIG ) + tde_message_fatal( "MySql support is requested but neither MySql or Mariadb have been found on your system" ) + else() + +macro( _mysql_config __type __var ) + execute_process( + COMMAND ${MYSQL_CONFIG} --${__type} + OUTPUT_VARIABLE ${__var} + RESULT_VARIABLE __result + OUTPUT_STRIP_TRAILING_WHITESPACE ) + if( _result ) + tde_message_fatal( "Unable to run ${MYSQL_CONFIG}!" ) + endif() +endmacro() + +_mysql_config( include MYSQL_INCLUDE_DIRS ) +_mysql_config( libs MYSQL_LIBRARIES ) + +if( MYSQL_INCLUDE_DIRS ) + string( REGEX REPLACE "(^| +)-I" ";" MYSQL_INCLUDE_DIRS "${MYSQL_INCLUDE_DIRS}" ) +endif() + +if( MYSQL_LIBRARIES ) + string( REGEX REPLACE "(^| +)-l" ";" MYSQL_LIBRARIES "${MYSQL_LIBRARIES}" ) +endif( ) + +set( MYSQL_INCLUDE_DIRS "${MYSQL_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE ) +set( MYSQL_LIBRARIES "${MYSQL_LIBRARIES}" CACHE INTERNAL "" FORCE ) +set( USE_MYSQL 1 ) + +tde_save_and_set( CMAKE_REQUIRED_INCLUDES ${MYSQL_INCLUDE_DIRS} ) + +check_cxx_source_compiles(" +#include <mysql.h> +typedef struct st_mysql MYSQL; + +int main(int, char**) +{ + return 1; +}" +HAVE_STRUCT_ST_MYSQL ) + +if( HAVE_STRUCT_ST_MYSQL ) + set( MYSQL_STRUCT "st_mysql" ) +else() + + check_cxx_source_compiles(" +#include <mysql.h> +typedef struct MYSQL MYSQL; + +int main() +{ + return 1; +}" + HAVE_STRUCT_MYSQL ) + + if( HAVE_STRUCT_MYSQL ) + set( MYSQL_STRUCT "MYSQL" ) + else() + tde_message_fatal( "MySQL is requested, but it is not possible to determine the type of MySQL structure" ) + endif() +endif() + +tde_restore( CMAKE_REQUIRED_INCLUDES ) + +endif( NOT MYSQL_CONFIG ) +endif( WITH_MYSQL ) + + +if( WITH_POSTGRESQL ) +##### check for PostgreSQL + +find_package( PostgreSQL ) +if( PostgreSQL_VERSION_STRING ) + set( USE_POSTGRESQL 1 ) + else() + tde_message_fatal( "Postgresql support is requested but Postgresql was not found on your system." ) +endif() +endif( WITH_POSTGRESQL ) + + +if( WITH_EMBEDDED_SQLITE ) + set( SQLITE_LIBRARIES sqlite-static ) + message( STATUS "sqlite3 linking: ${SQLITE_LIBRARIES}" ) +endif() + + +if( WITH_SYSTEM_SQLITE ) +##### check for sqlite3 + +pkg_search_module( SQLITE sqlite3 ) +if( NOT SQLITE_FOUND ) + tde_message_fatal( "sqlite3 is required, but not found on your system" ) + else() + message( STATUS "sqlite3 linking: ${SQLITE_LIBRARIES}" ) endif( ) +endif( WITH_SYSTEM_SQLITE ) |