X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=CMakeLists.txt;h=fc2266599c0b42f813a8a75726da17e811e1b180;hp=8be041133a1bc42a40d8406ac156bf89b5c96c49;hb=6310438a4efce3d2ecbd5faf1d3ceebe0c6524c2;hpb=84cd3561e97167ffb98ecab0fd2b884ba1d13ada diff --git a/CMakeLists.txt b/CMakeLists.txt index 8be04113..fc226659 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,9 +11,9 @@ project(QuasselIRC) # Versions set(QUASSEL_MAJOR 0) -set(QUASSEL_MINOR 11) +set(QUASSEL_MINOR 12) set(QUASSEL_PATCH 0) -set(QUASSEL_VERSION_STRING "0.11-pre") +set(QUASSEL_VERSION_STRING "0.12-pre") # Tell CMake about or own modules set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) @@ -34,6 +34,11 @@ include(FeatureSummary) include(QuasselCompileSettings) include(QuasselMacros) +# Setting COMPILE_DEFINITIONS_ 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) + cmake_policy(SET CMP0043 OLD) +endif() # Options and variables that can be set on the command line ##################################################################### @@ -145,12 +150,18 @@ endif() # using -DCMAKE_DISABLE_FIND_PACKAGE_=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" @@ -188,6 +199,13 @@ if(USE_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 @@ -233,16 +251,23 @@ if(USE_QT5) DESCRIPTION "contains tools for handling translation files" PURPOSE "Required for having translations" ) - # Qt5 does not define a target for lconvert, so we need to find it ourselves + # Some Qt5 versions do not define a target for lconvert, so we need to find it ourselves if (Qt5LinguistTools_FOUND) if (NOT TARGET Qt5::lconvert AND TARGET Qt5::lrelease) get_target_property(_lrelease_location Qt5::lrelease LOCATION) get_filename_component(_lrelease_path ${_lrelease_location} PATH) find_program(QT_LCONVERT_EXECUTABLE NAMES lconvert-qt5 lconvert PATHS ${_lrelease_path} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + elseif(TARGET Qt5::lconvert AND NOT Qt5_LCONVERT_EXECUTABLE) + # Newer Qt5 versions define the target, but not the Qt5_LCONVERT_EXECUTABLE variable for some reason + get_target_property(QT_LCONVERT_EXECUTABLE Qt5::lconvert LOCATION) endif() + # Compatibility with the Qt4 variables - set (QT_LRELEASE_EXECUTABLE ${Qt5_LRELEASE_EXECUTABLE}) - set (QT_LUPDATE_EXECUTABLE ${Qt5_LUPDATE_EXECUTABLE}) + set(QT_LRELEASE_EXECUTABLE ${Qt5_LRELEASE_EXECUTABLE}) + set(QT_LUPDATE_EXECUTABLE ${Qt5_LUPDATE_EXECUTABLE}) + if (Qt5_LCONVERT_EXECUTABLE) + set(QT_LCONVERT_EXECUTABLE ${Qt5_LCONVERT_EXECUTABLE}) + endif() endif() else(USE_QT5) @@ -440,10 +465,14 @@ 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}") 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)