diff options
Diffstat (limited to 'modules/FindKDE4Internal.cmake')
-rw-r--r-- | modules/FindKDE4Internal.cmake | 85 |
1 files changed, 52 insertions, 33 deletions
diff --git a/modules/FindKDE4Internal.cmake b/modules/FindKDE4Internal.cmake index 94297f9d..b5a9bb5a 100644 --- a/modules/FindKDE4Internal.cmake +++ b/modules/FindKDE4Internal.cmake @@ -41,8 +41,7 @@ # KDE4_KNOTIFYCONFIG_LIBRARY- the knotifyconfig library # KDE4_KROSSCORE_LIBRARY - the krosscore library # KDE4_KTEXTEDITOR_LIBRARY - the ktexteditor library -# KDE4_KNEPOMUK_LIBRARY - the knepomuk library -# KDE4_KMETADATA_LIBRARY - the kmetadata library +# KDE4_NEPOMUK_LIBRARY - the nepomuk library # KDE4_PLASMA_LIBRARY - the plasma library # # KDE4_PLASMA_OPENGL_FOUND - TRUE if the OpenGL support of Plasma has been found, NOTFOUND otherwise @@ -72,8 +71,7 @@ # KDE4_KROSSCORE_LIBS - the kross core library and all depending libraries # KDE4_KROSSUI_LIBS - the kross ui library which includes core and all depending libraries # KDE4_KTEXTEDITOR_LIBS - the ktexteditor library and all depending libraries -# KDE4_KNEPOMUK_LIBS - the knepomuk library and all depending libraries -# KDE4_KMETADATA_LIBS - the kmetadata library and all depending libraries +# KDE4_NEPOMUK_LIBS - the nepomuk library and all depending libraries # KDE4_PLASMA_LIBS - the plasma library and all depending librairies # # This module defines a bunch of variables used as locations for install directories. @@ -204,11 +202,11 @@ # # A note on the possible values for CMAKE_BUILD_TYPE and how KDE handles # the flags for those buildtypes. FindKDE4Internal supports the values -# Debug, Release, RelWithDebInfo, Profile and Debugfull +# Debug, Release, RelWithDebInfo, Profile and Debugfull: # # Release # optimised for speed, qDebug/kDebug turned off, no debug symbols -# Release with debug info +# RelWithDebInfo (Release with debug info) # optimised for speed, debugging symbols on (-g) # Debug # optimised but debuggable, debugging on (-g) @@ -286,7 +284,7 @@ else(KDE4_FIND_REQUIRED OR KDE4Internal_FIND_REQUIRED) set(_REQ_STRING_KDE4_MESSAGE "STATUS") endif(KDE4_FIND_REQUIRED OR KDE4Internal_FIND_REQUIRED) -set(QT_MIN_VERSION "4.4.0") +set(QT_MIN_VERSION "4.5.0") #this line includes FindQt4.cmake, which searches the Qt library and headers find_package(Qt4 ${_REQ_STRING_KDE4}) @@ -298,13 +296,24 @@ if (NOT AUTOMOC4_VERSION) # the version macro was added for 0.9.84 set(AUTOMOC4_VERSION "0.9.83") endif (NOT AUTOMOC4_VERSION) -macro_ensure_version("0.9.87" "${AUTOMOC4_VERSION}" _automoc4_version_ok) +set(_automoc4_min_version "0.9.88") +macro_ensure_version("${_automoc4_min_version}" "${AUTOMOC4_VERSION}" _automoc4_version_ok) # for compatibility with KDE 4.0.x set(KDE4_AUTOMOC_EXECUTABLE "${AUTOMOC4_EXECUTABLE}" ) -# Perl is required for building KDE software -find_package(Perl ${_REQ_STRING_KDE4}) +# Perl is not required for building KDE software, but we had that here since 4.0 +find_package(Perl) +if(NOT PERL_FOUND) + message(STATUS "Perl not found") +endif(NOT PERL_FOUND) + + +# we check for Phonon not here, but further below, i.e. after KDELibsDependencies.cmake +# has been loaded, which helps in the case that phonon is installed to the same +# directory as kdelibs. +# find_package(Phonon ${_REQ_STRING_KDE4}) + # Check that we really found everything. # If KDE4 was searched with REQUIRED, we error out with FATAL_ERROR if something wasn't found @@ -312,13 +321,9 @@ find_package(Perl ${_REQ_STRING_KDE4}) # If KDE4 was searched without REQUIRED and something in the FIND_PACKAGE() calls above wasn't found, # then we get here and must check that everything has actually been found. If something is missing, # we must not fail with FATAL_ERROR, but only not set KDE4_FOUND. -if(NOT PERL_FOUND) - message(STATUS "KDE4 not found, because Perl not found") - return() -endif(NOT PERL_FOUND) if(NOT QT4_FOUND) - message(STATUS "KDE4 not found, because Qt4 not found") + message(STATUS "KDE4 not found, because Qt4 was not found") return() endif(NOT QT4_FOUND) @@ -328,7 +333,7 @@ if(NOT AUTOMOC4_FOUND OR NOT _automoc4_version_ok) return() else(NOT AUTOMOC4_FOUND) if(NOT _automoc4_version_ok) - message(${_REQ_STRING_KDE4_MESSAGE} "Your version of automoc4 is too old. You have ${AUTOMOC4_VERSION}, you need at least 0.9.87") + message(${_REQ_STRING_KDE4_MESSAGE} "Your version of automoc4 is too old. You have ${AUTOMOC4_VERSION}, you need at least ${_automoc4_min_version}") return() endif(NOT _automoc4_version_ok) endif(NOT AUTOMOC4_FOUND) @@ -371,6 +376,7 @@ if (_kdeBootStrapping) set(KDE4_SOLID_LIBS ${KDE4_KDECORE_LIBS} solid) set(KDE4_KFILE_LIBS ${KDE4_KIO_LIBS} kfile) set(KDE4_KHTML_LIBS ${KDE4_KPARTS_LIBS} khtml) + set(KDE4_KTEXTEDITOR_LIBS ktexteditor) set(EXECUTABLE_OUTPUT_PATH ${kdelibs_BINARY_DIR}/bin ) @@ -482,13 +488,9 @@ else (_kdeBootStrapping) endif (UNIX) # these targets do not always exist, since they are built conditionally: - if(TARGET ${KDE4_TARGET_PREFIX}knepomuk) - _kde4_set_lib_variables(KNEPOMUK knepomuk ${KDE4_TARGET_PREFIX}) - endif(TARGET ${KDE4_TARGET_PREFIX}knepomuk) - - if(TARGET ${KDE4_TARGET_PREFIX}kmetadata) - _kde4_set_lib_variables(KMETADATA kmetadata ${KDE4_TARGET_PREFIX}) - endif(TARGET ${KDE4_TARGET_PREFIX}kmetadata) + if(TARGET ${KDE4_TARGET_PREFIX}nepomuk) + _kde4_set_lib_variables(NEPOMUK nepomuk ${KDE4_TARGET_PREFIX}) + endif(TARGET ${KDE4_TARGET_PREFIX}nepomuk) # and this one for compatibility: set(KDE4_THREADWEAVER_LIBRARIES ${KDE4_TARGET_PREFIX}threadweaver ) @@ -540,6 +542,25 @@ else (_kdeBootStrapping) endif (_kdeBootStrapping) + +################### try to find Phonon ############################################ + +# we do this here instead of above together with the checks for Perl etc. +# since FindPhonon.cmake also uses ${KDE4_LIB_INSTALL_DIR} to check for Phonon, +# which helps with finding the phonon installed as part of kdesupport: + +# only make Phonon REQUIRED if KDE4 itself is REQUIRED +find_package(Phonon ${_REQ_STRING_KDE4}) +set(KDE4_PHONON_LIBRARY ${PHONON_LIBRARY}) +set(KDE4_PHONON_LIBS ${PHONON_LIBS}) +set(KDE4_PHONON_INCLUDES ${PHONON_INCLUDES}) + +if(NOT PHONON_FOUND) + message(STATUS "KDE4 not found, because Phonon was not found") + return() +endif(NOT PHONON_FOUND) + + ##################### provide some options ########################################## option(KDE4_ENABLE_FINAL "Enable final all-in-one compilation") @@ -801,7 +822,7 @@ if (WIN32) # windows, microsoft compiler if(MSVC) - set( _KDE4_PLATFORM_DEFINITIONS -DKDE_FULL_TEMPLATE_EXPORT_INSTANTIATION -DWIN32_LEAN_AND_MEAN -DUNICODE ) + set( _KDE4_PLATFORM_DEFINITIONS -DKDE_FULL_TEMPLATE_EXPORT_INSTANTIATION -DWIN32_LEAN_AND_MEAN ) # C4250: 'class1' : inherits 'class2::member' via dominance set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4250" ) # C4251: 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2' @@ -826,6 +847,9 @@ if (WIN32) set(CMAKE_MSVCIDE_RUN_PATH "${PERL_PATH_WINDOWS}\;${QT_BIN_DIR_WINDOWS}" CACHE STATIC "MSVC IDE Run path" FORCE) endif(MSVC_IDE) + + # we don't support anything below w2k and all winapi calls are unicodes + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=0x0501 -D_WIN32_IE=0x0501 -DUNICODE" ) endif (WIN32) @@ -967,12 +991,12 @@ endif(MSVC) if (CMAKE_COMPILER_IS_GNUCXX) set (KDE4_ENABLE_EXCEPTIONS -fexceptions) # Select flags. - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG -DQT_NO_DEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG -DQT_NO_DEBUG") set(CMAKE_CXX_FLAGS_DEBUG "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline") set(CMAKE_CXX_FLAGS_DEBUGFULL "-g3 -fno-inline") set(CMAKE_CXX_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs") - set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG -DQT_NO_DEBUG") set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG -DQT_NO_DEBUG") set(CMAKE_C_FLAGS_DEBUG "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline") set(CMAKE_C_FLAGS_DEBUGFULL "-g3 -fno-inline") @@ -1115,13 +1139,13 @@ macro (KDE4_PRINT_RESULTS) # inside kdelibs the include dir and lib dir are internal, not "found" if (NOT _kdeBootStrapping) if(KDE4_INCLUDE_DIR) - message(STATUS "Found KDE 4.2 include dir: ${KDE4_INCLUDE_DIR}") + message(STATUS "Found KDE 4.3 include dir: ${KDE4_INCLUDE_DIR}") else(KDE4_INCLUDE_DIR) message(STATUS "ERROR: unable to find the KDE 4 headers") endif(KDE4_INCLUDE_DIR) if(KDE4_LIB_DIR) - message(STATUS "Found KDE 4.2 library dir: ${KDE4_LIB_DIR}") + message(STATUS "Found KDE 4.3 library dir: ${KDE4_LIB_DIR}") else(KDE4_LIB_DIR) message(STATUS "ERROR: unable to find the KDE 4 core library") endif(KDE4_LIB_DIR) @@ -1155,11 +1179,6 @@ if (KDE4Internal_FIND_REQUIRED AND NOT KDE4_FOUND) message(FATAL_ERROR "ERROR: could NOT find everything required for compiling KDE 4 programs") endif (KDE4Internal_FIND_REQUIRED AND NOT KDE4_FOUND) -find_package(Phonon REQUIRED) -set(KDE4_PHONON_LIBRARY ${PHONON_LIBRARY}) -set(KDE4_PHONON_LIBS ${PHONON_LIBS}) -set(KDE4_PHONON_INCLUDES ${PHONON_INCLUDES}) - if (NOT KDE4Internal_FIND_QUIETLY) kde4_print_results() endif (NOT KDE4Internal_FIND_QUIETLY) |