xmppbot/cmake/QXmpp.cmake

34 lines
1,018 B
CMake
Raw Normal View History

2021-04-30 21:10:28 +02:00
cmake_minimum_required(VERSION 3.7)
2021-05-01 22:26:41 +02:00
2021-04-30 21:10:28 +02:00
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Network Xml REQUIRED)
2021-05-01 22:26:41 +02:00
2021-04-30 21:10:28 +02:00
option(BUILD_SYSTEM_QXMPP "Build with system QXmpp Library" OFF)
if(BUILD_SYSTEM_QXMPP)
find_package(QXmpp)
if (QXmpp_FOUND)
get_target_property(QXmppLinkLibraries QXmpp::QXmpp INTERFACE_LINK_LIBRARIES)
if("${QXmppLinkLibraries}" MATCHES "Qt${QT_VERSION_MAJOR}")
if(QXmpp_VERSION VERSION_LESS "1.4.0")
set(CMAKE_CXX_STANDARD 11)
endif()
set(QXmppLibrary QXmpp::QXmpp)
else()
message(FATAL_ERROR "QXmpp Library incorrect Qt Version")
endif()
else()
message(FATAL_ERROR "QXmpp Library not found")
endif()
else()
project(qxmpp VERSION 1.4.0)
set(SO_VERSION 3)
set(QXmppLibrary qxmpp)
add_subdirectory(src/3rdparty/qxmpp/src)
endif()
2021-05-01 22:26:41 +02:00
add_definitions(
-DQT_DISABLE_DEPRECATED_BEFORE=0x050F00
-DQURL_NO_CAST_FROM_STRING
-DQT_NO_CAST_TO_ASCII
-DQT_NO_FOREACH
)