aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kde-modules/KDECMakeSettings.cmake3
-rw-r--r--kde-modules/KDECompilerSettings.cmake8
-rw-r--r--kde-modules/KDEFrameworkCompilerSettings.cmake5
3 files changed, 15 insertions, 1 deletions
diff --git a/kde-modules/KDECMakeSettings.cmake b/kde-modules/KDECMakeSettings.cmake
index c2786c1a..dd37e7f1 100644
--- a/kde-modules/KDECMakeSettings.cmake
+++ b/kde-modules/KDECMakeSettings.cmake
@@ -5,6 +5,9 @@
# Changes various CMake settings to what the KDE community views as more
# sensible defaults.
#
+# It is recommended to include this module with the NO_POLICY_SCOPE flag,
+# otherwise you may get spurious warnings with some versions of CMake.
+#
# It is split into three parts, which can be independently disabled if desired.
#
# Runtime Paths
diff --git a/kde-modules/KDECompilerSettings.cmake b/kde-modules/KDECompilerSettings.cmake
index 707e5d7d..6cecefd1 100644
--- a/kde-modules/KDECompilerSettings.cmake
+++ b/kde-modules/KDECompilerSettings.cmake
@@ -9,6 +9,9 @@
# kde_target_enable_exceptions() can be used to re-enable them for a
# specific target.
#
+# NB: it is recommended to include this module with the NO_POLICY_SCOPE
+# flag, otherwise you may get spurious warnings with some versions of CMake.
+#
# This module provides the following functions::
#
# kde_source_files_enable_exceptions([file1 [file2 [...]]])
@@ -199,6 +202,11 @@ endif()
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
+if (POLICY CMP0063)
+ # No sane project should be affected by CMP0063, so suppress the warnings
+ # generated by the above visibility settings in CMake >= 3.3
+ cmake_policy(SET CMP0063 NEW)
+endif()
if (UNIX AND NOT APPLE)
# Enable adding DT_RUNPATH, which means that LD_LIBRARY_PATH takes precedence
diff --git a/kde-modules/KDEFrameworkCompilerSettings.cmake b/kde-modules/KDEFrameworkCompilerSettings.cmake
index 55ab36cf..e41003d6 100644
--- a/kde-modules/KDEFrameworkCompilerSettings.cmake
+++ b/kde-modules/KDEFrameworkCompilerSettings.cmake
@@ -12,6 +12,9 @@
# forcing the use of QLatin1String or QStringLiteral, and some
# Qt-defined keywords like signals and slots will not be defined.
#
+# NB: it is recommended to include this module with the NO_POLICY_SCOPE
+# flag, otherwise you may get spurious warnings with some versions of CMake.
+#
# Since pre-1.0.0.
#=============================================================================
@@ -30,7 +33,7 @@
# (To distribute this file outside of extra-cmake-modules, substitute the full
# License text for the above reference.)
-include(KDECompilerSettings)
+include(KDECompilerSettings NO_POLICY_SCOPE)
add_definitions(-DQT_NO_CAST_TO_ASCII
-DQT_NO_CAST_FROM_ASCII