summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandro Knauß <mail@sandroknauss.de>2015-02-19 11:32:58 (GMT)
committerSandro Knauß <mail@sandroknauss.de>2015-02-19 11:39:23 (GMT)
commit636c39e4f5767a088e477f563172afa843a9c593 (patch)
treedee3e1cb3842d31c498be6a7d4e335e4f9e241cf
parent085bd4803ea17d578f622565b8340ec54b0cfa24 (diff)
downloadlibkolab-636c39e4f5767a088e477f563172afa843a9c593.tar.gz
Move QT_DECLARE_METADATA logic to cmake
Because libcalendaring now also have versions that Q_DECLARE_METATYPE(KCalCore::Duration) already we make it explicit once within cmake and once inside libcalendaring.
-rw-r--r--CMakeLists.txt4
-rw-r--r--tests/testhelpers.h8
2 files changed, 6 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 365edac..831ad10 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -82,6 +82,10 @@ if("${KdepimLibs_VERSION}" VERSION_GREATER "4.8.40" OR USE_LIBCALENDARING)
add_definitions(-DKDEPIMLIBS_VERSION_DEVEL)
endif()
+if ("${KdepimLibs_VERSION}" VERSION_GREATER "4.11.52")
+ add_definitions( -DLIBCALENDARING_DURATION_DECLARED)
+endif()
+
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-common -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden -fexceptions -UQT_NO_EXCEPTIONS -fPIC -g" )
# message("${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DQT_NO_DEBUG")
diff --git a/tests/testhelpers.h b/tests/testhelpers.h
index f0e3889..822f9bc 100644
--- a/tests/testhelpers.h
+++ b/tests/testhelpers.h
@@ -45,12 +45,8 @@ Q_DECLARE_METATYPE(KCalCore::Event);
Q_DECLARE_METATYPE(KCalCore::Todo);
Q_DECLARE_METATYPE(KCalCore::Journal);
-#if KDEPIMLIBS_VERSION_MAJOR <= 4
-#if KDEPIMLIBS_VERSION_MINOR <= 11
-#if KDEPIMLIBS_VERSION_PATCH < 52
-Q_DECLARE_METATYPE(KCalCore::Duration);
-#endif
-#endif
+#ifndef LIBCALENDARING_DURATION_DECLARED
+ Q_DECLARE_METATYPE(KCalCore::Duration);
#endif
namespace QTest {