X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=CMakeLists.txt;h=38733c637dbe886c66f42e537cd79e94c14c4105;hp=046b66d88b4fb1a3e461cc3d63603b7dba53072c;hb=680565f39c50f27cc339cb3e96bbd0abc6f47144;hpb=0b4b7c1cc23a915aa42b1d60bf00f047639f1279 diff --git a/CMakeLists.txt b/CMakeLists.txt index 046b66d8..38733c63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,6 +131,11 @@ if (CMAKE_MAJOR_VERSION GREATER 2) cmake_policy(SET CMP0043 OLD) endif() +# Honor visibility settings for all target types +if (CMAKE_VERSION VERSION_GREATER 3.3) + cmake_policy(SET CMP0063 NEW) +endif() + # Simplify later checks ##################################################################### @@ -210,13 +215,22 @@ if (USE_QT5) ) endif() - find_package(Phonon4Qt5 QUIET) - set_package_properties(Phonon4Qt5 PROPERTIES TYPE RECOMMENDED - URL "https://projects.kde.org/projects/kdesupport/phonon" - DESCRIPTION "a multimedia abstraction library" + find_package(Qt5Multimedia QUIET) + set_package_properties(Qt5Multimedia PROPERTIES TYPE RECOMMENDED + URL "http://qt.digia.com" + DESCRIPTION "Multimedia support for Qt5" PURPOSE "Required for audio notifications" ) + if (NOT Qt5Multimedia_FOUND) + find_package(Phonon4Qt5 QUIET) + set_package_properties(Phonon4Qt5 PROPERTIES TYPE RECOMMENDED + URL "https://projects.kde.org/projects/kdesupport/phonon" + DESCRIPTION "a multimedia abstraction library" + PURPOSE "Required for audio notifications" + ) + endif() + find_package(LibsnoreQt5 0.7.0 QUIET) set_package_properties(LibsnoreQt5 PROPERTIES TYPE OPTIONAL URL "https://projects.kde.org/projects/playground/libs/snorenotify" @@ -231,7 +245,7 @@ if (USE_QT5) PURPOSE "Enable support for the snorenotify framework" ) endif() - + if (WITH_WEBKIT) find_package(Qt5WebKit QUIET) @@ -275,17 +289,22 @@ if (USE_QT5) if (ECM_FOUND) list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) - endif() - - if (WITH_KDE) - find_package(KF5 COMPONENTS ConfigWidgets CoreAddons Notifications NotifyConfig TextWidgets WidgetsAddons XmlGui QUIET) - set_package_properties(KF5 PROPERTIES TYPE REQUIRED - URL "http://www.kde.org" - DESCRIPTION "KDE Frameworks" - PURPOSE "Required for integration into the Plasma desktop" - ) - - endif() + if (WITH_KDE) + find_package(KF5 COMPONENTS ConfigWidgets CoreAddons Notifications NotifyConfig TextWidgets WidgetsAddons XmlGui QUIET) + set_package_properties(KF5 PROPERTIES TYPE REQUIRED + URL "http://www.kde.org" + DESCRIPTION "KDE Frameworks" + PURPOSE "Required for integration into the Plasma desktop" + ) + else(WITH_KDE) + find_package(KF5Sonnet QUIET) + set_package_properties(KF5Sonnet PROPERTIES TYPE RECOMMENDED + URL "http://api.kde.org/frameworks-api/frameworks5-apidocs/sonnet/html" + DESCRIPTION "framework for providing spell-checking capabilities" + PURPOSE "Enables spell-checking support in input widgets" + ) + endif(WITH_KDE) + endif(ECM_FOUND) endif(BUILD_GUI) @@ -428,6 +447,11 @@ endif() cmake_push_check_state(RESET) set(CMAKE_REQUIRED_INCLUDES ${QT_INCLUDES} ${Qt5Core_INCLUDE_DIRS}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") + +if (USE_QT5 AND Qt5_POSITION_INDEPENDENT_CODE) + set(CMAKE_REQUIRED_FLAGS "-fPIC -DQT_NO_VERSION_TAGGING") +endif() + check_cxx_source_compiles(" #include \"qglobal.h\" #if defined QT_NO_SSL @@ -572,6 +596,16 @@ include(GetGitRevisionDescription) get_git_head_revision(GIT_REFSPEC GIT_HEAD) git_describe(GIT_DESCRIBE --long) +# If in a Git repo we can get the commit-date from a git command +if (GIT_HEAD) + execute_process( + COMMAND git show -s --format=%ct + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE GIT_COMMIT_DATE + OUTPUT_STRIP_TRAILING_WHITESPACE + ) +endif() + # If not in a Git repo try to read GIT_HEAD and GIT_DESCRIBE from # enviroment if (NOT GIT_HEAD OR NOT GIT_DESCRIBE) @@ -587,6 +621,7 @@ endif() if (NOT GIT_HEAD OR NOT GIT_DESCRIBE) set(GIT_HEAD "") set(GIT_DESCRIBE "") + set(GIT_COMMIT_DATE 0) endif() configure_file(version.h.in ${CMAKE_BINARY_DIR}/version.h @ONLY)