Fancify README with Markdown, build status, links
[quassel.git] / CMakeLists.txt
index dca7060..03ac969 100644 (file)
@@ -11,8 +11,8 @@ project(QuasselIRC)
 # Versions
 set(QUASSEL_MAJOR  0)
 set(QUASSEL_MINOR 12)
-set(QUASSEL_PATCH  2)
-set(QUASSEL_VERSION_STRING "0.12.2")
+set(QUASSEL_PATCH  4)
+set(QUASSEL_VERSION_STRING "0.12.4")
 
 # We want to know CMake's version for debug reasons
 message(STATUS "Using CMake ${CMAKE_VERSION}")
@@ -127,10 +127,15 @@ endif()
 
 # Setting COMPILE_DEFINITIONS_<CONFIG> is deprecated since CMake 3.0 in favor of generator expressions.
 # These have existed since CMake 2.8.10; until we depend on that, we have to explicitly enable the old policy.
-if (CMAKE_MAJOR_VERSION GREATER 2)
+if (POLICY CMP0043)
     cmake_policy(SET CMP0043 OLD)
 endif()
 
+# Honor visibility settings for all target types
+if (POLICY CMP0063)
+    cmake_policy(SET CMP0063 NEW)
+endif()
+
 
 # Simplify later checks
 #####################################################################
@@ -217,12 +222,21 @@ if (USE_QT5)
             PURPOSE     "Required for audio notifications"
         )
 
-        find_package(LibsnoreQt5 0.5.90 QUIET)
+        find_package(LibsnoreQt5 0.7.0 QUIET)
         set_package_properties(LibsnoreQt5 PROPERTIES TYPE OPTIONAL
-            URL "https://github.com/Snorenotify/Snorenotify"
+            URL "https://projects.kde.org/projects/playground/libs/snorenotify"
             DESCRIPTION "a cross-platform notification framework"
             PURPOSE     "Enable support for the snorenotify framework"
         )
+        if(LibsnoreQt5_FOUND)
+            find_package(LibsnoreSettingsQt5)
+            set_package_properties(LibsnoreSettingsQt5 PROPERTIES TYPE REQUIRED
+                URL "https://projects.kde.org/projects/playground/libs/snorenotify"
+                DESCRIPTION "a cross-platform notification framework"
+                PURPOSE     "Enable support for the snorenotify framework"
+            )
+        endif()
+
 
         if (WITH_WEBKIT)
             find_package(Qt5WebKit QUIET)
@@ -419,9 +433,14 @@ 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_OPENSSL || defined QT_NO_SSL
+    #if defined QT_NO_SSL
     #  error \"No SSL support\"
     #endif
     int main() {}"
@@ -563,6 +582,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)
@@ -578,6 +607,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)