@ -9,26 +9,27 @@
#
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # c h e c k f o r g c c v i s i b i l i t y s u p p o r t # # # # # # # # #
# r e q u i r e d s t u f f
# F I X M E
find_package ( TQt )
# T h i s s h o u l d c h e c k f o r [ T ] Q t 3 v i s i b i l i t y s u p p o r t
find_package ( TDE )
tde_setup_architecture_flags ( )
include ( TestBigEndian )
test_big_endian ( WORDS_BIGENDIAN )
tde_setup_largefiles ( )
# # # # # c h e c k f o r g c c v i s i b i l i t y s u p p o r t
if ( WITH_GCC_VISIBILITY )
if ( WITH_GCC_VISIBILITY )
if ( NOT UNIX )
tde_setup_gcc_visibility ( )
tde_message_fatal ( FATAL_ERROR "\ngcc visibility support was requested, but your system is not *NIX" )
endif ( WITH_GCC_VISIBILITY )
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 ( )
if ( BUILD_TRANSLATIONS AND NOT DEFINED MSGFMT_EXECUTABLE )
find_package ( Threads )
find_program ( MSGFMT_EXECUTABLE msgfmt )
find_package ( X11 )
if ( NOT MSGFMT_EXECUTABLE )
tde_message_fatal ( "msgfmt program is required, but was not found on your system" )
endif ( )
endif ( )
check_type_size ( "int" SIZEOF_INT BUILTIN_TYPES_ONLY )
check_type_size ( "int" SIZEOF_INT BUILTIN_TYPES_ONLY )
check_type_size ( "long" SIZEOF_LONG 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" )
tde_message_fatal ( "taglib version must be at least 1.5" )
else ( )
else ( )
set ( TAGLIB_15 1 )
set ( TAGLIB_15 1 )
message ( STATUS "Found TAGLIB: ${TAGLIB_INCLUDE_DIRS}" )
endif ( )
endif ( )
else ( )
else ( )
tde_message_fatal ( "taglib are required, but not found on your system" )
tde_message_fatal ( "taglib is required, but not found on your system" )
endif ( )
# s q l i t e 3
pkg_search_module ( SQLITE sqlite3 )
if ( NOT SQLITE_FOUND )
tde_message_fatal ( "sqlite3 are required, but not found on your system" )
endif ( )
endif ( )
@ -122,7 +117,7 @@ if( WITH_LIBVISUAL )
if ( NOT SDL_FOUND )
if ( NOT SDL_FOUND )
check_include_file ( SDL/SDL.h HAVE_SDL_H )
check_include_file ( SDL/SDL.h HAVE_SDL_H )
if ( NOT 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 ( )
endif ( )
set ( SDL_INCLUDE_DIRS /usr/include/SDL )
set ( SDL_INCLUDE_DIRS /usr/include/SDL )
set ( SDL_LIBRARIES SDL pthread )
set ( SDL_LIBRARIES SDL pthread )
@ -134,7 +129,7 @@ if( WITH_LIBVISUAL )
tde_message_fatal ( "libvisual version must be at least 0.4.0" )
tde_message_fatal ( "libvisual version must be at least 0.4.0" )
endif ( )
endif ( )
else ( )
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 ( )
endif ( )
set ( HAVE_LIBVISUAL 1 )
set ( HAVE_LIBVISUAL 1 )
@ -166,9 +161,12 @@ if( WITH_AKODE )
endif ( )
endif ( )
# i P o d
# # # # # c h e c k f o r l i b g p o d - i P o d
if ( WITH_IPOD )
if ( WITH_IPOD )
pkg_search_module ( GLIB2 glib-2.0 )
pkg_search_module ( GPOD libgpod-1.0 )
pkg_search_module ( GPOD libgpod-1.0 )
if ( GPOD_FOUND )
if ( GPOD_FOUND )
if ( ${ GPOD_VERSION } VERSION_LESS "0.4.2" )
if ( ${ GPOD_VERSION } VERSION_LESS "0.4.2" )
@ -190,20 +188,29 @@ if( WITH_IPOD )
endif ( )
endif ( )
# c o m m o n r e q u i r e d s t u f f
if ( WITH_OPENGL )
find_package ( TQt )
set ( OpenGL_GL_PREFERENCE LEGACY )
find_package ( TDE )
find_package ( GLUT )
find_package ( OpenGL )
# # # # # c h e c k f o r O p e n G L s u p p o r t w i t h i n t q t
# c h e c k f o r Q t w i t h O p e n G L s u p p o r t
tde_save ( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
tde_save ( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
set ( CMAKE_REQUIRED_INCLUDES ${ QT_INCLUDE_DIRS } )
set ( CMAKE_REQUIRED_INCLUDES ${ TQT_INCLUDE_DIRS } )
set ( CMAKE_REQUIRED_LIBRARIES -L ${ QT_LIBRARY_DIRS } ${ QT_LIBRARIES } )
set ( CMAKE_REQUIRED_LIBRARIES -L ${ TQT_LIBRARY_DIRS } ${ TQT_LIBRARIES } )
check_cxx_source_compiles ( "
check_cxx_source_compiles ( "
# i n c l u d e < q g l . h >
# i n c l u d e < c s t d l i b >
i n t main ( int, char** ) { ( v o i d ) n e w QGLWidget ( ( QWidget* ) 0, \"qgl\"); return 0; } "
# i n c l u d e < t q g l . h >
H A V E _ Q G L W I D G E T )
i n t main ( int, char** )
{
( v o i d ) n e w TQGLWidget ( ( TQWidget* ) 0, \"qgl\" ) ;
r e t u r n E X I T _ S U C C E S S ;
} "
H A V E _ T Q G L W I D G E T )
tde_restore ( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
tde_restore ( CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
endif ( WITH_OPENGL )
# k o n q s i d e b a r p l u g i n . h
# k o n q s i d e b a r p l u g i n . h
@ -219,26 +226,142 @@ if( WITH_KONQSIDEBAR )
H A V E _ K O N Q S I D E B A R P L U G I N _ H )
H A V E _ K O N Q S I D E B A R P L U G I N _ H )
tde_restore ( CMAKE_REQUIRED_DEFINITIONS CMAKE_REQUIRED_FLAGS CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
tde_restore ( CMAKE_REQUIRED_DEFINITIONS CMAKE_REQUIRED_FLAGS CMAKE_REQUIRED_INCLUDES CMAKE_REQUIRED_LIBRARIES )
if ( NOT HAVE_KONQSIDEBARPLUGIN_H )
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 ( )
endif ( )
endif ( )
# # # # # c h e c k f o r m p 4 v 2 # # # # # # # # # # # # # # # # # # # # # # # # # # #
if ( WITH_MP4V2 )
if ( WITH_MP4V2 )
check_include_file ( "mp4v2/mp4v2.h" MP4V2_H_FOUND )
# # # # # c h e c k f o r m p 4 v 2
if ( MP4V2_H_FOUND )
check_include_file ( "mp4v2/mp4v2.h" MP4V2_H_FOUND )
if ( MP4V2_H_FOUND )
set ( HAVE_MP4V2_H 1 )
set ( HAVE_MP4V2_H 1 )
else ( MP4V2_H_FOUND )
check_include_file ( "mp4.h" MP4_H_FOUND )
find_path ( MP4V2_INCLUDE_DIR "mp4v2/mp4v2.h" )
if ( MP4_H_FOUND )
set ( MP4V2_INCLUDE_DIRS "${MP4V2_INCLUDE_DIR}" )
set ( HAVE_MP4_H 1 )
endif ( MP4_H_FOUND )
find_library ( MP4V2_LIBRARY mp4v2 )
endif ( MP4V2_H_FOUND )
set ( MP4V2_LIBRARIES "${MP4V2_LIBRARY}" )
endif ( )
if ( HAVE_MP4V2_H OR HAVE_MP4_H )
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 )
set ( HAVE_MP4V2 1 )
else ( )
else ( )
tde_message_fatal ( "MP4V2 support was requested, but not found on your system" )
tde_message_fatal ( "MP4V2 support was requested but was not found on your system" )
endif ( )
endif ( )
endif ( WITH_MP4V2 )
if ( WITH_MYSQL )
# # # # c h e c k f o r M y S q l o r M a r i a d b
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 (
C O M M A N D $ { M Y S Q L _ C O N F I G } - - $ { _ _ t y p e }
O U T P U T _ V A R I A B L E $ { _ _ v a r }
R E S U L T _ V A R I A B L E _ _ r e s u l t
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E )
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 ( "
# i n c l u d e < m y s q l . h >
t y p e d e f s t r u c t s t _ m y s q l M Y S Q L ;
i n t main ( int, char** )
{
r e t u r n 1 ;
} "
H A V E _ S T R U C T _ S T _ M Y S Q L )
if ( HAVE_STRUCT_ST_MYSQL )
set ( MYSQL_STRUCT "st_mysql" )
else ( )
check_cxx_source_compiles ( "
# i n c l u d e < m y s q l . h >
t y p e d e f s t r u c t M Y S Q L M Y S Q L ;
i n t main ( )
{
r e t u r n 1 ;
} "
H A V E _ S T R U C T _ M Y S Q L )
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 )
# # # # # c h e c k f o r P o s t g r e S Q L
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 )
# # # # # c h e c k f o r s q l i t e 3
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 ( )
endif ( WITH_SYSTEM_SQLITE )