Fix building with Qt5 on MSVC by undefining min/max macros
[quassel.git] / CMakeLists.txt
index 8be0411..3033e60 100644 (file)
@@ -187,6 +187,13 @@ if(USE_QT5)
             DESCRIPTION "a multimedia abstraction library"
             PURPOSE     "Required for audio notifications"
         )
+        
+        find_package(LibsnoreQt5 QUIET)
+        set_package_properties(LibsnoreQt5 PROPERTIES TYPE OPTIONAL
+            URL "https://github.com/TheOneRing/Snorenotify"
+            DESCRIPTION "a cross-platform notification framework"
+            PURPOSE     "Enable support for the snorenotify framework"
+        )
 
         if (WITH_WEBKIT)
             find_package(Qt5WebKit QUIET)
@@ -440,6 +447,7 @@ endif(STATIC AND CMAKE_COMPILER_IS_GNUCXX)
 if(WIN32)
   link_libraries(imm32 winmm dbghelp Secur32)  # missing by default :/
   if(MSVC)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /DNOMINMAX")
     set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBUGINFO "/debug /INCREMENTAL:YES /NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt")
     set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/debug /INCREMENTAL:YES /NODEFAULTLIB:libcmt")
     set(CMAKE_EXE_LINKER_FLAGS_DEBUGFULL "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")