diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 438 |
1 files changed, 315 insertions, 123 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 91cf38c55..baecceb88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,12 @@ # ################################################# -cmake_minimum_required( VERSION 2.8 ) + +##### set project version ######################## + +include( TDEVersion ) +cmake_minimum_required( VERSION ${TDE_CMAKE_MINIMUM_VERSION} ) +tde_set_project_version( ) ##### general package setup ##################### @@ -17,13 +22,13 @@ cmake_minimum_required( VERSION 2.8 ) project( tdelibs ) set( PACKAGE tdelibs ) -set( VERSION R14.1.0 ) ##### include essential cmake modules ########### include( FindPkgConfig ) include( CheckIncludeFile ) +include( CheckIncludeFiles ) include( CheckSymbolExists ) include( CheckFunctionExists ) include( CheckCSourceCompiles ) @@ -31,11 +36,11 @@ include( CheckCXXSourceCompiles ) include( CheckTypeSize ) include( CheckCSourceRuns ) include( CheckLibraryExists ) +include( CheckStructHasMember ) ##### include our cmake modules ################# -set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ) include( TDEMacros ) include( TDESetupPaths ) @@ -52,67 +57,91 @@ list( APPEND TDECORE_LIBRARY_DIRS ${TQT_LIBRARY_DIRS} ) ##### add apidox targets ############ -add_custom_target(apidox - COMMAND "./generate_apidox" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${HTML_INSTALL_DIR}" "/usr/share/tqt3/doc/html" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/cmake/") +add_custom_target( apidox + COMMAND ${CMAKE_COMMAND} -E env + "TQTDOCDIR=/usr/share/tqt3/doc/html" + ${CMAKE_SOURCE_DIR}/admin/doxygen.sh + --no-modulename + ${CMAKE_SOURCE_DIR} + COMMAND + find ${CMAKE_BINARY_DIR}/apidocs -name '*.html' | + xargs -r sed -i 's|${CMAKE_BINARY_DIR}/apidocs|${HTML_INSTALL_DIR}/en/${PROJECT_NAME}-apidocs|g' + COMMAND + find ${CMAKE_BINARY_DIR}/apidocs -name '*.tag' | + xargs -r sed -i 's|${CMAKE_SOURCE_DIR}/|${PROJECT_NAME}/|g' + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} +) -add_custom_target(install-apidox - COMMAND "./install_apidox" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${HTML_INSTALL_DIR}" "${CMAKE_INSTALL_PREFIX}" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/cmake/") +add_custom_target( install-apidox + COMMAND ${CMAKE_COMMAND} -E echo Apidox installed in ${HTML_INSTALL_DIR}/en/${PROJECT_NAME}-apidocs +) + +install( CODE " + if( EXISTS ${CMAKE_BINARY_DIR}/apidocs ) + file( + INSTALL ${CMAKE_BINARY_DIR}/apidocs/ + DESTINATION ${HTML_INSTALL_DIR}/en/${PROJECT_NAME}-apidocs + PATTERN doxygen_sqlite3.db EXCLUDE + PATTERN installdox-slow EXCLUDE + ) + endif()" +) ##### user requested OPTIONs #################### -OPTION( WITH_ALL_OPTIONS "Enable all OPTIONal support" OFF ) - -OPTION( TDE_MALLOC "Use own malloc implementation" OFF ) -OPTION( TDE_MALLOC_DEBUG "Enable debugging in fast malloc" OFF ) -OPTION( TDE_MALLOC_FULL "Make alloc as fast as possible" OFF ) - -OPTION( WITH_ARTS "Build with aRts" ON ) -OPTION( WITH_ALSA "Enable ALSA support" ON ) -OPTION( WITH_LIBART "Enable libart support (for SVG icons)" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_LIBIDN "Enable support for libidn" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_SSL "Enable support for SSL" ON ) -OPTION( WITH_CUPS "Enable CUPS support" ON ) -OPTION( WITH_LUA "Enable LUA support" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_TIFF "Enable tiff support" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_JASPER "Enable jasper (jpeg2k) support" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_OPENEXR "Enable openexr support" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_UTEMPTER "Use utempter for utmp management" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_AVAHI "Enable AVAHI support" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_ELFICON "Enable ELF embedded icon support" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_PCRE "Enable pcre regex support for kjs" ON ) -OPTION( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_INOTIFY "Enable inotify support for tdeio" ON ) -OPTION( WITH_GAMIN "Enable FAM/GAMIN support" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_TDEHWLIB "Enable TDE hwlib globally" ON ) -OPTION( WITH_TDEHWLIB_DAEMONS "Enable daemons for TDE hwlib" ${WITH_TDEHWLIB} ) -OPTION( WITH_HAL "Enable HAL support" OFF ) -OPTION( WITH_DEVKITPOWER "Enable DeviceKit Power support" OFF ) -OPTION( WITH_LOGINDPOWER "Enable Logind/Systemd Power support" OFF ) -OPTION( WITH_UPOWER "Enable uPower support" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_UDISKS "Enable uDisks support" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_UDISKS2 "Enable uDisks2 support" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_UDEVIL "Enable udevil support" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_CONSOLEKIT "Enable ConsoleKit support" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_NETWORK_MANAGER_BACKEND "Enable network-manager support" OFF ) -OPTION( WITH_SUDO_TDESU_BACKEND "Use sudo as backend for tdesu (default is su)" OFF ) -OPTION( WITH_OLD_XDG_STD "Use the pre R14.0.0 XDG standard where both TDE and KDE are recognized in desktop files" OFF ) -OPTION( WITH_PCSC "Enable PC/SC SmartCard support" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_PKCS "Enable PKCS support" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_CRYPTSETUP "Enable cryptsetup support" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_LZMA "Enable support for LZMA/XZ" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_LIBBFD "Enable pretty backtraces with libbfd from GNU binutils" OFF ) -OPTION( WITH_XRANDR "Build the tderandr library" ON ) -OPTION( WITH_XCOMPOSITE "Enable xcomposite support" ON ) -OPTION( WITH_MITSHM "Use MIT-SHM for pixmap loading/saving" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_KDE4_MENU_SUFFIX "Add [KDE4] tag to KDE4 menu items" OFF ) - -OPTION( WITH_ASPELL "Enable aspell support" ${WITH_ALL_OPTIONS} ) -OPTION( WITH_HSPELL "Enable hspell support" ${WITH_ALL_OPTIONS} ) - -OPTION( WITH_TDEICONLOADER_DEBUG "Enable debugging in TDEIconLoader class" OFF ) +option( WITH_ALL_OPTIONS "Enable all OPTIONal support" OFF ) + +option( TDE_MALLOC "Use own malloc implementation" OFF ) +option( TDE_MALLOC_DEBUG "Enable debugging in fast malloc" OFF ) +option( TDE_MALLOC_FULL "Make alloc as fast as possible" OFF ) + +option( WITH_ARTS "Build with aRts" ON ) +option( WITH_ALSA "Enable ALSA support" ON ) +option( WITH_LIBART "Enable libart support (for SVG icons)" ${WITH_ALL_OPTIONS} ) +option( WITH_LIBIDN "Enable support for libidn" ${WITH_ALL_OPTIONS} ) +option( WITH_SSL "Enable support for SSL" ON ) +option( WITH_CUPS "Enable CUPS support" ON ) +option( WITH_IMAGETOPS_BINARY "Enable installation of imagetops binary" ${WITH_ALL_OPTIONS} ) +option( WITH_LUA "Enable LUA support" ${WITH_ALL_OPTIONS} ) +option( WITH_TIFF "Enable tiff support" ${WITH_ALL_OPTIONS} ) +option( WITH_JASPER "Enable jasper (jpeg2k) support" ${WITH_ALL_OPTIONS} ) +option( WITH_WEBP "Enable WebP support" ${WITH_ALL_OPTIONS} ) +option( WITH_OPENEXR "Enable openexr support" ${WITH_ALL_OPTIONS} ) +option( WITH_UTEMPTER "Use utempter for utmp management" ${WITH_ALL_OPTIONS} ) +option( WITH_AVAHI "Enable AVAHI support" ${WITH_ALL_OPTIONS} ) +option( WITH_ELFICON "Enable ELF embedded icon support" ${WITH_ALL_OPTIONS} ) +option( WITH_PCRE2 "Enable pcre2 regex support for kjs" ON ) +option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} ) +option( WITH_INOTIFY "Enable inotify support for tdeio" ON ) +option( WITH_GAMIN "Enable FAM/GAMIN support" ${WITH_ALL_OPTIONS} ) +option( WITH_TDEHWLIB "Enable TDE hwlib globally" ON ) +option( WITH_TDEHWLIB_DAEMONS "Enable daemons for TDE hwlib" ${WITH_TDEHWLIB} ) +option( WITH_DEVKITPOWER "Enable DeviceKit Power support" OFF ) +option( WITH_LOGINDPOWER "Enable Logind/Systemd Power support" OFF ) +option( WITH_UPOWER "Enable uPower support" ${WITH_ALL_OPTIONS} ) +option( WITH_UDISKS "Enable uDisks support" ${WITH_ALL_OPTIONS} ) +option( WITH_UDISKS2 "Enable uDisks2 support" ${WITH_ALL_OPTIONS} ) +option( WITH_UDEVIL "Enable udevil support" ${WITH_ALL_OPTIONS} ) +option( WITH_CONSOLEKIT "Enable ConsoleKit support" ${WITH_ALL_OPTIONS} ) +option( WITH_NETWORK_MANAGER_BACKEND "Enable network-manager support" OFF ) +option( WITH_SUDO_TDESU_BACKEND "Use sudo as backend for tdesu (default is su)" OFF ) +option( WITH_OLD_XDG_STD "Use the pre R14.0.0 XDG standard where both TDE and KDE are recognized in desktop files" OFF ) +option( WITH_PCSC "Enable PC/SC SmartCard support" ${WITH_ALL_OPTIONS} ) +option( WITH_PKCS "Enable PKCS support" ${WITH_ALL_OPTIONS} ) +option( WITH_CRYPTSETUP "Enable cryptsetup support" ${WITH_ALL_OPTIONS} ) +option( WITH_LZMA "Enable support for LZMA/XZ" ${WITH_ALL_OPTIONS} ) +option( WITH_LIBBFD "Enable pretty backtraces with libbfd from GNU binutils" OFF ) +option( WITH_XRANDR "Build the tderandr library" ON ) +option( WITH_XCOMPOSITE "Enable xcomposite support" ON ) +option( WITH_MITSHM "Use MIT-SHM for pixmap loading/saving" ${WITH_ALL_OPTIONS} ) +option( WITH_KDE4_MENU_SUFFIX "Add [KDE4] tag to KDE4 menu items" OFF ) + +option( WITH_ISPELL "Enable ispell support" ON ) +option( WITH_ASPELL "Enable aspell support" ${WITH_ALL_OPTIONS} ) +option( WITH_HSPELL "Enable hspell support" ${WITH_ALL_OPTIONS} ) + +option( WITH_TDEICONLOADER_DEBUG "Enable debugging in TDEIconLoader class" OFF ) ##### set PKG_CONFIG_PATH ####################### @@ -192,6 +221,7 @@ check_include_file( "dirent.h" HAVE_DIRENT_H ) check_include_file( "dld.h" HAVE_DLD_H ) check_include_file( "dlfcn.h" HAVE_DLFCN_H ) check_include_file( "dl.h" HAVE_DL_H ) +check_include_files( "sys/types.h;sys/dl.h" HAVE_SYS_DL_H ) check_include_file( "float.h" HAVE_FLOAT_H ) check_include_file( "fstab.h" HAVE_FSTAB_H ) check_include_file( "ieeefp.h" HAVE_IEEEFP_H ) @@ -204,6 +234,7 @@ check_include_file( "machine/soundcard.h" HAVE_MACHINE_SOUNDCARD_H ) check_include_file( "malloc.h" HAVE_MALLOC_H ) check_include_file( "memory.h" HAVE_MEMORY_H ) check_include_file( "mntent.h" HAVE_MNTENT_H ) +check_include_file( "sys/mntent.h" HAVE_SYS_MNTENT_H ) check_include_file( "ndir.h" HAVE_NDIR_H ) check_include_file( "netinet/in.h" HAVE_NETINET_IN_H ) check_include_file( "net/if.h" HAVE_NET_IF_H ) @@ -222,12 +253,11 @@ check_include_file( "strings.h" HAVE_STRINGS_H ) check_include_file( "string.h" HAVE_STRING_H ) check_include_file( "sysent.h" HAVE_SYSENT_H ) check_include_file( "sys/acl.h" HAVE_SYS_ACL_H ) -check_include_file( "sys/bitypes.h" HAVE_SYS_BITYPES_H ) check_include_file( "sys/dir.h" HAVE_SYS_DIR_H ) check_include_file( "sys/filio.h" HAVE_SYS_FILIO_H ) check_include_file( "sys/mman.h" HAVE_SYS_MMAN_H ) check_include_file( "sys/mntent.h" HAVE_SYS_MNTENT_H ) -check_include_file( "sys/mnttab.h" HAVE_SYS_MNTTAB_H ) +check_include_files( "stdio.h;sys/mnttab.h" HAVE_SYS_MNTTAB_H ) check_include_file( "sys/mount.h" HAVE_SYS_MOUNT_H ) if( NOT HAVE_SYS_MOUNT_H ) find_path( SYS_MOUNT_PATH "sys/mount.h" ) @@ -247,9 +277,16 @@ check_include_file( "sys/ucred.h" HAVE_SYS_UCRED_H ) if( NOT HAVE_SYS_UCRED_H ) find_path( SYS_UCRED_PATH "sys/ucred.h" ) if( SYS_UCRED_PATH ) - set( HAVE_SYS_UCRED_H "1" ) + set( HAVE_SYS_UCRED_H 1 ) endif( ) endif( ) +check_include_file( "ucred.h" HAVE_UCRED_H ) +if( NOT HAVE_UCRED_H ) + find_path( UCRED_PATH "ucred.h" ) + if( UCRED_PATH ) + set( HAVE_UCRED_H 1 ) + endif() +endif() check_include_file( "sys/xattr.h" HAVE_SYS_XATTR_H ) check_include_file( "termios.h" HAVE_TERMIOS_H ) check_include_file( "termio.h" HAVE_TERMIO_H ) @@ -316,7 +353,7 @@ check_function_exists( mkstemp HAVE_MKSTEMP ) check_symbol_exists( mkstemp "stdlib.h" HAVE_MKSTEMP_PROTO ) check_function_exists( mkstemps HAVE_MKSTEMPS ) -check_symbol_exists( mkstemps "stdlib.h" HAVE_MKSTEMPS_PROTO ) +check_symbol_exists( mkstemps "stdlib.h;unistd.h" HAVE_MKSTEMPS_PROTO ) check_function_exists( initgroups HAVE_INITGROUPS ) check_symbol_exists( initgroups "grp.h;unistd.h" HAVE_INITGROUPS_PROTO ) @@ -334,7 +371,21 @@ check_symbol_exists( gethostbyname2_r "netdb.h" HAVE_GETHOSTBYNAME2_R ) check_symbol_exists( gethostbyname_r "netdb.h" HAVE_GETHOSTBYNAME_R ) check_symbol_exists( gai_strerror "sys/types.h;sys/socket.h;netdb.h" HAVE_GAI_STRERROR ) check_symbol_exists( getaddrinfo "sys/types.h;sys/socket.h;netdb.h" HAVE_GETADDRINFO ) -check_symbol_exists( backtrace "execinfo.h" HAVE_BACKTRACE ) +if ( CMAKE_MAJOR_VERSION LESS "3" ) + check_symbol_exists( backtrace "execinfo.h" HAVE_BACKTRACE ) + if ( HAVE_BACKTRACE ) + set ( Backtrace_LIBRARY "" ) + set ( Backtrace_HEADER "execinfo.h" ) + endif () +else () + find_package( Backtrace ) + if ( Backtrace_FOUND ) + set ( HAVE_BACKTRACE 1 ) + else () + set ( Backtrace_LIBRARY "" ) + set ( Backtrace_HEADER "" ) + endif () +endif () check_cxx_source_compiles( "#include <cxxabi.h> int main() { abi::__cxa_demangle(0, 0, 0, 0); return 0; }" HAVE_ABI_CXA_DEMANGLE ) @@ -349,7 +400,7 @@ check_symbol_exists( ffs "string.h" HAVE_FFS_PROTO ) check_symbol_exists( asprintf "stdio.h" HAVE_ASPRINTF_PROTO ) check_symbol_exists( vasprintf "stdio.h" HAVE_VASPRINTF_PROTO ) check_symbol_exists( snprintf "stdio.h" HAVE_SNPRINTF_PROTO ) -check_symbol_exists( vsnprintf "stdarg.h" HAVE_VSNPRINTF_PROTO ) +check_symbol_exists( vsnprintf "stdarg.h;stdio.h" HAVE_VSNPRINTF_PROTO ) check_symbol_exists( strvercmp "string.h" HAVE_STRVERCMP_PROTO ) @@ -380,10 +431,12 @@ endif( HAVE_GETMNTINFO ) check_function_exists( getnameinfo HAVE_GETNAMEINFO ) check_function_exists( getpagesize HAVE_GETPAGESIZE ) check_function_exists( getpeereid HAVE_GETPEEREID ) +check_function_exists( getpeerucred HAVE_GETPEERUCRED ) check_function_exists( getpeername HAVE_GETPEERNAME ) check_function_exists( getprotobyname_r HAVE_GETPROTOBYNAME_R ) check_function_exists( getpt HAVE_GETPT ) check_function_exists( getservbyname_r HAVE_GETSERVBYNAME_R ) +check_symbol_exists( getservbyname_r "netdb.h" HAVE_DECL_GETSERVBYNAME_R ) check_function_exists( getservbyport_r HAVE_GETSERVBYPORT_R ) check_function_exists( getsockname HAVE_GETSOCKNAME ) check_function_exists( getsockopt HAVE_GETSOCKOPT ) @@ -410,6 +463,7 @@ check_function_exists( strcasecmp HAVE_STRCASECMP ) check_function_exists( strchr HAVE_STRCHR ) check_function_exists( strcmp HAVE_STRCMP ) check_function_exists( strrchr HAVE_STRRCHR ) +check_function_exists( posix_openpt HAVE_POSIX_OPENPT ) check_function_exists( ptsname HAVE_PTSNAME ) check_function_exists( unlockpt HAVE_UNLOCKPT ) check_function_exists( _getpty HAVE__GETPTY ) @@ -417,21 +471,25 @@ check_function_exists( __argz_count HAVE___ARGZ_COUNT ) check_function_exists( __argz_next HAVE___ARGZ_NEXT ) check_function_exists( __argz_stringify HAVE___ARGZ_STRINGIFY ) check_function_exists( sendfile HAVE_SENDFILE ) +set( SENDFILE_LIBRARIES "" ) +if( NOT HAVE_SENDFILE) + check_library_exists( sendfile sendfile "" HAVE_SENDFILE_LIB ) + if( HAVE_SENDFILE_LIB ) + set( HAVE_SENDFILE 1 ) + set( SENDFILE_LIBRARIES sendfile ) + endif( HAVE_SENDFILE_LIB ) +endif() check_function_exists( rindex HAVE_RINDEX ) check_function_exists( putenv HAVE_PUTENV ) check_function_exists( poll HAVE_POLL ) -check_function_exists( memcpy HAVE_MEMCPY ) check_function_exists( madvise HAVE_MADVISE ) check_function_exists( getgroups HAVE_GETGROUPS ) +check_symbol_exists( posix_fadvise "fcntl.h" HAVE_FADVISE ) check_function_exists( getcwd HAVE_GETCWD ) +tde_save_and_set( CMAKE_REQUIRED_LIBRARIES ${CMAKE_DL_LIBS} ) +check_function_exists( dlopen HAVE_LIBDL ) check_function_exists( dlerror HAVE_DLERROR ) -if( NOT HAVE_DLERROR ) - check_library_exists( dl dlerror "" HAVE_DLERROR_LIB ) - if( HAVE_DLERROR_LIB ) - set( HAVE_DLERROR 1 ) - set( DLERROR_LIBRARIES dl ) - endif( HAVE_DLERROR_LIB ) -endif( NOT HAVE_DLERROR ) +tde_restore( CMAKE_REQUIRED_LIBRARIES ) check_function_exists( crypt HAVE_CRYPT ) if( NOT HAVE_CRYPT ) check_library_exists( crypt crypt "" HAVE_CRYPT_LIB ) @@ -447,7 +505,6 @@ if( NOT HAVE_CRYPT ) set( CRYPT_LIBRARIES c ) endif( HAVE_CRYPT_LIBC ) endif( NOT HAVE_CRYPT ) -check_function_exists( bcopy HAVE_BCOPY ) check_function_exists( mmap HAVE_MMAP ) check_function_exists( munmap HAVE_MUNMAP ) @@ -461,7 +518,13 @@ check_type_size( "unsigned long" SIZEOF_UNSIGNED_LONG ) set( CMAKE_EXTRA_INCLUDE_FILES "netdb.h" ) check_type_size( "struct addrinfo" STRUCT_ADDRINFO ) set( CMAKE_EXTRA_INCLUDE_FILES "netinet/in.h" ) -check_type_size( "struct sockaddr_in6" HAVE_STRUCT_SOCKADDR_IN6 ) +check_type_size( "struct sockaddr_in6" STRUCT_SOCKADDR_IN6 ) +check_struct_has_member( "struct sockaddr_in6" sin6_scope_id "sys/types.h;sys/socket.h;netinet/in.h" HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID ) +check_struct_has_member( "struct sockaddr" sa_len "sys/types.h;sys/socket.h;netinet/in.h" HAVE_STRUCT_SOCKADDR_SA_LEN ) +check_struct_has_member( "struct sockaddr_un" sun_len "sys/types.h;sys/un.h" HAVE_STRUCT_SOCKADDR_UN_SUN_LEN ) +set( CMAKE_EXTRA_INCLUDE_FILES "sys/socket.h" ) +check_type_size( "struct ucred" STRUCT_UCRED ) +check_struct_has_member( "struct sockaddr_in" sin_len "sys/types.h;sys/socket.h;netinet/in.h" HAVE_STRUCT_SOCKADDR_IN_SIN_LEN ) unset( CMAKE_EXTRA_INCLUDE_FILES ) check_c_source_compiles(" @@ -507,6 +570,8 @@ endif( NOT HAVE_GOOD_GETADDRINFO ) # save CMAKE_REQUIRED_LIBRARIES set( bak_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ) +check_symbol_exists( res_init "sys/types.h;netinet/in.h;arpa/nameser.h;resolv.h" HAVE_RES_INIT_PROTO ) + set( CMAKE_REQUIRED_LIBRARIES resolv ) check_c_source_compiles(" #include <sys/types.h> @@ -582,19 +647,6 @@ if( WITH_TDEHWLIB ) endif( WITH_TDEHWLIB ) -##### check for libdl ########################### - -set( DL_LIBRARIES dl ) -check_library_exists( ${DL_LIBRARIES} dlopen /lib HAVE_LIBDL ) -if( NOT HAVE_LIBDL ) - unset( DL_LIBRARIES ) - check_function_exists( dlopen HAVE_DLOPEN ) - if( HAVE_DLOPEN ) - set( HAVE_LIBDL 1 ) - endif( HAVE_DLOPEN ) -endif( NOT HAVE_LIBDL ) - - ##### check for magic ########################### set( MAGIC_LIBRARIES magic ) @@ -699,26 +751,29 @@ endif( WITH_LZMA ) ##### check for pcsc ############################ -if( WITH_PCSC ) - find_path( PCSCLITE_INCLUDE_DIR pcsclite.h - HINTS /usr/include/PCSC ) - find_library( PCSCLITE_LIBRARY NAMES pcsclite libpcsclite PCSC ) - if( PCSCLITE_LIBRARY AND PCSCLITE_INCLUDE_DIR ) - message( STATUS "Found PCSCLITE: ${PCSCLITE_LIBRARY}" ) - set( PCSCLITE_FOUND 1 ) - set( PCSCLITE_INCLUDE_DIRS ${PCSCLITE_INCLUDE_DIR} ) - set( PCSCLITE_LIBRARIES ${PCSCLITE_LIBRARY} ) - endif( PCSCLITE_LIBRARY AND PCSCLITE_INCLUDE_DIR ) +if( WITH_TDEHWLIB AND WITH_PCSC ) + pkg_search_module( PCSCLITE libpcsclite ) + if( NOT PCSCLITE_FOUND ) + find_path( PCSCLITE_INCLUDE_DIR pcsclite.h + HINTS /usr/include/PCSC ) + find_library( PCSCLITE_LIBRARY NAMES pcsclite libpcsclite PCSC ) + if( PCSCLITE_LIBRARY AND PCSCLITE_INCLUDE_DIR ) + message( STATUS "Found PCSCLITE: ${PCSCLITE_LIBRARY}" ) + set( PCSCLITE_FOUND 1 ) + set( PCSCLITE_INCLUDE_DIRS ${PCSCLITE_INCLUDE_DIR} ) + set( PCSCLITE_LIBRARIES ${PCSCLITE_LIBRARY} ) + endif( PCSCLITE_LIBRARY AND PCSCLITE_INCLUDE_DIR ) + endif( NOT PCSCLITE_FOUND ) if( NOT PCSCLITE_FOUND ) tde_message_fatal( "PCSCLITE is requested, but not found on your system" ) endif( NOT PCSCLITE_FOUND ) set( HAVE_PCSC_SUPPORT 1 ) -endif( WITH_PCSC ) +endif( WITH_TDEHWLIB AND WITH_PCSC ) ##### check for pkcs ############################ -if( WITH_PKCS ) +if( WITH_TDEHWLIB AND WITH_PKCS ) pkg_search_module( LIBPKCS11-HELPER libpkcs11-helper-1 ) if( NOT LIBPKCS11-HELPER_FOUND ) message(FATAL_ERROR "\nPKCS support was requested, but libpkcs11-helper-1 was not found on your system" ) @@ -732,18 +787,15 @@ if( WITH_PKCS ) tde_message_fatal( "PKCS is requested, but no OpenSC PKCS11 provider was found on your system" ) endif( NOT OPENSC_PKCS11_PROVIDER_FOUND ) pkg_search_module( SSL openssl ) - if( NOT SSL_FOUND OR SSL_VERSION VERSION_LESS "1.1" ) + if( SSL_FOUND ) set( HAVE_PKCS 1 ) - else( ) - set( WITH_PKCS OFF CACHE INTERNAL "PKCS support is not ready for OpenSSL >= 1.1" FORCE ) - message( WARNING "\nPKCS support is not ready for OpenSSL >= 1.1" ) endif( ) endif( ) ##### check for pkcs ############################ -if( WITH_CRYPTSETUP ) +if( WITH_TDEHWLIB AND WITH_CRYPTSETUP ) pkg_search_module( LIBCRYPTSETUP libcryptsetup ) if( NOT LIBCRYPTSETUP_FOUND ) find_library( LIBCRYPTSETUP_LIBRARY cryptsetup ) @@ -760,7 +812,7 @@ if( WITH_CRYPTSETUP ) check_c_source_compiles(" #include <stddef.h> #include <libcryptsetup.h> - int main(int argc, char *argv[]) { crypt_keyslot_info status = CRYPT_SLOT_INVALID; return 0; } " + int main(int argc, char *argv[]) { crypt_keyslot_info status = CRYPT_SLOT_ACTIVE; return 0; } " HAVE_NEW_CRYPTSETUP ) check_c_source_compiles(" #include <stddef.h> @@ -802,7 +854,10 @@ set( HAVE_LIBPNG 1 ) ##### check for tiff ############################ if( WITH_TIFF ) - find_package( TIFF ) + pkg_search_module( TIFF libtiff-4 ) + if( NOT TIFF_FOUND ) + find_package( TIFF ) + endif( NOT TIFF_FOUND ) if( NOT TIFF_FOUND ) message(FATAL_ERROR "\ntiff are requested, but not found on your system" ) endif( NOT TIFF_FOUND ) @@ -821,6 +876,32 @@ if( WITH_JASPER ) endif( WITH_JASPER ) +##### check for webp ############################ + +if( WITH_WEBP ) + pkg_search_module( WEBP libwebp ) + if( WEBP_FOUND ) + set( HAVE_WEBP 1 ) + else ( NOT WEBP_FOUND ) + check_include_file( "webp/decode.h" HAVE_WEBP_DECODE_H) + if ( HAVE_WEBP_DECODE_H ) + check_library_exists( webp WebPGetInfo "" HAVE_WEBP__WEBPGETINFO ) + check_library_exists( webp WebPDecodeARGBInto "" HAVE_WEBP__WEBPDECODEARGBINTO ) + check_library_exists( webp WebPDecodeBGRAInto "" HAVE_WEBP__WEBPDECODEBGRAINTO ) + if( HAVE_WEBP__WEBPGETINFO AND HAVE_WEBP__WEBPDECODEARGBINTO AND HAVE_WEBP__WEBPDECODEBGRAINTO ) + set( HAVE_WEBP 1 ) + endif( ) + endif( HAVE_WEBP_DECODE_H ) + endif( WEBP_FOUND ) + if ( HAVE_WEBP ) + set( WEBP_LIBRARIES webp ) + message( STATUS "WebP support enabled" ) + else ( NOT HAVE_WEBP ) + tde_message_fatal( "WebP support requested, but not found on your system" ) + endif( HAVE_WEBP) +endif( WITH_WEBP ) + + ##### check for openexr ######################### if( WITH_OPENEXR ) @@ -1021,6 +1102,16 @@ if( WITH_LIBBFD ) endif( NOT HAVE_LIBBFD ) set( LIBBFD_LIBRARIES bfd ) check_include_file( "demangle.h" HAVE_DEMANGLE_H ) + + tde_save_and_set( CMAKE_REQUIRED_LIBRARIES "${LIBBFD_LIBRARIES}" ) + check_c_source_compiles(" + #define PACKAGE tdelibs + #define PACKAGE_VERSION \"${TDE_VERSION}\" + #include <bfd.h> + int main() {bfd_section_flags((asection *)0); return 0;} " + HAVE_LIBBFD_2_34_API + ) + tde_restore( CMAKE_REQUIRED_LIBRARIES ) endif( WITH_LIBBFD ) @@ -1119,21 +1210,21 @@ if( WITH_ELFICON ) if( NOT LIBR_FOUND ) message(FATAL_ERROR "\nelficon support was requested, but libr was not found on your system" ) endif( NOT LIBR_FOUND ) - if( NOT "${LIBR_VERSION}" STREQUAL "0.6.0" ) + if( "${LIBR_VERSION}" VERSION_LESS "0.6" ) message(FATAL_ERROR "\nelficon support was requested, but the libr version on your system may not be compatible with TDE" ) - endif( NOT "${LIBR_VERSION}" STREQUAL "0.6.0" ) + endif( "${LIBR_VERSION}" VERSION_LESS "0.6" ) set( HAVE_ELFICON 1 ) endif( ) -##### check for pcre ########################### +##### check for pcre2 ########################### -if( WITH_PCRE ) - pkg_search_module( LIBPCRE libpcre ) - if( NOT LIBPCRE_FOUND ) - message(FATAL_ERROR "\npcre support are requested, but not found on your system" ) - endif( NOT LIBPCRE_FOUND ) - set( HAVE_PCREPOSIX 1 ) +if( WITH_PCRE2 ) + pkg_check_modules( LIBPCRE2 libpcre2-8 libpcre2-posix ) + if( NOT LIBPCRE2_FOUND ) + tde_message_fatal( "pcre2 support was requested, but not found on your system" ) + endif( ) + set( HAVE_PCRE2POSIX 1 ) endif( ) @@ -1196,15 +1287,48 @@ if( WITH_GAMIN ) endif( WITH_GAMIN ) +##### check for ispell ########################## + +if( WITH_ISPELL ) + if( NOT ISPELL_LIBDIR ) + find_program( ISPELL_EXECUTABLE NAMES ispell DOC "path to the ispell executable" ) + if( ISPELL_EXECUTABLE ) + execute_process ( + COMMAND ${ISPELL_EXECUTABLE} -vv + COMMAND awk "$1 == \"LIBDIR\" && $2 == \"=\" {gsub(/\"/, \"\", $3); print $3;}" + OUTPUT_VARIABLE ISPELL_LIBDIR + OUTPUT_STRIP_TRAILING_WHITESPACE) + if ( ISPELL_LIBDIR ) + set ( ISPELL_LIBDIR "${ISPELL_LIBDIR}" CACHE PATH "ispell lib directory contains dictionaries" ) + else ( ISPELL_LIBDIR ) + unset ( ISPELL_LIBDIR ) + endif ( ISPELL_LIBDIR ) + endif( ISPELL_EXECUTABLE ) + endif ( NOT ISPELL_LIBDIR ) +endif( WITH_ISPELL ) + + ##### check for aspell ########################## -# we need ASPELL_DATADIR too if( WITH_ASPELL ) find_package( ASPELL ) if( NOT ASPELL_FOUND ) message(FATAL_ERROR "\nASPELL support are requested, but not found on your system" ) endif( NOT ASPELL_FOUND ) + if( NOT ASPELL_DATADIR ) + find_program( PSPELL_CONFIG_EXECUTABLE NAMES pspell-config DOC "path to the pspell-config executable" ) + if( PSPELL_CONFIG_EXECUTABLE ) + execute_process ( + COMMAND ${PSPELL_CONFIG_EXECUTABLE} --pkgdatadir + OUTPUT_VARIABLE ASPELL_DATADIR + OUTPUT_STRIP_TRAILING_WHITESPACE) + endif( PSPELL_CONFIG_EXECUTABLE ) + endif( NOT ASPELL_DATADIR ) endif( WITH_ASPELL ) +if( NOT ASPELL_DATADIR ) + set ( ASPELL_DATADIR "/usr/lib/aspell" ) +endif( NOT ASPELL_DATADIR ) +set ( ASPELL_DATADIR "${ASPELL_DATADIR}" CACHE PATH "aspell data directory" ) ##### check for hspell ########################## @@ -1217,6 +1341,34 @@ if( WITH_HSPELL ) endif( WITH_HSPELL ) +####" default spell checker ##################### + +set( DEFAULT_SPELL_CHECKER "ISPELL" CACHE STRING "default spell checker" ) +if( NOT WITH_${DEFAULT_SPELL_CHECKER} ) + tde_message_fatal( "Spell checker selected as default (${DEFAULT_SPELL_CHECKER}) is not enabled to build." ) +endif() + + +#### Check for libnm ############################ + +if( WITH_NETWORK_MANAGER_BACKEND ) + pkg_search_module( LIBNM libnm ) + if( LIBNM_FOUND ) + pkg_get_variable( NM_VPN_SERVICE_DIR libnm vpnservicedir ) + endif( ) + if( "${NM_VPN_SERVICE_DIR}" STREQUAL "" ) + set( NM_VPN_SERVICE_DIR "/usr/lib/NetworkManager/VPN" ) + message( WARNING "NetworkManager support was requested, but the value for NM_VPN_SERVICE_DIR " + "couldn't be determined (either because NetworkManger or libnm's pkg-config " + "files are not installed or they don't declare it explicitly). " + "Falling back to the default value:\n" + " ${NM_VPN_SERVICE_DIR}\n" + "If the value doesn't suite your needs consider setting it manually by " + "passing \"-DNM_VPN_SERVICE_DIR=/path/to/your/NetworkManager/VPN\" to cmake." ) + endif( "${NM_VPN_SERVICE_DIR}" STREQUAL "" ) +endif( WITH_NETWORK_MANAGER_BACKEND ) + + ##### enable TDEIconLoader debugging ############ if ( WITH_TDEICONLOADER_DEBUG ) @@ -1224,11 +1376,45 @@ if ( WITH_TDEICONLOADER_DEBUG ) endif ( WITH_TDEICONLOADER_DEBUG ) +##### find tools path ########################### + +if( NOT WIN32 AND NOT ICEAUTH_PATH ) + find_program( ICEAUTH_PATH iceauth ) + if( ${ICEAUTH_PATH} STREQUAL "ICEAUTH_PATH-NOTFOUND" ) + tde_message_fatal( "iceauth command was not found in path." ) + endif() + message( STATUS "Found iceauth: ${ICEAUTH_PATH}" ) +endif( NOT WIN32 AND NOT ICEAUTH_PATH ) + + +##### find the rgb.txt file + +message( STATUS "Looking for rgb.txt" ) +find_file( PATH_RGB rgb.txt + PATHS + /usr/share/X11 + /usr/X11R6/lib/X11 + /usr/openwin/lib/X11 +) +if( PATH_RGB ) + message( STATUS "Found rgb.txt file: ${PATH_RGB}" ) + set( X11_RGBFILE "${PATH_RGB}" ) +endif() + + +##### Look for xmllint + +find_program( XMLLINT_EXE xmllint ) +if( XMLLINT_EXE ) + set( XMLLINT "${XMLLINT_EXE}" ) + message( STATUS "Found xmllint: ${XMLLINT}" ) +endif() + + ##### write configure files ##################### configure_file( config.h.cmake config.h ) -configure_file( dcop/dcop-path.h.cmake dcop/dcop-path.h ) -configure_file( tdecore/kdemacros.h.cmake tdecore/kdemacros.h ) +configure_file( tdecore/tdemacros.h.cmake tdecore/tdemacros.h ) configure_file( kjs/global.h.in kjs/global.h ) configure_file( tdeio/kssl/ksslconfig.h.cmake tdeio/kssl/ksslconfig.h ) configure_file( kdoctools/checkXML.cmake kdoctools/checkXML ) @@ -1236,10 +1422,15 @@ configure_file( kdoctools/checkXML.cmake kdoctools/checkXML ) ##### tools ##################################### -set( KDE3_DCOPIDL_EXECUTABLE ${CMAKE_BINARY_DIR}/dcop/dcopidl/dcopidl ) -set( KDE3_DCOPIDL2CPP_EXECUTABLE ${CMAKE_BINARY_DIR}/dcop/dcopidl2cpp/dcopidl2cpp ) -set( KDE3_MEINPROC_EXECUTABLE ${CMAKE_BINARY_DIR}/kdoctools/meinproc ) -set( KDE3_KCFGC_EXECUTABLE ${CMAKE_BINARY_DIR}/tdecore/tdeconfig_compiler/tdeconfig_compiler ) +set( KDE3_DCOPIDL_EXECUTABLE dcopidl ) +set( KDE3_DCOPIDLNG_EXECUTABLE + perl -I"${CMAKE_SOURCE_DIR}/dcop/dcopidlng" + "${CMAKE_SOURCE_DIR}/dcop/dcopidlng/kalyptus" + --allow_k_dcop_accessors -f dcopidl +) +set( KDE3_DCOPIDL2CPP_EXECUTABLE dcopidl2cpp ) +set( KDE3_MEINPROC_EXECUTABLE meinproc ) +set( KDE3_KCFGC_EXECUTABLE tdeconfig_compiler ) ##### global compiler settings ################## @@ -1315,6 +1506,7 @@ add_subdirectory( kate ) add_subdirectory( tdecert ) tde_conditional_add_subdirectory( WITH_XRANDR tderandr ) add_subdirectory( tdehtml ) +add_subdirectory( tdemarkdown ) add_subdirectory( tdecmshell ) add_subdirectory( tdeconf_update ) add_subdirectory( tdewidgets ) |
