Warning, /graphics/kphotoalbum/cmake/modules/MarbleChecks.cmake is written in an unsupported language. File is not indexed.
0001 # SPDX-FileCopyrightText: 2018 Johannes Zarl-Zierl <johannes@zarl-zierl.at> 0002 # 0003 # SPDX-License-Identifier: BSD-3-Clause 0004 0005 0006 ############################### 0007 # Explanation: 0008 # Marble changed the signature of the MarbleWidget::regionSelected signal in v18.03.80 from: 0009 # regionSelected(const QList<double>&) 0010 # to: 0011 # regionSelected(const Marble::GeoDataLatLonBox &) 0012 # [see https://commits.kde.org/marble/ec1f7f554e9f6ca248b4a3b01dbf08507870687e] 0013 # 0014 # These feature checks are necessary, because MARBLE_VERSION was not changed in 0015 # the release and we are left without a way to just check the version of 0016 # marble. 0017 # 0018 # Note: as you can see, the checks exploit the fact that signals are actually just methods, 0019 # and that one can "call" a signal. A more elaborate check that connects the signal to a 0020 # custom class fails because check_cxx_source_compiles does not play well with the MOC. 0021 0022 include(CheckCXXSourceCompiles) 0023 0024 set(CMAKE_REQUIRED_LIBRARIES Marble Qt5::Widgets) 0025 0026 # Marble 17.12.3 0027 check_cxx_source_compiles( 0028 "#include <QList>\n\ 0029 #include <marble/MarbleWidget.h>\n\ 0030 int main() {\n\ 0031 Marble::MarbleWidget mw;\n\ 0032 QList<double> arg;\n\ 0033 mw.regionSelected(arg);\n\ 0034 return 0;\n\ 0035 }" 0036 MARBLE_HAS_regionSelected_OLD 0037 ) 0038 0039 # Marble 18.03.80 0040 check_cxx_source_compiles( 0041 "#include <marble/GeoDataLatLonBox.h>\n\ 0042 #include <marble/MarbleWidget.h>\n\ 0043 int main() {\n\ 0044 Marble::MarbleWidget mw;\n\ 0045 Marble::GeoDataLatLonBox arg;\n\ 0046 mw.regionSelected(arg);\n\ 0047 return 0;\n\ 0048 }" 0049 MARBLE_HAS_regionSelected_NEW 0050 ) 0051 0052 if(MARBLE_HAS_regionSelected_OLD AND MARBLE_HAS_regionSelected_NEW) 0053 message(AUTHOR_WARNING "Both old and new style for Marble::MarbleWidget::regionSelected are valid!") 0054 endif() 0055 0056 if(NOT MARBLE_HAS_regionSelected_OLD AND NOT MARBLE_HAS_regionSelected_NEW) 0057 message(SEND_ERROR "No suitable signature for Marble::MarbleWidget::regionSelected! Please file a bug report against kphotoalbum!") 0058 endif() 0059 # vi:expandtab:tabstop=4 shiftwidth=4: