X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=CMakeLists.txt;h=38733c637dbe886c66f42e537cd79e94c14c4105;hp=f5ca78035d6e8466e5d80a628a4235ed761daa60;hb=b60e07cf184dc374b135489c4d5ec7db1e5f3651;hpb=441d136436d670f520ab351dd8fbf97363de713b diff --git a/CMakeLists.txt b/CMakeLists.txt index f5ca7803..38733c63 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -215,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" @@ -438,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 @@ -580,7 +594,17 @@ endif() include(GetGitRevisionDescription) get_git_head_revision(GIT_REFSPEC GIT_HEAD) -git_describe(GIT_DESCRIBE --long --dirty) +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 @@ -597,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)