diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 194 |
1 files changed, 168 insertions, 26 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b95cfa61..b0e0509f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ # ################################################# -cmake_minimum_required( VERSION 2.8 ) +cmake_minimum_required( VERSION 3.1 ) ##### general package setup ##################### @@ -17,7 +17,6 @@ cmake_minimum_required( VERSION 2.8 ) project( tdelibs ) set( PACKAGE tdelibs ) -set( VERSION R14.0.7 ) ##### include essential cmake modules ########### @@ -31,15 +30,20 @@ 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 ) +##### set version number ######################## + +tde_set_project_version( ) + + ##### setup and find essential stuff ############ tde_setup_paths( ) @@ -52,13 +56,41 @@ 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/") +if( "${CMAKE_VERSION}" VERSION_LESS "3.1" ) + set( CMAKE_ENV "env" ) +else() + set( CMAKE_ENV "${CMAKE_COMMAND};-E;env" ) +endif() -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( apidox + COMMAND ${CMAKE_ENV} + "QTDOCDIR=/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 ${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 #################### @@ -75,6 +107,7 @@ 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} ) @@ -105,6 +138,7 @@ 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} ) @@ -312,7 +346,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 ) @@ -330,7 +364,18 @@ 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 ) + endif () +endif () check_cxx_source_compiles( "#include <cxxabi.h> int main() { abi::__cxa_demangle(0, 0, 0, 0); return 0; }" HAVE_ABI_CXA_DEMANGLE ) @@ -345,7 +390,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,6 +425,7 @@ 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 ) @@ -406,6 +452,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 ) @@ -416,9 +463,9 @@ check_function_exists( sendfile HAVE_SENDFILE ) 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 ) check_function_exists( dlerror HAVE_DLERROR ) if( NOT HAVE_DLERROR ) @@ -443,7 +490,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 ) @@ -457,7 +503,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(" @@ -503,6 +555,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> @@ -589,6 +643,7 @@ if( NOT HAVE_LIBDL ) set( HAVE_LIBDL 1 ) endif( HAVE_DLOPEN ) endif( NOT HAVE_LIBDL ) +check_library_exists( dld, dld_link "" HAVE_DLD ) ##### check for magic ########################### @@ -951,7 +1006,7 @@ if( WITH_SSL ) check_library_exists( ssl SSL_library_init "" HAVE_LIBSSL ) endif( ) check_library_exists( crypto EVP_EncryptInit_ex "" HAVE_LIBCRYPTO ) - if( HAVE_OPENSSL_H AND (HAVE_LIBSSL_11 OR HAVEL_LIBSSL) AND HAVE_LIBCRYPTO ) + if( HAVE_OPENSSL_H AND (HAVE_LIBSSL_11 OR HAVE_LIBSSL) AND HAVE_LIBCRYPTO ) set( SSL_FOUND 1 CACHE INTERNAL "" FORCE ) find_file( OPENSSLV_H openssl/opensslv.h ) file( STRINGS "${OPENSSLV_H}" SSL_VERSION REGEX "#[ \t]*define[ \t]*OPENSSL_VERSION_TEXT" ) @@ -959,7 +1014,7 @@ if( WITH_SSL ) SSL_VERSION "${SSL_VERSION}" ) set( SSL_VERSION "${SSL_VERSION}" CACHE INTERNAL "" FORCE ) message( STATUS "Found OpenSSL: version ${SSL_VERSION}" ) - endif( HAVE_OPENSSL_H AND (HAVE_LIBSSL_11 OR HAVEL_LIBSSL) AND HAVE_LIBCRYPTO ) + endif( HAVE_OPENSSL_H AND (HAVE_LIBSSL_11 OR HAVE_LIBSSL) AND HAVE_LIBCRYPTO ) endif( NOT SSL_FOUND ) if( NOT SSL_FOUND ) tde_message_fatal( "SSL support is requested, but openssl not found on your system" ) @@ -1112,15 +1167,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 ########################## @@ -1133,6 +1221,14 @@ 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() + + ##### enable TDEIconLoader debugging ############ if ( WITH_TDEICONLOADER_DEBUG ) @@ -1140,10 +1236,44 @@ 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( kjs/global.h.in kjs/global.h ) configure_file( tdeio/kssl/ksslconfig.h.cmake tdeio/kssl/ksslconfig.h ) @@ -1152,10 +1282,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 ################## @@ -1187,16 +1322,22 @@ configure_file( tdelibs.pc.cmake tdelibs.pc @ONLY ) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/tdelibs.pc DESTINATION ${PKGCONFIG_INSTALL_DIR} ) +##### read source metadata ###################### + +set( TDE_VERSION "${TDE_RELEASE_NUM}" ) +tde_read_src_metadata() + + ##### subdirectories ############################ +if( WITH_ELFICON ) + add_subdirectory( tdelfeditor ) +endif( WITH_ELFICON ) add_subdirectory( dcop ) add_subdirectory( libltdl ) add_subdirectory( kglib ) add_subdirectory( tdefx ) add_subdirectory( tdecore ) -if( WITH_ELFICON ) - add_subdirectory( tdelfeditor ) -endif( WITH_ELFICON ) add_subdirectory( tdeunittest ) add_subdirectory( tdeui ) add_subdirectory( tdesu ) @@ -1225,6 +1366,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 ) |