# using -DCMAKE_DISABLE_FIND_PACKAGE_<PkgName>=TRUE
#####################################################################
-if(USE_QT5)
+if (USE_QT5)
find_package(Qt5Core ${QT_MIN_VERSION} QUIET)
set_package_properties(Qt5Core PROPERTIES TYPE REQUIRED
URL "http://qt.digia.com"
DESCRIPTION "contains core functionality for Qt"
)
+ # find_package without REQUIRED won't check for the version properly; also, older Qt5 versions
+ # used Qt5Core_VERSION_STRING... let's just make sure here that we bail out here if our Qt5 is not new enough.
+ if (NOT Qt5Core_VERSION OR Qt5Core_VERSION VERSION_LESS ${QT_MIN_VERSION})
+ message(FATAL_ERROR "Could NOT find Qt5 >= version ${QT_MIN_VERSION}!")
+ endif()
+
find_package(Qt5Network QUIET)
set_package_properties(Qt5Network PROPERTIES TYPE REQUIRED
DESCRIPTION "the network module for Qt5"
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)
- set_package_properties(Qt5Webkit PROPERTIES TYPE RECOMMENDED
+ find_package(Qt5WebKit QUIET)
+ set_package_properties(Qt5WebKit PROPERTIES TYPE RECOMMENDED
URL "http://qt.digia.com"
- DESCRIPTION "a Webkit implementation for Qt"
+ DESCRIPTION "a WebKit implementation for Qt"
PURPOSE "Needed for displaying previews for URLs in chat"
)
+ if (Qt5WebKit_FOUND)
+ find_package(Qt5WebKitWidgets QUIET)
+ set_package_properties(Qt5WebKitWidgets PROPERTIES TYPE RECOMMENDED
+ URL "http://qt.digia.com"
+ DESCRIPTION "widgets for Qt's WebKit implementation"
+ PURPOSE "Needed for displaying previews for URLs in chat"
+ )
+ endif()
endif()
- add_feature_info("WITH_WEBKIT and QtWebkit module" Qt5Webkit_FOUND "Support showing previews for URLs in chat")
+ add_feature_info("WITH_WEBKIT, QtWebKit and QtWebKitWidgets modules" Qt5WebKitWidgets_FOUND "Support showing previews for URLs in chat")
endif(BUILD_GUI)
if (BUILD_CORE)
if (WITH_WEBKIT AND QT_QTWEBKIT_FOUND)
set(HAVE_WEBKIT true)
endif()
- add_feature_info("WITH_WEBKIT and QtWebkit module" HAVE_WEBKIT "Support showing previews for URLs in chat")
+ add_feature_info("WITH_WEBKIT and QtWebKit module" HAVE_WEBKIT "Support showing previews for URLs in chat")
if (WITH_KDE)
# KDE has overzealous CFLAGS making miniz not compile, so save our old flags
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}")
link_libraries(Version dwmapi shlwapi)
+ if(USE_QT5)
+ set(QT_QTMAIN_LIBRARY Qt5::WinMain)
+ endif(USE_QT5)
endif(MSVC)
if(HAVE_SSL AND STATIC)
find_package(OpenSSL REQUIRED)