summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2012-06-26 11:00:53 (GMT)
committerChristian Mollekopf <chrigi_1@fastmail.fm>2012-06-26 11:00:53 (GMT)
commiteafcbe460fa64cf8bd3cddd54e2288a2ef4e7b42 (patch)
tree1621e4d5526f62faf495fdd98d34c68f0debbc35
parent4744a3b71c936ca714cf417b51881174f565ab62 (diff)
downloadlibcalendaring-eafcbe460fa64cf8bd3cddd54e2288a2ef4e7b42.tar.gz
kdecore cmake files
-rw-r--r--kdecore/cmake/modules-tests/AGG/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/Blitz/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/BlueZ/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/ENCHANT/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/Eigen2/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/FFmpeg/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/Flac/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/Flex/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/GObject/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/GStreamer/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/LCMS/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/LibArt/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/LibXslt/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/OpenEXR/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/PCRE/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/QCA2/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/QImageBlitz/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/RunAllModuleTests.cmake59
-rw-r--r--kdecore/cmake/modules-tests/Sqlite/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/Strigi/CMakeLists.txt17
-rw-r--r--kdecore/cmake/modules-tests/TestFindPackage.cmake44
-rw-r--r--kdecore/cmake/modules-tests/USB/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/Xine/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/Xmms/CMakeLists.txt5
-rw-r--r--kdecore/cmake/modules-tests/readme.txt6
-rw-r--r--kdecore/cmake/modules/BasicFindPackageVersion.cmake.in30
-rw-r--r--kdecore/cmake/modules/CMakeLists.txt186
-rw-r--r--kdecore/cmake/modules/CMakeParseArguments.cmake132
-rw-r--r--kdecore/cmake/modules/COPYING-CMAKE-SCRIPTS22
-rw-r--r--kdecore/cmake/modules/CheckCXXSourceCompiles.cmake68
-rw-r--r--kdecore/cmake/modules/CheckCXXSourceRuns.cmake81
-rw-r--r--kdecore/cmake/modules/CheckCXXSymbolExists.cmake71
-rw-r--r--kdecore/cmake/modules/CheckPointerMember.cmake42
-rw-r--r--kdecore/cmake/modules/CheckPrototypeExists.cmake41
-rw-r--r--kdecore/cmake/modules/CheckStructMember.cmake42
-rw-r--r--kdecore/cmake/modules/FindACL.cmake36
-rw-r--r--kdecore/cmake/modules/FindAGG.cmake53
-rw-r--r--kdecore/cmake/modules/FindAkode.cmake52
-rw-r--r--kdecore/cmake/modules/FindAlsa.cmake69
-rw-r--r--kdecore/cmake/modules/FindAutomoc4.cmake49
-rw-r--r--kdecore/cmake/modules/FindAvahi.cmake15
-rw-r--r--kdecore/cmake/modules/FindBerkeleyDB.cmake25
-rw-r--r--kdecore/cmake/modules/FindBlitz.cmake55
-rw-r--r--kdecore/cmake/modules/FindBlueZ.cmake51
-rw-r--r--kdecore/cmake/modules/FindBoost.cmake25
-rw-r--r--kdecore/cmake/modules/FindCarbon.cmake22
-rw-r--r--kdecore/cmake/modules/FindDBusMenuQt.cmake94
-rw-r--r--kdecore/cmake/modules/FindDNSSD.cmake48
-rw-r--r--kdecore/cmake/modules/FindDocBookXML.cmake67
-rw-r--r--kdecore/cmake/modules/FindDocBookXSL.cmake52
-rw-r--r--kdecore/cmake/modules/FindENCHANT.cmake44
-rw-r--r--kdecore/cmake/modules/FindEigen.cmake24
-rw-r--r--kdecore/cmake/modules/FindEigen2.cmake55
-rw-r--r--kdecore/cmake/modules/FindExiv2.cmake80
-rw-r--r--kdecore/cmake/modules/FindFAM.cmake22
-rw-r--r--kdecore/cmake/modules/FindFFmpeg.cmake148
-rw-r--r--kdecore/cmake/modules/FindFlac.cmake34
-rw-r--r--kdecore/cmake/modules/FindFlex.cmake35
-rw-r--r--kdecore/cmake/modules/FindFontconfig.cmake50
-rw-r--r--kdecore/cmake/modules/FindFreetype.cmake73
-rw-r--r--kdecore/cmake/modules/FindGIF.cmake39
-rw-r--r--kdecore/cmake/modules/FindGLIB2.cmake52
-rw-r--r--kdecore/cmake/modules/FindGMP.cmake23
-rw-r--r--kdecore/cmake/modules/FindGObject.cmake52
-rw-r--r--kdecore/cmake/modules/FindGSSAPI.cmake78
-rw-r--r--kdecore/cmake/modules/FindGStreamer.cmake80
-rw-r--r--kdecore/cmake/modules/FindGettext.cmake246
-rw-r--r--kdecore/cmake/modules/FindGphoto2.cmake60
-rw-r--r--kdecore/cmake/modules/FindHUNSPELL.cmake25
-rw-r--r--kdecore/cmake/modules/FindHUpnp.cmake31
-rw-r--r--kdecore/cmake/modules/FindIOKit.cmake23
-rw-r--r--kdecore/cmake/modules/FindKDE4Internal.cmake1422
-rw-r--r--kdecore/cmake/modules/FindKDE4Workspace.cmake71
-rw-r--r--kdecore/cmake/modules/FindKDevPlatform.cmake45
-rw-r--r--kdecore/cmake/modules/FindKNepomuk.cmake39
-rw-r--r--kdecore/cmake/modules/FindKdcraw.cmake124
-rw-r--r--kdecore/cmake/modules/FindKdeMultimedia.cmake48
-rw-r--r--kdecore/cmake/modules/FindKdepim.cmake3
-rw-r--r--kdecore/cmake/modules/FindKdepimLibs.cmake84
-rw-r--r--kdecore/cmake/modules/FindKexiv2.cmake123
-rw-r--r--kdecore/cmake/modules/FindKipi.cmake116
-rw-r--r--kdecore/cmake/modules/FindKonto.cmake38
-rw-r--r--kdecore/cmake/modules/FindKopete.cmake87
-rw-r--r--kdecore/cmake/modules/FindKorundum.cmake20
-rw-r--r--kdecore/cmake/modules/FindLCMS.cmake60
-rw-r--r--kdecore/cmake/modules/FindLibArt.cmake63
-rw-r--r--kdecore/cmake/modules/FindLibAttica.cmake63
-rw-r--r--kdecore/cmake/modules/FindLibKonq.cmake22
-rw-r--r--kdecore/cmake/modules/FindLibLZMA.cmake45
-rw-r--r--kdecore/cmake/modules/FindLibPython.py13
-rw-r--r--kdecore/cmake/modules/FindLibXml2.cmake58
-rw-r--r--kdecore/cmake/modules/FindLibXslt.cmake72
-rw-r--r--kdecore/cmake/modules/FindLibintl.cmake46
-rw-r--r--kdecore/cmake/modules/FindLibraryWithDebug.cmake113
-rw-r--r--kdecore/cmake/modules/FindLinuxWirelesstools.cmake29
-rw-r--r--kdecore/cmake/modules/FindMsgfmt.cmake28
-rw-r--r--kdecore/cmake/modules/FindMusicBrainz.cmake32
-rw-r--r--kdecore/cmake/modules/FindMySQL.cmake140
-rw-r--r--kdecore/cmake/modules/FindNepomuk.cmake96
-rw-r--r--kdecore/cmake/modules/FindNetworkManager.cmake42
-rw-r--r--kdecore/cmake/modules/FindOggVorbis.cmake76
-rw-r--r--kdecore/cmake/modules/FindOpenEXR.cmake104
-rw-r--r--kdecore/cmake/modules/FindOpenSSL.cmake63
-rw-r--r--kdecore/cmake/modules/FindPCRE.cmake44
-rw-r--r--kdecore/cmake/modules/FindPackageHandleStandardArgs.cmake210
-rw-r--r--kdecore/cmake/modules/FindPhonon.cmake37
-rw-r--r--kdecore/cmake/modules/FindPkgConfig.cmake377
-rw-r--r--kdecore/cmake/modules/FindPlasma.cmake20
-rw-r--r--kdecore/cmake/modules/FindPolkitQt-1.cmake37
-rw-r--r--kdecore/cmake/modules/FindPolkitQt.cmake94
-rw-r--r--kdecore/cmake/modules/FindPopplerQt4.cmake53
-rw-r--r--kdecore/cmake/modules/FindPostgreSQL.cmake33
-rw-r--r--kdecore/cmake/modules/FindPulseAudio.cmake71
-rw-r--r--kdecore/cmake/modules/FindPyKDE4.cmake185
-rw-r--r--kdecore/cmake/modules/FindPyKDE4.py46
-rw-r--r--kdecore/cmake/modules/FindPyQt.py24
-rw-r--r--kdecore/cmake/modules/FindPyQt4.cmake53
-rw-r--r--kdecore/cmake/modules/FindPythonLibrary.cmake106
-rw-r--r--kdecore/cmake/modules/FindQCA2.cmake48
-rw-r--r--kdecore/cmake/modules/FindQImageBlitz.cmake51
-rw-r--r--kdecore/cmake/modules/FindQt4.cmake1272
-rw-r--r--kdecore/cmake/modules/FindRUBY.cmake89
-rw-r--r--kdecore/cmake/modules/FindSIP.cmake60
-rw-r--r--kdecore/cmake/modules/FindSIP.py15
-rw-r--r--kdecore/cmake/modules/FindSamba.cmake62
-rw-r--r--kdecore/cmake/modules/FindSane.cmake21
-rw-r--r--kdecore/cmake/modules/FindSasl2.cmake26
-rw-r--r--kdecore/cmake/modules/FindSharedDesktopOntologies.cmake42
-rw-r--r--kdecore/cmake/modules/FindSharedMimeInfo.cmake78
-rw-r--r--kdecore/cmake/modules/FindSoprano.cmake245
-rw-r--r--kdecore/cmake/modules/FindSqlite.cmake50
-rw-r--r--kdecore/cmake/modules/FindStrigi.cmake148
-rw-r--r--kdecore/cmake/modules/FindTaglib.cmake85
-rw-r--r--kdecore/cmake/modules/FindUDev.cmake19
-rw-r--r--kdecore/cmake/modules/FindUSB.cmake30
-rw-r--r--kdecore/cmake/modules/FindWcecompat.cmake25
-rw-r--r--kdecore/cmake/modules/FindX11.cmake455
-rw-r--r--kdecore/cmake/modules/FindXKB.cmake15
-rw-r--r--kdecore/cmake/modules/FindXine.cmake77
-rw-r--r--kdecore/cmake/modules/FindXmms.cmake44
-rw-r--r--kdecore/cmake/modules/HandleImportedTargetsInCMakeRequiredLibraries.cmake85
-rw-r--r--kdecore/cmake/modules/KDE4Defaults.cmake43
-rw-r--r--kdecore/cmake/modules/KDE4Macros.cmake1341
-rw-r--r--kdecore/cmake/modules/MacroAddCompileFlags.cmake19
-rw-r--r--kdecore/cmake/modules/MacroAddLinkFlags.cmake18
-rw-r--r--kdecore/cmake/modules/MacroAdditionalCleanFiles.cmake21
-rw-r--r--kdecore/cmake/modules/MacroAppendIf.cmake22
-rw-r--r--kdecore/cmake/modules/MacroBoolTo01.cmake20
-rw-r--r--kdecore/cmake/modules/MacroEnsureOutOfSourceBuild.cmake20
-rw-r--r--kdecore/cmake/modules/MacroEnsureVersion.cmake117
-rw-r--r--kdecore/cmake/modules/MacroKAuth.cmake3
-rw-r--r--kdecore/cmake/modules/MacroLibrary.cmake19
-rw-r--r--kdecore/cmake/modules/MacroLogFeature.cmake157
-rw-r--r--kdecore/cmake/modules/MacroOptionalAddSubdirectory.cmake41
-rw-r--r--kdecore/cmake/modules/MacroOptionalDependPackage.cmake22
-rw-r--r--kdecore/cmake/modules/MacroOptionalFindPackage.cmake48
-rw-r--r--kdecore/cmake/modules/MacroPushRequiredVars.cmake47
-rw-r--r--kdecore/cmake/modules/MacroWriteBasicCMakeVersionFile.cmake22
-rw-r--r--kdecore/cmake/modules/NepomukAddOntologyClasses.cmake115
-rw-r--r--kdecore/cmake/modules/NepomukMacros.cmake67
-rw-r--r--kdecore/cmake/modules/PythonCompile.py4
-rw-r--r--kdecore/cmake/modules/PythonMacros.cmake62
-rw-r--r--kdecore/cmake/modules/Qt4ConfigDependentSettings.cmake384
-rw-r--r--kdecore/cmake/modules/Qt4Macros.cmake414
-rw-r--r--kdecore/cmake/modules/README19
-rw-r--r--kdecore/cmake/modules/SIPMacros.cmake124
-rw-r--r--kdecore/cmake/modules/Win32.Manifest.in10
-rw-r--r--kdecore/cmake/modules/Win32Macros.cmake47
-rw-r--r--kdecore/cmake/modules/check_installed_exports_file.cmake73
-rw-r--r--kdecore/cmake/modules/cmake-modules-styleguide.txt115
-rw-r--r--kdecore/cmake/modules/config-alsa.h.cmake34
-rw-r--r--kdecore/cmake/modules/create_exe_symlink.cmake16
-rw-r--r--kdecore/cmake/modules/kde4_cmake_uninstall.cmake.in22
-rw-r--r--kdecore/cmake/modules/kde4_exec_via_sh.cmake31
-rw-r--r--kdecore/cmake/modules/kde4automoc.files.in4
-rw-r--r--kdecore/cmake/modules/kde4exportsheader.h.in12
-rw-r--r--kdecore/cmake/modules/kde4init_dummy.cpp.in3
-rw-r--r--kdecore/cmake/modules/kde4init_win32lib_dummy.cpp.in5
-rw-r--r--kdecore/cmake/modules/kde4uic.cmake56
-rw-r--r--kdecore/cmake/systeminfo/CMakeLists.txt45
-rw-r--r--kdecore/cmake/systeminfo/README6
181 files changed, 14398 insertions, 0 deletions
diff --git a/kdecore/cmake/modules-tests/AGG/CMakeLists.txt b/kdecore/cmake/modules-tests/AGG/CMakeLists.txt
new file mode 100644
index 0000000..3d0e7b9
--- /dev/null
+++ b/kdecore/cmake/modules-tests/AGG/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(AGG AGG INCLUDE_DIR LIBRARIES DEFINITIONS)
diff --git a/kdecore/cmake/modules-tests/Blitz/CMakeLists.txt b/kdecore/cmake/modules-tests/Blitz/CMakeLists.txt
new file mode 100644
index 0000000..ef81e4d
--- /dev/null
+++ b/kdecore/cmake/modules-tests/Blitz/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(Blitz BLITZ INCLUDES LIBRARIES)
diff --git a/kdecore/cmake/modules-tests/BlueZ/CMakeLists.txt b/kdecore/cmake/modules-tests/BlueZ/CMakeLists.txt
new file mode 100644
index 0000000..bfc1770
--- /dev/null
+++ b/kdecore/cmake/modules-tests/BlueZ/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(BlueZ BLUEZ INCLUDE_DIR LIBRARIES DEFINITIONS)
diff --git a/kdecore/cmake/modules-tests/ENCHANT/CMakeLists.txt b/kdecore/cmake/modules-tests/ENCHANT/CMakeLists.txt
new file mode 100644
index 0000000..6ed9e51
--- /dev/null
+++ b/kdecore/cmake/modules-tests/ENCHANT/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(ENCHANT ENCHANT INCLUDE_DIR LIBRARIES DEFINITIONS)
diff --git a/kdecore/cmake/modules-tests/Eigen2/CMakeLists.txt b/kdecore/cmake/modules-tests/Eigen2/CMakeLists.txt
new file mode 100644
index 0000000..b2ae0d3
--- /dev/null
+++ b/kdecore/cmake/modules-tests/Eigen2/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(Eigen2 EIGEN2 INCLUDE_DIR )
diff --git a/kdecore/cmake/modules-tests/FFmpeg/CMakeLists.txt b/kdecore/cmake/modules-tests/FFmpeg/CMakeLists.txt
new file mode 100644
index 0000000..4c93079
--- /dev/null
+++ b/kdecore/cmake/modules-tests/FFmpeg/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(FFmpeg FFMPEG INCLUDE_DIR LIBRARIES DEFINITIONS)
diff --git a/kdecore/cmake/modules-tests/Flac/CMakeLists.txt b/kdecore/cmake/modules-tests/Flac/CMakeLists.txt
new file mode 100644
index 0000000..604f2dd
--- /dev/null
+++ b/kdecore/cmake/modules-tests/Flac/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(Flac FLAC INCLUDE_DIR LIBRARIES OGGFLAC_LIBRARIES)
diff --git a/kdecore/cmake/modules-tests/Flex/CMakeLists.txt b/kdecore/cmake/modules-tests/Flex/CMakeLists.txt
new file mode 100644
index 0000000..38b6656
--- /dev/null
+++ b/kdecore/cmake/modules-tests/Flex/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(Flex FLEX VERSION EXECUTABLE)
diff --git a/kdecore/cmake/modules-tests/GObject/CMakeLists.txt b/kdecore/cmake/modules-tests/GObject/CMakeLists.txt
new file mode 100644
index 0000000..971a20b
--- /dev/null
+++ b/kdecore/cmake/modules-tests/GObject/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(GObject GOBJECT INCLUDE_DIR LIBRARIES DEFINITIONS)
diff --git a/kdecore/cmake/modules-tests/GStreamer/CMakeLists.txt b/kdecore/cmake/modules-tests/GStreamer/CMakeLists.txt
new file mode 100644
index 0000000..896a853
--- /dev/null
+++ b/kdecore/cmake/modules-tests/GStreamer/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(GStreamer GSTREAMER INCLUDE_DIR LIBRARIES DEFINITIONS)
diff --git a/kdecore/cmake/modules-tests/LCMS/CMakeLists.txt b/kdecore/cmake/modules-tests/LCMS/CMakeLists.txt
new file mode 100644
index 0000000..43a9042
--- /dev/null
+++ b/kdecore/cmake/modules-tests/LCMS/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(LCMS LCMS INCLUDE_DIR LIBRARIES VERSION)
diff --git a/kdecore/cmake/modules-tests/LibArt/CMakeLists.txt b/kdecore/cmake/modules-tests/LibArt/CMakeLists.txt
new file mode 100644
index 0000000..e64d231
--- /dev/null
+++ b/kdecore/cmake/modules-tests/LibArt/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(LibArt LIBART INCLUDE_DIR LIBRARIES)
diff --git a/kdecore/cmake/modules-tests/LibXslt/CMakeLists.txt b/kdecore/cmake/modules-tests/LibXslt/CMakeLists.txt
new file mode 100644
index 0000000..561a693
--- /dev/null
+++ b/kdecore/cmake/modules-tests/LibXslt/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(LibXslt LIBXSLT INCLUDE_DIR LIBRARIES DEFINITIONS XSLTPROC_EXECUTABLE)
diff --git a/kdecore/cmake/modules-tests/OpenEXR/CMakeLists.txt b/kdecore/cmake/modules-tests/OpenEXR/CMakeLists.txt
new file mode 100644
index 0000000..dd33dab
--- /dev/null
+++ b/kdecore/cmake/modules-tests/OpenEXR/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(OpenEXR OPENEXR INCLUDE_DIR LIBRARIES DEFINITIONS)
diff --git a/kdecore/cmake/modules-tests/PCRE/CMakeLists.txt b/kdecore/cmake/modules-tests/PCRE/CMakeLists.txt
new file mode 100644
index 0000000..928806d
--- /dev/null
+++ b/kdecore/cmake/modules-tests/PCRE/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(PCRE PCRE INCLUDE_DIR LIBRARIES)
diff --git a/kdecore/cmake/modules-tests/QCA2/CMakeLists.txt b/kdecore/cmake/modules-tests/QCA2/CMakeLists.txt
new file mode 100644
index 0000000..46f617e
--- /dev/null
+++ b/kdecore/cmake/modules-tests/QCA2/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(QCA2 QCA2 INCLUDE_DIR LIBRARIES DEFINITIONS)
diff --git a/kdecore/cmake/modules-tests/QImageBlitz/CMakeLists.txt b/kdecore/cmake/modules-tests/QImageBlitz/CMakeLists.txt
new file mode 100644
index 0000000..12edb3f
--- /dev/null
+++ b/kdecore/cmake/modules-tests/QImageBlitz/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(QImageBlitz QIMAGEBLITZ INCLUDES LIBRARIES)
diff --git a/kdecore/cmake/modules-tests/RunAllModuleTests.cmake b/kdecore/cmake/modules-tests/RunAllModuleTests.cmake
new file mode 100644
index 0000000..d68f61f
--- /dev/null
+++ b/kdecore/cmake/modules-tests/RunAllModuleTests.cmake
@@ -0,0 +1,59 @@
+# Run this script via "cmake -P RunAllModuletests.cmake" to
+# execute all module tests in one go.
+# Run this script with "cmake -DMODULE=foo -P RunAllModuletests.cmake" to
+# test only the one specified module.
+# To see only the results and not the other cmake output,
+# you can grep for "::".
+# To have it delete the previous test build dirs, run it with -DCLEAN_DIRS=TRUE
+
+get_filename_component(currentDir "${CMAKE_CURRENT_LIST_FILE}" PATH)
+
+function(execute_one_test name)
+ set(workingDir "${currentDir}/${name}/build")
+ if(CLEAN_DIRS)
+ file(REMOVE_RECURSE "${workingDir}")
+ endif(CLEAN_DIRS)
+ file(MAKE_DIRECTORY "${workingDir}")
+ execute_process(COMMAND ${CMAKE_COMMAND} "${currentDir}/${name}"
+ WORKING_DIRECTORY "${workingDir}")
+ # now the same with pkg-config disabled
+ set(workingDir "${currentDir}/${name}/build-no-pkgconfig")
+ if(CLEAN_DIRS)
+ file(REMOVE_RECURSE "${workingDir}")
+ endif(CLEAN_DIRS)
+ file(MAKE_DIRECTORY "${workingDir}")
+ execute_process(COMMAND ${CMAKE_COMMAND} -DPKG_CONFIG_EXECUTABLE=echo "${currentDir}/${name}"
+ WORKING_DIRECTORY "${workingDir}")
+endfunction(execute_one_test)
+
+if(DEFINED MODULE)
+ set(modulesToTest ${MODULE})
+else(DEFINED MODULE)
+ set(modulesToTest AGG
+ Blitz
+ BlueZ
+ ENCHANT
+ Eigen2
+ FFmpeg
+ Flac
+ Flex
+ GObject
+ GStreamer
+ LCMS
+ LibArt
+ LibXslt
+ OpenEXR
+ PCRE
+ QCA2
+ QImageBlitz
+ Sqlite
+ Strigi
+ USB
+ Xine
+ Xmms)
+endif(DEFINED MODULE)
+
+foreach(currentModule ${modulesToTest})
+ execute_one_test(${currentModule})
+endforeach(currentModule ${modulesToTest})
+
diff --git a/kdecore/cmake/modules-tests/Sqlite/CMakeLists.txt b/kdecore/cmake/modules-tests/Sqlite/CMakeLists.txt
new file mode 100644
index 0000000..000be42
--- /dev/null
+++ b/kdecore/cmake/modules-tests/Sqlite/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(Sqlite SQLITE INCLUDE_DIR LIBRARIES DEFINITIONS)
diff --git a/kdecore/cmake/modules-tests/Strigi/CMakeLists.txt b/kdecore/cmake/modules-tests/Strigi/CMakeLists.txt
new file mode 100644
index 0000000..bbe1e23
--- /dev/null
+++ b/kdecore/cmake/modules-tests/Strigi/CMakeLists.txt
@@ -0,0 +1,17 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+set(STRIGI_MIN_VERSION 0.6.0)
+
+#find_package(Strigi 1.2.3)
+
+test_find_package(Strigi STRIGI VERSION
+ INCLUDE_DIR
+ STREAMANALYZER_LIBRARY
+ STREAMS_LIBRARY
+ STRIGIQTDBUSCLIENT_LIBRARY
+ NEEDS_SIGNED_CHAR
+ NEEDS_CHAR
+ LINE_ANALYZER_PREFIX
+ THROUGH_ANALYZER_PREFIX )
diff --git a/kdecore/cmake/modules-tests/TestFindPackage.cmake b/kdecore/cmake/modules-tests/TestFindPackage.cmake
new file mode 100644
index 0000000..8de22b0
--- /dev/null
+++ b/kdecore/cmake/modules-tests/TestFindPackage.cmake
@@ -0,0 +1,44 @@
+# This module provides the macro TEST_FIND_PACKAGE()
+#
+# TEST_FIND_PACKAGE(package prefix var1 .. varN )
+# It can be used to test a CMake Find-module.
+# It executes FIND_PACKAGE(<package>) and then prints some results.
+# <package> is the same as for FIND_PACKAGE() and
+# prefix should be the prefix which is used in that module for
+# all variables.
+# It checks <prefix>_FOUND to decide whether the module was successful or not.
+#
+# Example:
+# test_find_package(Xine XINE VERSION INCLUDE_DIR LIBRARY)
+#
+# This will check XINE_FOUND and then print the variables XINE_VERSION, XINE_INCLUDE_DIR and XINE_LIBRARY.
+
+cmake_minimum_required(VERSION 2.6.2)
+cmake_policy(SET CMP0000 OLD)
+
+macro(TEST_FIND_PACKAGE package prefix )
+ # if PKG_CONFIG_EXECUTABLE is set to "echo", FindPkgConfig.cmake
+ # will not search again for the real pkg-config, as it would if it was set to NOTFOUND
+ # and still the execute_process(${PKG_CONFIG_EXECUTABLE} ) calls will work
+ # but never return success.
+ if("${PKG_CONFIG_EXECUTABLE}" STREQUAL "echo")
+ message(STATUS ":: ***** Testing Find${package}.cmake, with pkg-config disabled *****")
+ else("${PKG_CONFIG_EXECUTABLE}" STREQUAL "echo")
+ message(STATUS ":: ***** Testing Find${package}.cmake *****")
+ endif("${PKG_CONFIG_EXECUTABLE}" STREQUAL "echo")
+
+ find_package(${package})
+ message(STATUS ":: ***** Results from Find${package}.cmake *****")
+
+ if ( ${prefix}_FOUND)
+ message(STATUS ":: Find${package}.cmake: ${package} has been found")
+ else ( ${prefix}_FOUND)
+ message(STATUS ":: Find${package}.cmake: ${package} has NOT been found !")
+ endif ( ${prefix}_FOUND)
+
+ message(STATUS ":: ${prefix}_FOUND: \"${${prefix}_FOUND}\"")
+ foreach(var ${ARGN})
+ message(STATUS ":: ${prefix}_${var}: \"${${prefix}_${var}}\"")
+ endforeach(var)
+ message(STATUS "::")
+endmacro(TEST_FIND_PACKAGE package)
diff --git a/kdecore/cmake/modules-tests/USB/CMakeLists.txt b/kdecore/cmake/modules-tests/USB/CMakeLists.txt
new file mode 100644
index 0000000..37f9dd2
--- /dev/null
+++ b/kdecore/cmake/modules-tests/USB/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(USB LIBUSB INCLUDE_DIR LIBRARIES)
diff --git a/kdecore/cmake/modules-tests/Xine/CMakeLists.txt b/kdecore/cmake/modules-tests/Xine/CMakeLists.txt
new file mode 100644
index 0000000..8c2ac6e
--- /dev/null
+++ b/kdecore/cmake/modules-tests/Xine/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(Xine XINE VERSION BUGFIX_VERSION INCLUDE_DIR LIBRARY XCB_FOUND)
diff --git a/kdecore/cmake/modules-tests/Xmms/CMakeLists.txt b/kdecore/cmake/modules-tests/Xmms/CMakeLists.txt
new file mode 100644
index 0000000..c55e6a4
--- /dev/null
+++ b/kdecore/cmake/modules-tests/Xmms/CMakeLists.txt
@@ -0,0 +1,5 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/../TestFindPackage.cmake")
+
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../modules" )
+
+test_find_package(Xmms XMMS INCLUDE_DIR LIBRARIES )
diff --git a/kdecore/cmake/modules-tests/readme.txt b/kdecore/cmake/modules-tests/readme.txt
new file mode 100644
index 0000000..2fabc9b
--- /dev/null
+++ b/kdecore/cmake/modules-tests/readme.txt
@@ -0,0 +1,6 @@
+in each of the subdirs here is a simple CMakeLists.txt which does a very
+basic test for one of the cmake modules in the modules/ directory.
+To run them, create a build directory, run cmake and check the output.
+(yes, this can of course be enhanced, but it's better than nothing).
+
+Alex
diff --git a/kdecore/cmake/modules/BasicFindPackageVersion.cmake.in b/kdecore/cmake/modules/BasicFindPackageVersion.cmake.in
new file mode 100644
index 0000000..ae5d312
--- /dev/null
+++ b/kdecore/cmake/modules/BasicFindPackageVersion.cmake.in
@@ -0,0 +1,30 @@
+# This is a very basic file for the new style find_package() search mode,
+# i.e. Config-mode. It is used by MACRO_WRITE_BASIC_CMAKE_VERSION_FILE() from
+# MacroWriteBasicCMakeVersionFile.cmake.
+# In this mode find_package() searches for a <package>Config.cmake
+# file and an associated <package>Version.cmake file, which it loads to check
+# the version number.
+# This file can be used with configure_file() to generate such a file for a project
+# with very basic logic.
+# It sets PACKAGE_VERSION_EXACT if the current version string and the requested
+# version string are exactly the same and it sets PACKAGE_VERSION_COMPATIBLE
+# if the current version is >= requested version.
+# If this is not good enough for your project, you need to write your own
+# improved <package>Version.cmake file.
+# This file requires the following three variables to be set:
+# PROJECT_VERSION_MAJOR
+# PROJECT_VERSION_MINOR
+# PROJECT_VERSION_PATCH
+
+
+set(PACKAGE_VERSION @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@)
+
+if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
+else("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
+ if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}")
+ set(PACKAGE_VERSION_EXACT TRUE)
+ endif( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}")
+endif("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
+
diff --git a/kdecore/cmake/modules/CMakeLists.txt b/kdecore/cmake/modules/CMakeLists.txt
new file mode 100644
index 0000000..44b18b4
--- /dev/null
+++ b/kdecore/cmake/modules/CMakeLists.txt
@@ -0,0 +1,186 @@
+## install the cmake files
+
+set(module_install_dir ${DATA_INSTALL_DIR}/cmake/modules )
+
+# maybe FindHUNSPELL.cmake doesn't have to be installed ?
+# This variable doesn't actually do anything, but it's probably a good idea
+# to have it around, so there is a place where the modules which are not installed
+# are listed explicitely:
+set(cmakeFilesDontInstall
+ FindHUpnp.cmake
+ FindPolkitQt.cmake
+ FindPolkitQt-1.cmake
+ FindUDev.cmake
+ )
+
+# Explicitely list all files which will be installed.
+# We don't use a GLOB anymore so we can have also cmake files here
+# which are used inside kdelibs, but which don't have to be installed (and
+# so become part of the public interface of kdelibs which has to be kept
+# compatible).
+set(cmakeFiles CheckCXXSourceCompiles.cmake
+ CheckCXXSourceRuns.cmake
+ CheckCXXSymbolExists.cmake
+ CheckPointerMember.cmake
+ CheckPrototypeExists.cmake
+ CheckStructMember.cmake
+ FindACL.cmake
+ FindAGG.cmake
+ FindAkode.cmake
+ FindAlsa.cmake
+ FindAutomoc4.cmake
+ FindAvahi.cmake
+ FindBerkeleyDB.cmake
+ FindBlitz.cmake
+ FindBlueZ.cmake
+ FindBoost.cmake
+ FindCarbon.cmake
+ FindDBusMenuQt.cmake
+ FindDNSSD.cmake
+ FindENCHANT.cmake
+ FindEigen.cmake
+ FindEigen2.cmake
+ FindExiv2.cmake
+ FindFAM.cmake
+ FindFFmpeg.cmake
+ FindFlac.cmake
+ FindFlex.cmake
+ FindFontconfig.cmake
+ FindFreetype.cmake
+ FindGIF.cmake
+ FindGLIB2.cmake
+ FindGMP.cmake
+ FindGObject.cmake
+ FindGSSAPI.cmake
+ FindGStreamer.cmake
+ FindGettext.cmake
+ FindGphoto2.cmake
+ FindHUNSPELL.cmake
+ FindIOKit.cmake
+ FindKDE4Internal.cmake
+ FindKDE4Workspace.cmake
+ FindKDevPlatform.cmake
+ FindKdcraw.cmake
+ FindKdeMultimedia.cmake
+ FindKdepim.cmake
+ FindKdepimLibs.cmake
+ FindKexiv2.cmake
+ FindKipi.cmake
+ FindKopete.cmake
+ FindKorundum.cmake
+ FindLCMS.cmake
+ FindLibArt.cmake
+ FindLibAttica.cmake
+ FindLibKonq.cmake
+ FindLibLZMA.cmake
+ FindLibXml2.cmake
+ FindLibXslt.cmake
+ FindLibintl.cmake
+ FindLibraryWithDebug.cmake
+ FindLinuxWirelesstools.cmake
+ FindMsgfmt.cmake
+ FindMusicBrainz.cmake
+ FindMySQL.cmake
+ FindNepomuk.cmake
+ FindNetworkManager.cmake
+ FindOggVorbis.cmake
+ FindOpenEXR.cmake
+ FindOpenSSL.cmake
+ FindPCRE.cmake
+ FindPhonon.cmake
+ FindPkgConfig.cmake
+ FindPlasma.cmake
+ FindPopplerQt4.cmake
+ FindPostgreSQL.cmake
+ FindPulseAudio.cmake
+ FindPyKDE4.cmake
+ FindPyQt4.cmake
+ Qt4Macros.cmake
+ Qt4ConfigDependentSettings.cmake
+ FindPackageHandleStandardArgs.cmake
+ CMakeParseArguments.cmake # used by FindPackageHandleStandardArgs.cmake, will be in CMake 2.8.3
+ FindPythonLibrary.cmake
+ FindQCA2.cmake
+ FindQImageBlitz.cmake
+ FindQt4.cmake
+ FindRUBY.cmake
+ FindSIP.cmake
+ FindSamba.cmake
+ FindSane.cmake
+ FindSasl2.cmake
+ FindSharedMimeInfo.cmake
+ FindSharedDesktopOntologies.cmake
+ FindSoprano.cmake
+ FindSqlite.cmake
+ FindStrigi.cmake
+ FindTaglib.cmake
+ FindUSB.cmake
+ FindWcecompat.cmake
+ FindX11.cmake
+ FindXKB.cmake
+ FindXine.cmake
+ FindXmms.cmake
+ HandleImportedTargetsInCMakeRequiredLibraries.cmake
+ KDE4Defaults.cmake
+ KDE4Macros.cmake
+ MacroAddCompileFlags.cmake
+ MacroAddLinkFlags.cmake
+ MacroAdditionalCleanFiles.cmake
+ MacroAppendIf.cmake
+ MacroBoolTo01.cmake
+ MacroEnsureOutOfSourceBuild.cmake
+ MacroEnsureVersion.cmake
+ MacroKAuth.cmake
+ MacroLibrary.cmake
+ MacroLogFeature.cmake
+ MacroOptionalAddSubdirectory.cmake
+ MacroOptionalDependPackage.cmake
+ MacroOptionalFindPackage.cmake
+ MacroPushRequiredVars.cmake
+ MacroWriteBasicCMakeVersionFile.cmake
+ NepomukMacros.cmake
+ NepomukAddOntologyClasses.cmake
+ PythonMacros.cmake
+ SIPMacros.cmake
+ Win32Macros.cmake
+ check_installed_exports_file.cmake
+ config-alsa.h.cmake
+ create_exe_symlink.cmake
+ kde4_exec_via_sh.cmake
+ kde4uic.cmake
+ cmake-modules-styleguide.txt
+ kde4init_dummy.cpp.in
+ kde4init_win32lib_dummy.cpp.in
+ kde4_cmake_uninstall.cmake.in
+ kde4automoc.files.in
+ BasicFindPackageVersion.cmake.in
+ FindLibPython.py
+ FindPyKDE4.py
+ FindPyQt.py
+ FindSIP.py
+ PythonCompile.py
+ )
+
+if (KDE4_ENABLE_UAC_MANIFEST)
+ set(cmakeFiles ${cmakeFiles} Win32.Manifest.in )
+endif (KDE4_ENABLE_UAC_MANIFEST)
+
+install(FILES ${cmakeFiles}
+ DESTINATION ${module_install_dir} )
+
+
+# the files listed here will be removed by remove_obsoleted_cmake_files.cmake, Alex
+#set(FILES_TO_REMOVE
+#)
+
+#install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/remove_files.cmake )
+
+#file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/remove_files.cmake "#generated by cmake, dont edit\n\n")
+#foreach ( _current_FILE ${FILES_TO_REMOVE})
+# file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/remove_files.cmake "message(STATUS \"Removing ${_current_FILE}\" )\n" )
+# file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/remove_files.cmake "exec_program( ${CMAKE_COMMAND} ARGS -E remove ${_current_FILE} OUTPUT_VARIABLE _dummy)\n" )
+#endforeach ( _current_FILE)
+
+# create and install a man page for the kdelibs cmake modules
+add_custom_target(KDECMakeModulesManPage ALL COMMAND ${CMAKE_COMMAND} -DCMAKE_MODULE_PATH=${CMAKE_CURRENT_SOURCE_DIR} --help-custom-modules ${CMAKE_CURRENT_BINARY_DIR}/kdecmake.1)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/kdecmake.1 DESTINATION "${MAN_INSTALL_DIR}/man1")
diff --git a/kdecore/cmake/modules/CMakeParseArguments.cmake b/kdecore/cmake/modules/CMakeParseArguments.cmake
new file mode 100644
index 0000000..6c8ca46
--- /dev/null
+++ b/kdecore/cmake/modules/CMakeParseArguments.cmake
@@ -0,0 +1,132 @@
+# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
+#
+# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for
+# parsing the arguments given to that macro or function.
+# It processes the arguments and defines a set of variables which hold the
+# values of the respective options.
+#
+# The <options> argument contains all options for the respective macro,
+# i.e. keywords which can be used when calling the macro without any value
+# following, like e.g. the OPTIONAL keyword of the install() command.
+#
+# The <one_value_keywords> argument contains all keywords for this macro
+# which are followed by one value, like e.g. DESTINATION keyword of the
+# install() command.
+#
+# The <multi_value_keywords> argument contains all keywords for this macro
+# which can be followed by more than one value, like e.g. the TARGETS or
+# FILES keywords of the install() command.
+#
+# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the
+# keywords listed in <options>, <one_value_keywords> and
+# <multi_value_keywords> a variable composed of the given <prefix>
+# followed by "_" and the name of the respective keyword.
+# These variables will then hold the respective value from the argument list.
+# For the <options> keywords this will be TRUE or FALSE.
+#
+# All remaining arguments are collected in a variable
+# <prefix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see whether
+# your macro was called with unrecognized parameters.
+#
+# As an example here a my_install() macro, which takes similar arguments as the
+# real install() command:
+#
+# function(MY_INSTALL)
+# set(options OPTIONAL FAST)
+# set(oneValueArgs DESTINATION RENAME)
+# set(multiValueArgs TARGETS CONFIGURATIONS)
+# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
+# ...
+#
+# Assume my_install() has been called like this:
+# my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
+#
+# After the cmake_parse_arguments() call the macro will have set the following
+# variables:
+# MY_INSTALL_OPTIONAL = TRUE
+# MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
+# MY_INSTALL_DESTINATION = "bin"
+# MY_INSTALL_RENAME = "" (was not used)
+# MY_INSTALL_TARGETS = "foo;bar"
+# MY_INSTALL_CONFIGURATIONS = "" (was not used)
+# MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
+#
+# You can the continue and process these variables.
+#
+# Keywords terminate lists of values, e.g. if directly after a one_value_keyword
+# another recognized keyword follows, this is interpreted as the beginning of
+# the new option.
+# E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in
+# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would
+# be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor.
+
+#=============================================================================
+# Copyright 2010 Alexander Neundorf <neundorf@kde.org>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+
+function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames)
+ # first set all result variables to empty/FALSE
+ foreach(arg_name ${_singleArgNames} ${_multiArgNames})
+ set(${prefix}_${arg_name})
+ endforeach(arg_name)
+
+ foreach(option ${_optionNames})
+ set(${prefix}_${option} FALSE)
+ endforeach(option)
+
+ set(${prefix}_UNPARSED_ARGUMENTS)
+
+ set(insideValues FALSE)
+ set(currentArgName)
+
+ # now iterate over all arguments and fill the result variables
+ foreach(currentArg ${ARGN})
+ list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword
+ list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword
+ list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword
+
+ if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1)
+ if(insideValues)
+ if("${insideValues}" STREQUAL "SINGLE")
+ set(${prefix}_${currentArgName} ${currentArg})
+ set(insideValues FALSE)
+ elseif("${insideValues}" STREQUAL "MULTI")
+ list(APPEND ${prefix}_${currentArgName} ${currentArg})
+ endif()
+ else(insideValues)
+ list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
+ endif(insideValues)
+ else()
+ if(NOT ${optionIndex} EQUAL -1)
+ set(${prefix}_${currentArg} TRUE)
+ set(insideValues FALSE)
+ elseif(NOT ${singleArgIndex} EQUAL -1)
+ set(currentArgName ${currentArg})
+ set(${prefix}_${currentArgName})
+ set(insideValues "SINGLE")
+ elseif(NOT ${multiArgIndex} EQUAL -1)
+ set(currentArgName ${currentArg})
+ set(${prefix}_${currentArgName})
+ set(insideValues "MULTI")
+ endif()
+ endif()
+
+ endforeach(currentArg)
+
+ # propagate the result variables to the caller:
+ foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
+ set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE)
+ endforeach(arg_name)
+ set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
+
+endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs)
diff --git a/kdecore/cmake/modules/COPYING-CMAKE-SCRIPTS b/kdecore/cmake/modules/COPYING-CMAKE-SCRIPTS
new file mode 100644
index 0000000..4b41776
--- /dev/null
+++ b/kdecore/cmake/modules/COPYING-CMAKE-SCRIPTS
@@ -0,0 +1,22 @@
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/kdecore/cmake/modules/CheckCXXSourceCompiles.cmake b/kdecore/cmake/modules/CheckCXXSourceCompiles.cmake
new file mode 100644
index 0000000..ba7f185
--- /dev/null
+++ b/kdecore/cmake/modules/CheckCXXSourceCompiles.cmake
@@ -0,0 +1,68 @@
+# - Check if the source code provided in the SOURCE argument compiles.
+# CHECK_CXX_SOURCE_COMPILES(SOURCE VAR)
+# - macro which checks if the source code compiles
+# SOURCE - source code to try to compile
+# VAR - variable to store whether the source code compiled
+#
+# The following variables may be set before calling this macro to
+# modify the way the check is run:
+#
+# CMAKE_REQUIRED_FLAGS = string of compile command line flags
+# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+# CMAKE_REQUIRED_INCLUDES = list of include directories
+# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+
+GET_FILENAME_COMPONENT(_CHECK_CXX_SOURCE_COMPILES_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
+INCLUDE(${_CHECK_CXX_SOURCE_COMPILES_DIR}/HandleImportedTargetsInCMakeRequiredLibraries.cmake)
+
+
+MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
+ IF("${VAR}" MATCHES "^${VAR}$")
+ SET(MACRO_CHECK_FUNCTION_DEFINITIONS
+ "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
+ IF(CMAKE_REQUIRED_LIBRARIES)
+ # this one translates potentially used imported library targets to their files on disk
+ HANDLE_IMPORTED_TARGETS_IN_CMAKE_REQUIRED_LIBRARIES(_CHECK_CXX_SOURCE_COMPILES_CMAKE_REQUIRED_LIBRARES)
+
+ SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
+ "-DLINK_LIBRARIES:STRING=${_CHECK_CXX_SOURCE_COMPILES_CMAKE_REQUIRED_LIBRARES}")
+# "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
+ ELSE(CMAKE_REQUIRED_LIBRARIES)
+ SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
+ ENDIF(CMAKE_REQUIRED_LIBRARIES)
+ IF(CMAKE_REQUIRED_INCLUDES)
+ SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
+ "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
+ ELSE(CMAKE_REQUIRED_INCLUDES)
+ SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
+ ENDIF(CMAKE_REQUIRED_INCLUDES)
+ FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
+ "${SOURCE}\n")
+
+ MESSAGE(STATUS "Performing Test ${VAR}")
+ TRY_COMPILE(${VAR}
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
+ COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
+ "${CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES}"
+ "${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}"
+ OUTPUT_VARIABLE OUTPUT)
+ IF(${VAR})
+ SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+ MESSAGE(STATUS "Performing Test ${VAR} - Success")
+ FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
+ "${OUTPUT}\n"
+ "Source file was:\n${SOURCE}\n")
+ ELSE(${VAR})
+ MESSAGE(STATUS "Performing Test ${VAR} - Failed")
+ SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+ FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
+ "${OUTPUT}\n"
+ "Source file was:\n${SOURCE}\n")
+ ENDIF(${VAR})
+ ENDIF("${VAR}" MATCHES "^${VAR}$")
+ENDMACRO(CHECK_CXX_SOURCE_COMPILES)
+
diff --git a/kdecore/cmake/modules/CheckCXXSourceRuns.cmake b/kdecore/cmake/modules/CheckCXXSourceRuns.cmake
new file mode 100644
index 0000000..c18d8b3
--- /dev/null
+++ b/kdecore/cmake/modules/CheckCXXSourceRuns.cmake
@@ -0,0 +1,81 @@
+# - Check if the C++ source code provided in the SOURCE argument compiles and runs.
+# CHECK_CXX_SOURCE_RUNS(SOURCE VAR)
+#
+# SOURCE - source code to try to compile
+# VAR - variable to store the result, 1 for success, empty for failure
+#
+# The following variables may be set before calling this macro to
+# modify the way the check is run:
+#
+# CMAKE_REQUIRED_FLAGS = string of compile command line flags
+# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+# CMAKE_REQUIRED_INCLUDES = list of include directories
+# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+
+GET_FILENAME_COMPONENT(_CHECK_CXX_SOURCE_RUNS_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
+INCLUDE(${_CHECK_CXX_SOURCE_RUNS_DIR}/HandleImportedTargetsInCMakeRequiredLibraries.cmake)
+
+MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
+ IF("${VAR}" MATCHES "^${VAR}$")
+ SET(MACRO_CHECK_FUNCTION_DEFINITIONS
+ "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
+ IF(CMAKE_REQUIRED_LIBRARIES)
+ # this one translates potentially used imported library targets to their files on disk
+ HANDLE_IMPORTED_TARGETS_IN_CMAKE_REQUIRED_LIBRARIES(_CHECK_CXX_SOURCE_RUNS_CMAKE_REQUIRED_LIBRARES)
+
+ SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
+ "-DLINK_LIBRARIES:STRING=${_CHECK_CXX_SOURCE_RUNS_CMAKE_REQUIRED_LIBRARES}")
+# "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
+ ELSE(CMAKE_REQUIRED_LIBRARIES)
+ SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
+ ENDIF(CMAKE_REQUIRED_LIBRARIES)
+ IF(CMAKE_REQUIRED_INCLUDES)
+ SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
+ "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
+ ELSE(CMAKE_REQUIRED_INCLUDES)
+ SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
+ ENDIF(CMAKE_REQUIRED_INCLUDES)
+ FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
+ "${SOURCE}\n")
+
+ MESSAGE(STATUS "Performing Test ${VAR}")
+ TRY_RUN(${VAR}_EXITCODE ${VAR}_COMPILED
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
+ COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
+ -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
+ "${CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES}"
+ "${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}"
+ COMPILE_OUTPUT_VARIABLE OUTPUT)
+
+ # if it did not compile make the return value fail code of 1
+ IF(NOT ${VAR}_COMPILED)
+ SET(${VAR}_EXITCODE 1)
+ ENDIF(NOT ${VAR}_COMPILED)
+ # if the return value was 0 then it worked
+ IF("${${VAR}_EXITCODE}" EQUAL 0)
+ SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+ MESSAGE(STATUS "Performing Test ${VAR} - Success")
+ FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
+ "${OUTPUT}\n"
+ "Return value: ${${VAR}}\n"
+ "Source file was:\n${SOURCE}\n")
+ ELSE("${${VAR}_EXITCODE}" EQUAL 0)
+ IF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
+ SET(${VAR} "${${VAR}_EXITCODE}")
+ ELSE(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
+ SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+ ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
+
+ MESSAGE(STATUS "Performing Test ${VAR} - Failed")
+ FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
+ "${OUTPUT}\n"
+ "Return value: ${${VAR}_EXITCODE}\n"
+ "Source file was:\n${SOURCE}\n")
+ ENDIF("${${VAR}_EXITCODE}" EQUAL 0)
+ ENDIF("${VAR}" MATCHES "^${VAR}$")
+ENDMACRO(CHECK_CXX_SOURCE_RUNS)
+
diff --git a/kdecore/cmake/modules/CheckCXXSymbolExists.cmake b/kdecore/cmake/modules/CheckCXXSymbolExists.cmake
new file mode 100644
index 0000000..f309fb0
--- /dev/null
+++ b/kdecore/cmake/modules/CheckCXXSymbolExists.cmake
@@ -0,0 +1,71 @@
+# - Check if the symbol exists in include files, in C++ mode
+# Forked off cmake's CheckSymbolExists.cmake
+# CHECK_CXX_SYMBOL_EXISTS(SYMBOL FILES VARIABLE)
+#
+# SYMBOL - symbol
+# FILES - include files to check
+# VARIABLE - variable to return result
+#
+# The following variables may be set before calling this macro to
+# modify the way the check is run:
+#
+# CMAKE_REQUIRED_FLAGS = string of compile command line flags
+# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+# CMAKE_REQUIRED_INCLUDES = list of include directories
+# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+
+MACRO(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
+ IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
+ SET(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
+ SET(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS})
+ IF(CMAKE_REQUIRED_LIBRARIES)
+ SET(CHECK_SYMBOL_EXISTS_LIBS
+ "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
+ ELSE(CMAKE_REQUIRED_LIBRARIES)
+ SET(CHECK_SYMBOL_EXISTS_LIBS)
+ ENDIF(CMAKE_REQUIRED_LIBRARIES)
+ IF(CMAKE_REQUIRED_INCLUDES)
+ SET(CMAKE_SYMBOL_EXISTS_INCLUDES
+ "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
+ ELSE(CMAKE_REQUIRED_INCLUDES)
+ SET(CMAKE_SYMBOL_EXISTS_INCLUDES)
+ ENDIF(CMAKE_REQUIRED_INCLUDES)
+ FOREACH(FILE ${FILES})
+ SET(CMAKE_CONFIGURABLE_FILE_CONTENT
+ "${CMAKE_CONFIGURABLE_FILE_CONTENT}#include <${FILE}>\n")
+ ENDFOREACH(FILE)
+ SET(CMAKE_CONFIGURABLE_FILE_CONTENT
+ "${CMAKE_CONFIGURABLE_FILE_CONTENT}\nvoid cmakeRequireSymbol(int dummy,...){(void)dummy;}\nint main()\n{\n#ifndef ${SYMBOL}\n cmakeRequireSymbol(0,&${SYMBOL});\n#endif\n return 0;\n}\n")
+
+ CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
+ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" @ONLY)
+
+ MESSAGE(STATUS "Looking for ${SYMBOL}")
+ TRY_COMPILE(${VARIABLE}
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx
+ COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ CMAKE_FLAGS
+ -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_SYMBOL_EXISTS_FLAGS}
+ "${CHECK_SYMBOL_EXISTS_LIBS}"
+ "${CMAKE_SYMBOL_EXISTS_INCLUDES}"
+ OUTPUT_VARIABLE OUTPUT)
+ IF(${VARIABLE})
+ MESSAGE(STATUS "Looking for ${SYMBOL} - found")
+ SET(${VARIABLE} 1 CACHE INTERNAL "Have symbol ${SYMBOL}")
+ FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Determining if the ${SYMBOL} "
+ "exist passed with the following output:\n"
+ "${OUTPUT}\nFile ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx:\n"
+ "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
+ ELSE(${VARIABLE})
+ MESSAGE(STATUS "Looking for ${SYMBOL} - not found.")
+ SET(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL}")
+ FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Determining if the ${SYMBOL} "
+ "exist failed with the following output:\n"
+ "${OUTPUT}\nFile ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx:\n"
+ "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
+ ENDIF(${VARIABLE})
+ ENDIF("${VARIABLE}" MATCHES "^${VARIABLE}$")
+ENDMACRO(CHECK_CXX_SYMBOL_EXISTS)
diff --git a/kdecore/cmake/modules/CheckPointerMember.cmake b/kdecore/cmake/modules/CheckPointerMember.cmake
new file mode 100644
index 0000000..b6ea544
--- /dev/null
+++ b/kdecore/cmake/modules/CheckPointerMember.cmake
@@ -0,0 +1,42 @@
+# - Check if the given struct or class has the specified member variable
+# CHECK_POINTER_MEMBER (POINTER MEMBER HEADER VARIABLE)
+#
+# POINTER - the name of the struct or class you are interested in
+# MEMBER - the member which existence you want to check
+# HEADER - the header(s) where the prototype should be declared
+# VARIABLE - variable to store the result
+#
+# The following variables may be set before calling this macro to
+# modify the way the check is run:
+#
+# CMAKE_REQUIRED_FLAGS = string of compile command line flags
+# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+# CMAKE_REQUIRED_INCLUDES = list of include directories
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+INCLUDE(CheckCXXSourceCompiles)
+
+MACRO (CHECK_POINTER_MEMBER _STRUCT _MEMBER _HEADER _RESULT)
+ SET(_INCLUDE_FILES)
+ FOREACH (it ${_HEADER})
+ SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
+ ENDFOREACH (it)
+
+ SET(_CHECK_POINTER_MEMBER_SOURCE_CODE "
+${_INCLUDE_FILES}
+int main()
+{
+ ${_STRUCT} tmp;
+ tmp->${_MEMBER};
+ return 0;
+}
+")
+ CHECK_CXX_SOURCE_COMPILES("${_CHECK_POINTER_MEMBER_SOURCE_CODE}" ${_RESULT})
+
+ENDMACRO (CHECK_POINTER_MEMBER)
+
diff --git a/kdecore/cmake/modules/CheckPrototypeExists.cmake b/kdecore/cmake/modules/CheckPrototypeExists.cmake
new file mode 100644
index 0000000..811d648
--- /dev/null
+++ b/kdecore/cmake/modules/CheckPrototypeExists.cmake
@@ -0,0 +1,41 @@
+# - Check if the prototype for a function exists.
+# CHECK_PROTOTYPE_EXISTS (FUNCTION HEADER VARIABLE)
+#
+# FUNCTION - the name of the function you are looking for
+# HEADER - the header(s) where the prototype should be declared
+# VARIABLE - variable to store the result
+#
+# The following variables may be set before calling this macro to
+# modify the way the check is run:
+#
+# CMAKE_REQUIRED_FLAGS = string of compile command line flags
+# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+# CMAKE_REQUIRED_INCLUDES = list of include directories
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+INCLUDE(CheckCXXSourceCompiles)
+
+MACRO (CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)
+ SET(_INCLUDE_FILES)
+ FOREACH (it ${_HEADER})
+ SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
+ ENDFOREACH (it)
+
+ SET(_CHECK_PROTO_EXISTS_SOURCE_CODE "
+${_INCLUDE_FILES}
+int main()
+{
+#ifndef ${_SYMBOL}
+ int i = sizeof(&${_SYMBOL});
+#endif
+ return 0;
+}
+")
+ CHECK_CXX_SOURCE_COMPILES("${_CHECK_PROTO_EXISTS_SOURCE_CODE}" ${_RESULT})
+ENDMACRO (CHECK_PROTOTYPE_EXISTS _SYMBOL _HEADER _RESULT)
+
diff --git a/kdecore/cmake/modules/CheckStructMember.cmake b/kdecore/cmake/modules/CheckStructMember.cmake
new file mode 100644
index 0000000..eeb1b65
--- /dev/null
+++ b/kdecore/cmake/modules/CheckStructMember.cmake
@@ -0,0 +1,42 @@
+# - Check if the given struct or class has the specified member variable
+# CHECK_STRUCT_MEMBER (STRUCT MEMBER HEADER VARIABLE)
+#
+# STRUCT - the name of the struct or class you are interested in
+# MEMBER - the member which existence you want to check
+# HEADER - the header(s) where the prototype should be declared
+# VARIABLE - variable to store the result
+#
+# The following variables may be set before calling this macro to
+# modify the way the check is run:
+#
+# CMAKE_REQUIRED_FLAGS = string of compile command line flags
+# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+# CMAKE_REQUIRED_INCLUDES = list of include directories
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+INCLUDE(CheckCXXSourceCompiles)
+
+MACRO (CHECK_STRUCT_MEMBER _STRUCT _MEMBER _HEADER _RESULT)
+ SET(_INCLUDE_FILES)
+ FOREACH (it ${_HEADER})
+ SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
+ ENDFOREACH (it)
+
+ SET(_CHECK_STRUCT_MEMBER_SOURCE_CODE "
+${_INCLUDE_FILES}
+int main()
+{
+ ${_STRUCT}* tmp;
+ tmp->${_MEMBER};
+ return 0;
+}
+")
+ CHECK_CXX_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT})
+
+ENDMACRO (CHECK_STRUCT_MEMBER)
+
diff --git a/kdecore/cmake/modules/FindACL.cmake b/kdecore/cmake/modules/FindACL.cmake
new file mode 100644
index 0000000..7d3fa14
--- /dev/null
+++ b/kdecore/cmake/modules/FindACL.cmake
@@ -0,0 +1,36 @@
+# - Try to find the ACL library
+# Once done this will define
+#
+# ACL_FOUND - system has the ACL library
+# ACL_LIBS - The libraries needed to use ACL
+
+# Copyright (c) 2006, Pino Toscano, <toscano.pino@tiscali.it>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+include(CheckIncludeFiles)
+
+check_include_files(attr/libattr.h HAVE_ATTR_LIBATTR_H)
+check_include_files(sys/xattr.h HAVE_SYS_XATTR_H)
+check_include_files(sys/acl.h HAVE_SYS_ACL_H)
+check_include_files(acl/libacl.h HAVE_ACL_LIBACL_H)
+
+if (HAVE_ATTR_LIBATTR_H AND HAVE_SYS_XATTR_H AND HAVE_SYS_ACL_H AND HAVE_ACL_LIBACL_H)
+ set(ACL_HEADERS_FOUND TRUE)
+endif (HAVE_ATTR_LIBATTR_H AND HAVE_SYS_XATTR_H AND HAVE_SYS_ACL_H AND HAVE_ACL_LIBACL_H)
+
+if (ACL_HEADERS_FOUND)
+ find_library(ACL_LIBS NAMES acl )
+
+ find_library(ATTR_LIBS NAMES attr )
+endif (ACL_HEADERS_FOUND)
+
+if (ACL_HEADERS_FOUND AND ACL_LIBS AND ATTR_LIBS)
+ set(ACL_FOUND TRUE)
+ set(ACL_LIBS ${ACL_LIBS} ${ATTR_LIBS})
+ message(STATUS "Found ACL support: ${ACL_LIBS}")
+endif (ACL_HEADERS_FOUND AND ACL_LIBS AND ATTR_LIBS)
+
+mark_as_advanced(ACL_LIBS ATTR_LIBS)
+
diff --git a/kdecore/cmake/modules/FindAGG.cmake b/kdecore/cmake/modules/FindAGG.cmake
new file mode 100644
index 0000000..86d5618
--- /dev/null
+++ b/kdecore/cmake/modules/FindAGG.cmake
@@ -0,0 +1,53 @@
+# - Try to find the AGG graphics library
+# Once done this will define
+#
+# AGG_FOUND - system has AGG
+# AGG_INCLUDE_DIR - the AGG include directory
+# AGG_LIBRARIES - Link these to use AGG
+# AGG_DEFINITIONS - Compiler switches required for using AGG
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if (AGG_INCLUDE_DIR AND AGG_LIBRARIES)
+
+ # in cache already
+ set(AGG_FOUND TRUE)
+
+else (AGG_INCLUDE_DIR AND AGG_LIBRARIES)
+ if (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ find_package(PkgConfig)
+ pkg_check_modules(PC_AGG QUIET libagg)
+
+ set(AGG_DEFINITIONS ${PC_AGG_CFLAGS_OTHER})
+ endif (NOT WIN32)
+
+ find_path(AGG_INCLUDE_DIR agg2/agg_pixfmt_gray.h
+ PATHS ${PC_AGG_INCLUDEDIR} ${PC_AGG_INCLUDE_DIRS}
+ )
+
+ find_library(AGG_LIBRARIES NAMES agg
+ PATHS ${PC_AGG_LIBDIR} ${PC_AGG_LIBRARY_DIRS}
+ )
+
+ if (AGG_INCLUDE_DIR AND AGG_LIBRARIES)
+ set(AGG_FOUND TRUE)
+ endif (AGG_INCLUDE_DIR AND AGG_LIBRARIES)
+
+ if (AGG_FOUND)
+ if (NOT AGG_FIND_QUIETLY)
+ message(STATUS "Found AGG: ${AGG_LIBRARIES}")
+ endif (NOT AGG_FIND_QUIETLY)
+ else (AGG_FOUND)
+ if (AGG_FIND_REQUIRED)
+ message(FATAL_ERROR "Could NOT find AGG")
+ endif (AGG_FIND_REQUIRED)
+ endif (AGG_FOUND)
+
+ mark_as_advanced(AGG_INCLUDE_DIR AGG_LIBRARIES)
+
+endif (AGG_INCLUDE_DIR AND AGG_LIBRARIES)
diff --git a/kdecore/cmake/modules/FindAkode.cmake b/kdecore/cmake/modules/FindAkode.cmake
new file mode 100644
index 0000000..9df503c
--- /dev/null
+++ b/kdecore/cmake/modules/FindAkode.cmake
@@ -0,0 +1,52 @@
+# - Try to find the aKode library
+# Once done this will define
+#
+# AKODE_FOUND - system has the aKode library
+# AKODE_INCLUDE_DIR - the aKode include directory
+# AKODE_LIBRARIES - The libraries needed to use aKode
+
+# Copyright (c) 2006, Pino Toscano, <toscano.pino@tiscali.it>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+IF (AKODE_LIBRARIES AND AKODE_INCLUDE_DIR)
+
+ # in cache already
+ SET(AKODE_FOUND TRUE)
+
+ELSE (AKODE_LIBRARIES AND AKODE_INCLUDE_DIR)
+
+ FIND_PROGRAM(AKODECONFIG_EXECUTABLE NAMES akode-config)
+
+ # if akode-config has been found
+ IF (AKODECONFIG_EXECUTABLE)
+
+ EXEC_PROGRAM(${AKODECONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE AKODE_LIBRARIES)
+
+ EXEC_PROGRAM(${AKODECONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE AKODE_INCLUDE_DIR)
+
+ IF (AKODE_LIBRARIES AND AKODE_INCLUDE_DIR)
+ SET(AKODE_FOUND TRUE)
+ STRING(REGEX REPLACE "-I(.+)" "\\1" AKODE_INCLUDE_DIR "${AKODE_INCLUDE_DIR}")
+ message(STATUS "Found aKode: ${AKODE_LIBRARIES}")
+ ENDIF (AKODE_LIBRARIES AND AKODE_INCLUDE_DIR)
+
+ # ensure that they are cached
+ set(AKODE_INCLUDE_DIR ${AKODE_INCLUDE_DIR})
+ set(AKODE_LIBRARIES ${AKODE_LIBRARIES})
+
+ ENDIF (AKODECONFIG_EXECUTABLE)
+ IF(AKODE_FOUND)
+ IF(NOT Akode_FIND_QUIETLY)
+ MESSAGE(STATUS "Akode found: ${AKODE_LIBRARIES}")
+ ENDIF(NOT Akode_FIND_QUIETLY)
+ ELSE(AKODE_FOUND)
+ IF(Akode_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find Akode")
+ ENDIF(Akode_FIND_REQUIRED)
+ ENDIF(AKODE_FOUND)
+
+ENDIF (AKODE_LIBRARIES AND AKODE_INCLUDE_DIR)
+
diff --git a/kdecore/cmake/modules/FindAlsa.cmake b/kdecore/cmake/modules/FindAlsa.cmake
new file mode 100644
index 0000000..1bad812
--- /dev/null
+++ b/kdecore/cmake/modules/FindAlsa.cmake
@@ -0,0 +1,69 @@
+# Alsa check, based on libkmid/configure.in.in.
+# Only the support for Alsa >= 0.9.x was included; 0.5.x was dropped (but feel free to re-add it if you need it)
+# It defines ...
+# It offers the following macros:
+# ALSA_CONFIGURE_FILE(config_header) - generate a config.h, typical usage:
+# ALSA_CONFIGURE_FILE(${CMAKE_BINARY_DIR}/config-alsa.h)
+# ALSA_VERSION_STRING(version_string) looks for alsa/version.h and reads the version string into
+# the first argument passed to the macro
+
+# Copyright (c) 2006, David Faure, <faure@kde.org>
+# Copyright (c) 2007, Matthias Kretz <kretz@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+include(CheckIncludeFiles)
+include(CheckIncludeFileCXX)
+include(CheckLibraryExists)
+
+# Already done by toplevel
+find_library(ASOUND_LIBRARY asound)
+set(ASOUND_LIBRARY_DIR "")
+if(ASOUND_LIBRARY)
+ get_filename_component(ASOUND_LIBRARY_DIR ${ASOUND_LIBRARY} PATH)
+endif(ASOUND_LIBRARY)
+
+check_library_exists(asound snd_seq_create_simple_port "${ASOUND_LIBRARY_DIR}" HAVE_LIBASOUND2)
+if(HAVE_LIBASOUND2)
+ message(STATUS "Found ALSA: ${ASOUND_LIBRARY}")
+else(HAVE_LIBASOUND2)
+ message(STATUS "ALSA not found")
+endif(HAVE_LIBASOUND2)
+set(ALSA_FOUND ${HAVE_LIBASOUND2})
+
+find_path(ALSA_INCLUDES alsa/version.h)
+
+macro(ALSA_VERSION_STRING _result)
+ # check for version in alsa/version.h
+ if(ALSA_INCLUDES)
+ file(READ "${ALSA_INCLUDES}/alsa/version.h" _ALSA_VERSION_CONTENT)
+ string(REGEX REPLACE ".*SND_LIB_VERSION_STR.*\"(.*)\".*" "\\1" ${_result} "${_ALSA_VERSION_CONTENT}")
+ else(ALSA_INCLUDES)
+ message(STATUS "ALSA version not known. ALSA output will probably not work correctly.")
+ endif(ALSA_INCLUDES)
+endmacro(ALSA_VERSION_STRING _result)
+
+
+get_filename_component(_FIND_ALSA_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
+macro(ALSA_CONFIGURE_FILE _destFile)
+ check_include_files(sys/soundcard.h HAVE_SYS_SOUNDCARD_H)
+ check_include_files(machine/soundcard.h HAVE_MACHINE_SOUNDCARD_H)
+
+ check_include_files(linux/awe_voice.h HAVE_LINUX_AWE_VOICE_H)
+ check_include_files(awe_voice.h HAVE_AWE_VOICE_H)
+ check_include_files(/usr/src/sys/i386/isa/sound/awe_voice.h HAVE__USR_SRC_SYS_I386_ISA_SOUND_AWE_VOICE_H)
+ check_include_files(/usr/src/sys/gnu/i386/isa/sound/awe_voice.h HAVE__USR_SRC_SYS_GNU_I386_ISA_SOUND_AWE_VOICE_H)
+
+ check_include_file_cxx(sys/asoundlib.h HAVE_SYS_ASOUNDLIB_H)
+ check_include_file_cxx(alsa/asoundlib.h HAVE_ALSA_ASOUNDLIB_H)
+
+ check_library_exists(asound snd_pcm_resume "${ASOUND_LIBRARY_DIR}" ASOUND_HAS_SND_PCM_RESUME)
+ if(ASOUND_HAS_SND_PCM_RESUME)
+ set(HAVE_SND_PCM_RESUME 1)
+ endif(ASOUND_HAS_SND_PCM_RESUME)
+
+ configure_file(${_FIND_ALSA_MODULE_DIR}/config-alsa.h.cmake ${_destFile})
+endmacro(ALSA_CONFIGURE_FILE _destFile)
+
+mark_as_advanced(ALSA_INCLUDES ASOUND_LIBRARY)
diff --git a/kdecore/cmake/modules/FindAutomoc4.cmake b/kdecore/cmake/modules/FindAutomoc4.cmake
new file mode 100644
index 0000000..b026b35
--- /dev/null
+++ b/kdecore/cmake/modules/FindAutomoc4.cmake
@@ -0,0 +1,49 @@
+# - Try to find automoc4
+# Once done this will define
+#
+# AUTOMOC4_FOUND - automoc4 has been found
+# AUTOMOC4_EXECUTABLE - the automoc4 tool
+# AUTOMOC4_VERSION - the full version of automoc4
+# AUTOMOC4_VERSION_MAJOR, AUTOMOC4_VERSION_MINOR, AUTOMOC4_VERSION_PATCH - AUTOMOC4_VERSION
+# broken into its components
+#
+# It also adds the following macros
+# AUTOMOC4(<target> <SRCS_VAR>)
+# Use this to run automoc4 on all files contained in the list <SRCS_VAR>.
+#
+# AUTOMOC4_MOC_HEADERS(<target> header1.h header2.h ...)
+# Use this to add more header files to be processed with automoc4.
+#
+# AUTOMOC4_ADD_EXECUTABLE(<target_NAME> src1 src2 ...)
+# This macro does the same as ADD_EXECUTABLE, but additionally
+# adds automoc4 handling for all source files.
+#
+# AUTOMOC4_ADD_LIBRARY(<target_NAME> src1 src2 ...)
+# This macro does the same as ADD_LIBRARY, but additionally
+# adds automoc4 handling for all source files.
+
+# Internal helper macro, may change or be removed anytime:
+# _ADD_AUTOMOC4_TARGET(<target_NAME> <SRCS_VAR>)
+#
+# Since version 0.9.88:
+# The following two macros are only to be used for KDE4 projects
+# and do something which makes sure automoc4 works for KDE. Don't
+# use them anywhere else.
+# _AUTOMOC4_KDE4_PRE_TARGET_HANDLING(<target_NAME> <SRCS_VAR>)
+# _AUTOMOC4_KDE4_POST_TARGET_HANDLING(<target_NAME>)
+
+
+# Copyright (c) 2008-2009, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+# use the new "config-mode" of cmake 2.6, which searches the installed Automoc4Config.cmake file
+# see the man page for details
+set(_Automoc4_FIND_QUIETLY ${Automoc4_FIND_QUIETLY})
+find_package(Automoc4 QUIET NO_MODULE)
+set(Automoc4_FIND_QUIETLY ${_Automoc4_FIND_QUIETLY})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Automoc4 "Did not find automoc4 (Automoc4Config.cmake, install git://anongit.kde.org/automoc)." AUTOMOC4_EXECUTABLE)
diff --git a/kdecore/cmake/modules/FindAvahi.cmake b/kdecore/cmake/modules/FindAvahi.cmake
new file mode 100644
index 0000000..c6e055f
--- /dev/null
+++ b/kdecore/cmake/modules/FindAvahi.cmake
@@ -0,0 +1,15 @@
+# Find Avahi. Only avahi-common/defs.h is really needed
+
+# Copyright (c) 2007, Jakub Stachowski, <qbast@go2.pl>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+find_path(AVAHI_INCLUDE_DIR avahi-common/defs.h)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Avahi DEFAULT_MSG
+ AVAHI_INCLUDE_DIR)
+
+mark_as_advanced(AVAHI_INCLUDE_DIR)
+
diff --git a/kdecore/cmake/modules/FindBerkeleyDB.cmake b/kdecore/cmake/modules/FindBerkeleyDB.cmake
new file mode 100644
index 0000000..021d942
--- /dev/null
+++ b/kdecore/cmake/modules/FindBerkeleyDB.cmake
@@ -0,0 +1,25 @@
+# - Try to find Berkeley DB
+# Once done this will define
+#
+# BERKELEY_DB_FOUND - system has Berkeley DB
+# BERKELEY_DB_INCLUDE_DIR - the Berkeley DB include directory
+# BERKELEY_DB_LIBRARIES - Link these to use Berkeley DB
+# BERKELEY_DB_DEFINITIONS - Compiler switches required for using Berkeley DB
+
+# Copyright (c) 2006, Alexander Dymo, <adymo@kdevelop.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+find_path(BERKELEY_DB_INCLUDE_DIR db.h
+ /usr/include/db4
+ /usr/local/include/db4
+)
+
+find_library(BERKELEY_DB_LIBRARIES NAMES db )
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Berkeley "Could not find Berkeley DB >= 4.1" BERKELEY_DB_INCLUDE_DIR BERKELEY_DB_LIBRARIES)
+# show the BERKELEY_DB_INCLUDE_DIR and BERKELEY_DB_LIBRARIES variables only in the advanced view
+mark_as_advanced(BERKELEY_DB_INCLUDE_DIR BERKELEY_DB_LIBRARIES )
+
diff --git a/kdecore/cmake/modules/FindBlitz.cmake b/kdecore/cmake/modules/FindBlitz.cmake
new file mode 100644
index 0000000..f4f077d
--- /dev/null
+++ b/kdecore/cmake/modules/FindBlitz.cmake
@@ -0,0 +1,55 @@
+###########################################################
+######### DEPRECATED, use FindQImageBlitz instead #########
+###########################################################
+# - Try to find blitz lib
+# Once done this will define
+#
+# BLITZ_FOUND - system has blitz lib
+# BLITZ_INCLUDES - the blitz include directory
+# BLITZ_LIBRARIES - The libraries needed to use blitz
+
+# Copyright (c) 2006, Montel Laurent, <montel@kde.org>
+# Copyright (c) 2007, Allen Winter, <winter@kde.org>
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+include(FindLibraryWithDebug)
+
+if (BLITZ_INCLUDES AND BLITZ_LIBRARIES)
+ set(Blitz_FIND_QUIETLY TRUE)
+endif (BLITZ_INCLUDES AND BLITZ_LIBRARIES)
+
+if (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ find_package(PkgConfig)
+ pkg_check_modules(PC_BLITZ QUIET qimageblitz)
+endif (NOT WIN32)
+
+find_path(BLITZ_INCLUDES
+ NAMES
+ qimageblitz.h
+ PATH_SUFFIXES qimageblitz
+ PATHS
+ $ENV{QIMAGEBLITZDIR}/include
+ ${PC_BLITZ_INCLUDEDIR}
+ ${PC_BLITZ_INCLUDE_DIRS}
+ ${KDE4_INCLUDE_DIR}
+ ${INCLUDE_INSTALL_DIR}
+)
+
+find_library_with_debug(BLITZ_LIBRARIES
+ WIN32_DEBUG_POSTFIX d
+ qimageblitz
+ PATHS
+ $ENV{QIMAGEBLITZDIR}/lib
+ ${PC_BLITZ_LIBRARY_DIRS}
+ ${PC_BLITZ_LIBDIR}
+ ${KDE4_LIB_DIR}
+ ${LIB_INSTALL_DIR}
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Blitz DEFAULT_MSG
+ BLITZ_INCLUDES BLITZ_LIBRARIES)
+mark_as_advanced(BLITZ_INCLUDES BLITZ_LIBRARIES)
diff --git a/kdecore/cmake/modules/FindBlueZ.cmake b/kdecore/cmake/modules/FindBlueZ.cmake
new file mode 100644
index 0000000..b1577d3
--- /dev/null
+++ b/kdecore/cmake/modules/FindBlueZ.cmake
@@ -0,0 +1,51 @@
+# - Try to find BlueZ
+# Once done this will define
+#
+# BLUEZ_FOUND - system has BlueZ
+# BLUEZ_INCLUDE_DIR - the BlueZ include directory
+# BLUEZ_LIBRARIES - Link these to use BlueZ
+# BLUEZ_DEFINITIONS - Compiler switches required for using BlueZ
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+# Copyright (c) 2008, Daniel Gollub, <dgollub@suse.de>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if ( BLUEZ_INCLUDE_DIR AND BLUEZ_LIBRARIES )
+ # in cache already
+ set(BlueZ_FIND_QUIETLY TRUE)
+endif ( BLUEZ_INCLUDE_DIR AND BLUEZ_LIBRARIES )
+
+# use pkg-config to get the directories and then use these values
+# in the FIND_PATH() and FIND_LIBRARY() calls
+if( NOT WIN32 )
+ find_package(PkgConfig)
+
+ pkg_check_modules(PC_BLUEZ QUIET bluez)
+
+ set(BLUEZ_DEFINITIONS ${PC_BLUEZ_CFLAGS_OTHER})
+endif( NOT WIN32 )
+
+find_path(BLUEZ_INCLUDE_DIR NAMES bluetooth/bluetooth.h
+ PATHS
+ ${PC_BLUEZ_INCLUDEDIR}
+ ${PC_BLUEZ_INCLUDE_DIRS}
+ /usr/X11/include
+)
+
+find_library(BLUEZ_LIBRARIES NAMES bluetooth
+ PATHS
+ ${PC_BLUEZ_LIBDIR}
+ ${PC_BLUEZ_LIBRARY_DIRS}
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(BlueZ DEFAULT_MSG BLUEZ_INCLUDE_DIR BLUEZ_LIBRARIES )
+
+# show the BLUEZ_INCLUDE_DIR and BLUEZ_LIBRARIES variables only in the advanced view
+mark_as_advanced(BLUEZ_INCLUDE_DIR BLUEZ_LIBRARIES )
+
diff --git a/kdecore/cmake/modules/FindBoost.cmake b/kdecore/cmake/modules/FindBoost.cmake
new file mode 100644
index 0000000..8534abd
--- /dev/null
+++ b/kdecore/cmake/modules/FindBoost.cmake
@@ -0,0 +1,25 @@
+# - Try to find Boost include dirs and libraries
+#
+# Please see the Documentation for Boost in the CMake Manual for details
+# This module only forwards to the one included in cmake for compatibility
+# reasons.
+
+# This call is kept for compatibility of this module with CMake 2.6.2, which
+# only knows about Boost < 1.37.
+# Note: Do _not_ add new Boost versions here, we're trying to get rid
+# of this module in kdelibs, but thats only possible if there's a CMake-included
+# version that finds all modules that this file finds.
+# Instead add a similar call with newer version numbers to the CMakeLists.txt
+# in your project before calling find_package(Boost)
+#
+# Copyright (c) 2009 Andreas Pakulat <apaku@gmx.de>
+#
+# Redistribution AND use is allowed according to the terms of the New
+# BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+set( Boost_ADDITIONAL_VERSIONS ${Boost_ADDITIONAL_VERSIONS} "1.37" )
+
+include(${CMAKE_ROOT}/Modules/FindBoost.cmake)
+
diff --git a/kdecore/cmake/modules/FindCarbon.cmake b/kdecore/cmake/modules/FindCarbon.cmake
new file mode 100644
index 0000000..2b0d979
--- /dev/null
+++ b/kdecore/cmake/modules/FindCarbon.cmake
@@ -0,0 +1,22 @@
+# - Find Carbon on Mac
+#
+# CARBON_LIBRARY - the library to use Carbon
+# CARBON_FOUND - true if Carbon has been found
+
+# Copyright (c) 2006, Benjamin Reed, <ranger@befunk.com>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+include(CMakeFindFrameworks)
+
+cmake_find_frameworks(Carbon)
+
+if (Carbon_FRAMEWORKS)
+ set(CARBON_LIBRARY "-framework Carbon" CACHE FILEPATH "Carbon framework" FORCE)
+ set(CARBON_FOUND 1)
+endif (Carbon_FRAMEWORKS)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Carbon DEFAULT_MSG CARBON_LIBRARY)
+
diff --git a/kdecore/cmake/modules/FindDBusMenuQt.cmake b/kdecore/cmake/modules/FindDBusMenuQt.cmake
new file mode 100644
index 0000000..5af70ef
--- /dev/null
+++ b/kdecore/cmake/modules/FindDBusMenuQt.cmake
@@ -0,0 +1,94 @@
+# - Try to find dbusmenu-qt
+# This module helps finding an installation of the DBusMenuQt library (see https://launchpad.net/libdbusmenu-qt/)
+# Once done this will define
+#
+# DBUSMENUQT_FOUND - system has dbusmenu-qt
+# DBUSMENUQT_INCLUDE_DIR - the dbusmenu-qt include directory
+# DBUSMENUQT_LIBRARIES - the libraries needed to use dbusmenu-qt
+# DBUSMENUQT_DEFINITIONS - Compiler switches required for using dbusmenu-qt
+#
+# The minimum required version of DBusMenuQt can be specified using the
+# standard syntax, e.g. find_package(DBusMenuQt 0.6)
+#
+# WARNING: versions below 0.4.0 cannot be checked for.
+# So if you want to have a version check, require at least 0.4.0 of dbusmenuqt.
+
+# Copyright (c) 2009, Canonical Ltd.
+# - Author: Aurélien Gâteau <aurelien.gateau@canonical.com>
+#
+# Based on FindQCA2.cmake
+# Copyright (c) 2006, Michael Larouche, <michael.larouche@kdemail.net>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+include(FindPackageHandleStandardArgs)
+
+find_package(PkgConfig)
+pkg_check_modules(PC_DBUSMENUQT QUIET dbusmenu-qt)
+
+
+set(DBUSMENUQT_DEFINITIONS ${PC_DBUSMENUQT_CFLAGS_OTHER})
+
+find_library(DBUSMENUQT_LIBRARIES
+ NAMES dbusmenu-qt dbusmenu-qtd
+ HINTS ${PC_DBUSMENUQT_LIBDIR} ${PC_DBUSMENUQT_LIBRARY_DIRS}
+ )
+
+find_path(DBUSMENUQT_INCLUDE_DIR dbusmenuexporter.h
+ HINTS ${PC_DBUSMENUQT_INCLUDEDIR} ${PC_DBUSMENUQT_INCLUDE_DIRS}
+ PATH_SUFFIXES dbusmenu-qt
+ )
+
+
+# dbusmenu_version.h is installed since 0.4.0, fail if a version below this is required:
+if ((DBusMenuQt_FIND_VERSION) AND ("${DBusMenuQt_FIND_VERSION}" VERSION_LESS "0.4.0"))
+ message(FATAL_ERROR "Cannot check reliably for a DBusMenuQt version below 0.4.0 (${DBusMenuQt_FIND_VERSION} was requested)")
+endif ((DBusMenuQt_FIND_VERSION) AND ("${DBusMenuQt_FIND_VERSION}" VERSION_LESS "0.4.0"))
+
+
+# find the version number from dbusmenu_version.h and store it in the cache
+if(DBUSMENUQT_INCLUDE_DIR AND NOT DBUSMENUQT_VERSION)
+ # parse the version number out from dbusmenu_version:
+ if(EXISTS ${DBUSMENUQT_INCLUDE_DIR}/dbusmenu_version.h)
+ file(READ "${DBUSMENUQT_INCLUDE_DIR}/dbusmenu_version.h" DBUSMENUQT_VERSION_CONTENT)
+
+ if ("${DBUSMENUQT_VERSION_CONTENT}" MATCHES "DBUSMENUQT_VERSION_MAJOR") # introduced after 0.6.4, makes this code here more robust
+
+ string(REGEX MATCH "#define +DBUSMENUQT_VERSION_MAJOR +([0-9]+)" _dummy "${DBUSMENUQT_VERSION_CONTENT}")
+ set(DBUSMENUQT_VERSION_MAJOR "${CMAKE_MATCH_1}")
+
+ string(REGEX MATCH "#define +DBUSMENUQT_VERSION_MINOR +([0-9]+)" _dummy "${DBUSMENUQT_VERSION_CONTENT}")
+ set(DBUSMENUQT_VERSION_MINOR "${CMAKE_MATCH_1}")
+
+ string(REGEX MATCH "#define +DBUSMENUQT_VERSION_PATCH +([0-9]+)" _dummy "${DBUSMENUQT_VERSION_CONTENT}")
+ set(DBUSMENUQT_VERSION_PATCH "${CMAKE_MATCH_1}")
+
+ else("${DBUSMENUQT_VERSION_CONTENT}" MATCHES "DBUSMENUQT_VERSION_MAJOR")
+ # In versions up to 0.6.4, the code for setting the version number in the header looked like
+ # shopw below. This made version checking quite un-obvious:
+ # #define DBUSMENUQT_VERSION \
+ # ((0 << 16) \
+ # |(6 << 8) \
+ # |4)
+
+ string(REGEX MATCH "\\(\\( *([0-9]+) *<<" _dummy "${DBUSMENUQT_VERSION_CONTENT}")
+ set(DBUSMENUQT_VERSION_MAJOR "${CMAKE_MATCH_1}")
+
+ string(REGEX MATCH "\\|\\( *([0-9]+) *<<" _dummy "${DBUSMENUQT_VERSION_CONTENT}")
+ set(DBUSMENUQT_VERSION_MINOR "${CMAKE_MATCH_1}")
+
+ string(REGEX MATCH "\\| *([0-9]+) *\\)" _dummy "${DBUSMENUQT_VERSION_CONTENT}")
+ set(DBUSMENUQT_VERSION_PATCH "${CMAKE_MATCH_1}")
+ endif("${DBUSMENUQT_VERSION_CONTENT}" MATCHES "DBUSMENUQT_VERSION_MAJOR")
+ endif(EXISTS ${DBUSMENUQT_INCLUDE_DIR}/dbusmenu_version.h)
+
+ set(DBUSMENUQT_VERSION "${DBUSMENUQT_VERSION_MAJOR}.${DBUSMENUQT_VERSION_MINOR}.${DBUSMENUQT_VERSION_PATCH}" CACHE STRING "Version number of DBusMenuQt" FORCE)
+endif(DBUSMENUQT_INCLUDE_DIR AND NOT DBUSMENUQT_VERSION)
+
+
+find_package_handle_standard_args(DBusMenuQt REQUIRED_VARS DBUSMENUQT_LIBRARIES DBUSMENUQT_INCLUDE_DIR
+ VERSION_VAR DBUSMENUQT_VERSION)
+#"Could not find dbusmenu-qt; available at https://launchpad.net/libdbusmenu-qt/" DBUSMENUQT_LIBRARIES DBUSMENUQT_INCLUDE_DIR)
+
+mark_as_advanced(DBUSMENUQT_INCLUDE_DIR DBUSMENUQT_LIBRARIES DBUSMENUQT_VERSION)
diff --git a/kdecore/cmake/modules/FindDNSSD.cmake b/kdecore/cmake/modules/FindDNSSD.cmake
new file mode 100644
index 0000000..8604bd5
--- /dev/null
+++ b/kdecore/cmake/modules/FindDNSSD.cmake
@@ -0,0 +1,48 @@
+# - Try to find DNSSD
+# Once done this will define
+#
+# DNSSD_FOUND - system has DNSSD
+# DNSSD_INCLUDE_DIR - the DNSSD include directory
+# DNSSD_LIBRARIES - Link these to use dnssd
+# DNSSD_DEFINITIONS - Compiler switches required for using DNSSD
+#
+# need more test: look at into dnssd/configure.in.in
+
+# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+FIND_PATH(DNSSD_INCLUDE_DIR dns_sd.h
+ /usr/include/avahi-compat-libdns_sd/
+)
+
+if (DNSSD_INCLUDE_DIR)
+ if (APPLE)
+ set(DNSSD_LIBRARIES "/usr/lib/libSystem.dylib")
+ else (APPLE)
+ FIND_LIBRARY(DNSSD_LIBRARIES NAMES dns_sd )
+ endif (APPLE)
+
+ MACRO_PUSH_REQUIRED_VARS()
+ set(CMAKE_REQUIRED_INCLUDES ${DNSSD_INCLUDE_DIR})
+ set(CMAKE_REQUIRED_LIBRARIES ${DNSSD_LIBRARIES})
+ CHECK_FUNCTION_EXISTS(DNSServiceRefDeallocate DNSSD_FUNCTION_FOUND)
+ MACRO_POP_REQUIRED_VARS()
+
+ if (DNSSD_INCLUDE_DIR AND DNSSD_LIBRARIES AND DNSSD_FUNCTION_FOUND)
+ set(DNSSD_FOUND TRUE)
+ endif (DNSSD_INCLUDE_DIR AND DNSSD_LIBRARIES AND DNSSD_FUNCTION_FOUND)
+endif (DNSSD_INCLUDE_DIR)
+
+if (DNSSD_FOUND)
+ if (NOT DNSSD_FIND_QUIETLY)
+ message(STATUS "Found DNSSD: ${DNSSD_LIBRARIES}")
+ endif (NOT DNSSD_FIND_QUIETLY)
+else (DNSSD_FOUND)
+ if (DNSSD_FIND_REQUIRED)
+ message(FATAL_ERROR "Could NOT find DNSSD")
+ endif (DNSSD_FIND_REQUIRED)
+endif (DNSSD_FOUND)
+
+MARK_AS_ADVANCED(DNSSD_INCLUDE_DIR DNSSD_LIBRARIES)
diff --git a/kdecore/cmake/modules/FindDocBookXML.cmake b/kdecore/cmake/modules/FindDocBookXML.cmake
new file mode 100644
index 0000000..26053bf
--- /dev/null
+++ b/kdecore/cmake/modules/FindDocBookXML.cmake
@@ -0,0 +1,67 @@
+# Try to find DocBook XML DTDs
+# Once done, it will define:
+#
+# DOCBOOKXML_FOUND - system has the required DocBook XML DTDs
+# DOCBOOKXML_CURRENTDTD_VERSION - the version of currently used DocBook XML
+# DTD
+# DOCBOOKXML_CURRENTDTD_DIR - the directory containing the definition of
+# the currently used DocBook XML version
+
+# Copyright (c) 2010, Luigi Toscano, <luigi.toscano@tiscali.it>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+set (DOCBOOKXML_CURRENTDTD_VERSION "4.2"
+ CACHE INTERNAL "Required version of XML DTDs")
+
+set (DTD_PATH_LIST
+ share/xml/docbook/schema/dtd/${DOCBOOKXML_CURRENTDTD_VERSION}
+ share/xml/docbook/xml-dtd-${DOCBOOKXML_CURRENTDTD_VERSION}
+ share/sgml/docbook/xml-dtd-${DOCBOOKXML_CURRENTDTD_VERSION}
+ share/xml/docbook/${DOCBOOKXML_CURRENTDTD_VERSION}
+)
+
+find_path (DOCBOOKXML_CURRENTDTD_DIR docbookx.dtd
+ PATHS ${CMAKE_SYSTEM_PREFIX_PATH}
+ PATH_SUFFIXES ${DTD_PATH_LIST}
+)
+
+if (NOT DOCBOOKXML_CURRENTDTD_DIR)
+ # hacks for systems that use the package version in the DTD dirs,
+ # e.g. Fedora, OpenSolaris
+ set (DTD_PATH_LIST)
+ foreach (DTD_PREFIX_ITER ${CMAKE_SYSTEM_PREFIX_PATH})
+ file(GLOB DTD_SUFFIX_ITER RELATIVE ${DTD_PREFIX_ITER}
+ ${DTD_PREFIX_ITER}/share/sgml/docbook/xml-dtd-${DOCBOOKXML_CURRENTDTD_VERSION}-*
+ )
+ if (DTD_SUFFIX_ITER)
+ list (APPEND DTD_PATH_LIST ${DTD_SUFFIX_ITER})
+ endif ()
+ endforeach ()
+
+ find_path (DOCBOOKXML_CURRENTDTD_DIR docbookx.dtd
+ PATHS ${CMAKE_SYSTEM_PREFIX_PATH}
+ PATH_SUFFIXES ${DTD_PATH_LIST}
+ )
+endif (NOT DOCBOOKXML_CURRENTDTD_DIR)
+
+#set (DOCBOOKXML_OLDDTD_DIR ${DOCBOOKXML_CURRENTDTD_DIR})
+#set (DOCBOOKXML_OLDDTD_VERSION "4.1.2")
+#set (DTD_PATH_LIST)
+# share/xml/docbook/schema/dtd/${DOCBOOKXML_OLDDTD_VERSION}
+# share/xml/docbook/xml-dtd-${DOCBOOKXML_OLDDTD_VERSION}
+# share/sgml/docbook/xml-dtd-${DOCBOOKXML_OLDDTD_VERSION}
+# share/xml/docbook/${DOCBOOKXML_OLDDTD_VERSION}
+#)
+#find_path (DOCBOOKXML_OLDDTD_DIR docbookx.dtd
+# PATHS ${CMAKE_SYSTEM_PREFIX_PATH}
+# PATH_SUFFIXES ${DTD_PATH_LIST}
+#)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args (DocBookXML
+ "Could NOT find DocBook XML DTDs (v${DOCBOOKXML_CURRENTDTD_VERSION})"
+ DOCBOOKXML_CURRENTDTD_DIR DOCBOOKXML_CURRENTDTD_VERSION)
+
+mark_as_advanced (DOCBOOKXML_CURRENTDTD_DIR DOCBOOKXML_CURRENTDTD_VERSION)
diff --git a/kdecore/cmake/modules/FindDocBookXSL.cmake b/kdecore/cmake/modules/FindDocBookXSL.cmake
new file mode 100644
index 0000000..ab93c9e
--- /dev/null
+++ b/kdecore/cmake/modules/FindDocBookXSL.cmake
@@ -0,0 +1,52 @@
+# Try to find DocBook XSL stylesheet
+# Once done, it will define:
+#
+# DOCBOOKXSL_FOUND - system has the required DocBook XML DTDs
+# DOCBOOKXSL_DIR - the directory containing the stylesheets
+# used to process DocBook XML
+
+# Copyright (c) 2010, Luigi Toscano, <luigi.toscano@tiscali.it>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+set (STYLESHEET_PATH_LIST
+ share/xml/docbook/stylesheet/docbook-xsl
+ share/xml/docbook/xsl-stylesheets
+ share/sgml/docbook/xsl-stylesheets
+ share/xml/docbook/stylesheet/nwalsh/current
+ share/xml/docbook/stylesheet/nwalsh
+ share/xsl/docbook
+ share/xsl/docbook-xsl
+)
+
+find_path (DOCBOOKXSL_DIR lib/lib.xsl
+ PATHS ${CMAKE_SYSTEM_PREFIX_PATH}
+ PATH_SUFFIXES ${STYLESHEET_PATH_LIST}
+)
+
+if (NOT DOCBOOKXSL_DIR)
+ # hacks for systems that put the version in the stylesheet dirs
+ set (STYLESHEET_PATH_LIST)
+ foreach (STYLESHEET_PREFIX_ITER ${CMAKE_SYSTEM_PREFIX_PATH})
+ file(GLOB STYLESHEET_SUFFIX_ITER RELATIVE ${STYLESHEET_PREFIX_ITER}
+ ${STYLESHEET_PREFIX_ITER}/share/xml/docbook/xsl-stylesheets-*
+ )
+ if (STYLESHEET_SUFFIX_ITER)
+ list (APPEND STYLESHEET_PATH_LIST ${STYLESHEET_SUFFIX_ITER})
+ endif ()
+ endforeach ()
+
+ find_path (DOCBOOKXSL_DIR VERSION
+ PATHS ${CMAKE_SYSTEM_PREFIX_PATH}
+ PATH_SUFFIXES ${STYLESHEET_PATH_LIST}
+ )
+endif (NOT DOCBOOKXSL_DIR)
+
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args (DocBookXSL
+ "Could NOT find DocBook XSL stylesheets"
+ DOCBOOKXSL_DIR)
+
+mark_as_advanced (DOCBOOKXSL_DIR)
diff --git a/kdecore/cmake/modules/FindENCHANT.cmake b/kdecore/cmake/modules/FindENCHANT.cmake
new file mode 100644
index 0000000..9c13c48
--- /dev/null
+++ b/kdecore/cmake/modules/FindENCHANT.cmake
@@ -0,0 +1,44 @@
+# - Try to find the Enchant spell checker
+# Once done this will define
+#
+# ENCHANT_FOUND - system has ENCHANT
+# ENCHANT_INCLUDE_DIR - the ENCHANT include directory
+# ENCHANT_LIBRARIES - Link these to use ENCHANT
+# ENCHANT_DEFINITIONS - Compiler switches required for using ENCHANT
+
+# Copyright (c) 2006, Zack Rusin, <zack@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+
+ # in cache already
+ set(ENCHANT_FOUND TRUE)
+
+else (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+ if (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ find_package(PkgConfig)
+ pkg_check_modules(PC_ENCHANT QUIET enchant)
+ set(ENCHANT_DEFINITIONS ${PC_ENCHANT_CFLAGS_OTHER})
+ endif (NOT WIN32)
+
+ find_path(ENCHANT_INCLUDE_DIR
+ NAMES enchant++.h
+ HINTS ${PC_ENCHANT_INCLUDEDIR}
+ ${PC_ENCHANT_INCLUDE_DIRS}
+ PATH_SUFFIXES enchant )
+
+ find_library(ENCHANT_LIBRARIES NAMES enchant
+ HINTS ${PC_ENCHANT_LIBDIR}
+ ${PC_ENCHANT_LIBRARY_DIRS} )
+
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(ENCHANT DEFAULT_MSG ENCHANT_INCLUDE_DIR ENCHANT_LIBRARIES )
+
+ mark_as_advanced(ENCHANT_INCLUDE_DIR ENCHANT_LIBRARIES)
+
+endif (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
diff --git a/kdecore/cmake/modules/FindEigen.cmake b/kdecore/cmake/modules/FindEigen.cmake
new file mode 100644
index 0000000..805deb2
--- /dev/null
+++ b/kdecore/cmake/modules/FindEigen.cmake
@@ -0,0 +1,24 @@
+# Note that Eigen1 is deprecated in favor of Eigen2. So this file is deprecated
+# in favor of FindEigen2.cmake. It is kept only for compatibility.
+#
+# - Try to find Eigen1 library
+# Once done this will define
+#
+# EIGEN_FOUND - system has eigen lib
+# EIGEN_INCLUDE_DIR - the eigen include directory
+
+# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+find_path(EIGEN_INCLUDE_DIR NAMES eigen/matrix.h
+ PATHS
+ ${INCLUDE_INSTALL_DIR}
+ )
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Eigen DEFAULT_MSG EIGEN_INCLUDE_DIR )
+
+mark_as_advanced(EIGEN_INCLUDE_DIR)
+
+
diff --git a/kdecore/cmake/modules/FindEigen2.cmake b/kdecore/cmake/modules/FindEigen2.cmake
new file mode 100644
index 0000000..83949e9
--- /dev/null
+++ b/kdecore/cmake/modules/FindEigen2.cmake
@@ -0,0 +1,55 @@
+# - Try to find Eigen2 lib
+#
+# This module supports requiring a minimum version, e.g. you can do
+# find_package(Eigen2 2.0.3)
+# to require version 2.0.3 to newer of Eigen2.
+#
+# Once done this will define
+#
+# EIGEN2_FOUND - system has eigen lib with correct version
+# EIGEN2_INCLUDE_DIR - the eigen include directory
+# EIGEN2_VERSION - eigen version
+
+# Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
+# Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
+# Redistribution and use is allowed according to the terms of the BSD license.
+
+if(NOT Eigen2_FIND_VERSION)
+ set(Eigen2_FIND_VERSION_MAJOR 2)
+ set(Eigen2_FIND_VERSION_MINOR 0)
+ set(Eigen2_FIND_VERSION_PATCH 0)
+
+ set(Eigen2_FIND_VERSION "${Eigen2_FIND_VERSION_MAJOR}.${Eigen2_FIND_VERSION_MINOR}.${Eigen2_FIND_VERSION_PATCH}")
+endif(NOT Eigen2_FIND_VERSION)
+
+macro(_eigen2_get_version)
+ file(READ "${EIGEN2_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen2_version_header LIMIT 5000 OFFSET 1000)
+
+ string(REGEX MATCH "define *EIGEN_WORLD_VERSION ([0-9]*)" _eigen2_world_version_match "${_eigen2_version_header}")
+ set(EIGEN2_WORLD_VERSION "${CMAKE_MATCH_1}")
+ string(REGEX MATCH "define *EIGEN_MAJOR_VERSION ([0-9]*)" _eigen2_major_version_match "${_eigen2_version_header}")
+ set(EIGEN2_MAJOR_VERSION "${CMAKE_MATCH_1}")
+ string(REGEX MATCH "define *EIGEN_MINOR_VERSION ([0-9]*)" _eigen2_minor_version_match "${_eigen2_version_header}")
+ set(EIGEN2_MINOR_VERSION "${CMAKE_MATCH_1}")
+
+ set(EIGEN2_VERSION ${EIGEN2_WORLD_VERSION}.${EIGEN2_MAJOR_VERSION}.${EIGEN2_MINOR_VERSION})
+endmacro(_eigen2_get_version)
+
+find_path(EIGEN2_INCLUDE_DIR NAMES Eigen/Core
+ PATHS
+ ${INCLUDE_INSTALL_DIR}
+ ${KDE4_INCLUDE_DIR}
+ PATH_SUFFIXES eigen2
+ )
+
+if(EIGEN2_INCLUDE_DIR)
+ _eigen2_get_version()
+endif(EIGEN2_INCLUDE_DIR)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Eigen2 REQUIRED_VARS EIGEN2_INCLUDE_DIR
+ VERSION_VAR EIGEN2_VERSION)
+
+mark_as_advanced(EIGEN2_INCLUDE_DIR)
+
+
diff --git a/kdecore/cmake/modules/FindExiv2.cmake b/kdecore/cmake/modules/FindExiv2.cmake
new file mode 100644
index 0000000..f929269
--- /dev/null
+++ b/kdecore/cmake/modules/FindExiv2.cmake
@@ -0,0 +1,80 @@
+# - Try to find the Exiv2 library
+#
+# EXIV2_MIN_VERSION - You can set this variable to the minimum version you need
+# before doing FIND_PACKAGE(Exiv2). The default is 0.12.
+#
+# Once done this will define
+#
+# EXIV2_FOUND - system has libexiv2
+# EXIV2_INCLUDE_DIR - the libexiv2 include directory
+# EXIV2_LIBRARIES - Link these to use libexiv2
+# EXIV2_DEFINITIONS - Compiler switches required for using libexiv2
+#
+# The minimum required version of Exiv2 can be specified using the
+# standard syntax, e.g. find_package(Exiv2 0.17)
+#
+# For compatiblity, also the variable EXIV2_MIN_VERSION can be set to the minimum version
+# you need before doing FIND_PACKAGE(Exiv2). The default is 0.12.
+
+# Copyright (c) 2010, Alexander Neundorf, <neundorf@kde.org>
+# Copyright (c) 2008, Gilles Caulier, <caulier.gilles@gmail.com>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+# Support EXIV2_MIN_VERSION for compatibility:
+if(NOT Exiv2_FIND_VERSION)
+ set(Exiv2_FIND_VERSION "${EXIV2_MIN_VERSION}")
+endif(NOT Exiv2_FIND_VERSION)
+
+# the minimum version of exiv2 we require
+if(NOT Exiv2_FIND_VERSION)
+ set(Exiv2_FIND_VERSION "0.12")
+endif(NOT Exiv2_FIND_VERSION)
+
+
+if (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ find_package(PkgConfig)
+ pkg_check_modules(PC_EXIV2 QUIET exiv2)
+ set(EXIV2_DEFINITIONS ${PC_EXIV2_CFLAGS_OTHER})
+endif (NOT WIN32)
+
+
+find_path(EXIV2_INCLUDE_DIR NAMES exiv2/exif.hpp
+ HINTS
+ ${PC_EXIV2_INCLUDEDIR}
+ ${PC_EXIV2_INCLUDE_DIRS}
+ )
+
+find_library(EXIV2_LIBRARY NAMES exiv2 libexiv2
+ HINTS
+ ${PC_EXIV2_LIBDIR}
+ ${PC_EXIV2_LIBRARY_DIRS}
+ )
+
+
+# Get the version number from exiv2/version.hpp and store it in the cache:
+if(EXIV2_INCLUDE_DIR AND NOT EXIV2_VERSION)
+ file(READ ${EXIV2_INCLUDE_DIR}/exiv2/version.hpp EXIV2_VERSION_CONTENT)
+ string(REGEX MATCH "#define EXIV2_MAJOR_VERSION +\\( *([0-9]+) *\\)" _dummy "${EXIV2_VERSION_CONTENT}")
+ set(EXIV2_VERSION_MAJOR "${CMAKE_MATCH_1}")
+
+ string(REGEX MATCH "#define EXIV2_MINOR_VERSION +\\( *([0-9]+) *\\)" _dummy "${EXIV2_VERSION_CONTENT}")
+ set(EXIV2_VERSION_MINOR "${CMAKE_MATCH_1}")
+
+ string(REGEX MATCH "#define EXIV2_PATCH_VERSION +\\( *([0-9]+) *\\)" _dummy "${EXIV2_VERSION_CONTENT}")
+ set(EXIV2_VERSION_PATCH "${CMAKE_MATCH_1}")
+
+ set(EXIV2_VERSION "${EXIV2_VERSION_MAJOR}.${EXIV2_VERSION_MINOR}.${EXIV2_VERSION_PATCH}" CACHE STRING "Version number of Exiv2" FORCE)
+endif(EXIV2_INCLUDE_DIR AND NOT EXIV2_VERSION)
+
+set(EXIV2_LIBRARIES "${EXIV2_LIBRARY}")
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Exiv2 REQUIRED_VARS EXIV2_LIBRARY EXIV2_INCLUDE_DIR
+ VERSION_VAR EXIV2_VERSION)
+
+mark_as_advanced(EXIV2_INCLUDE_DIR EXIV2_LIBRARY)
+
diff --git a/kdecore/cmake/modules/FindFAM.cmake b/kdecore/cmake/modules/FindFAM.cmake
new file mode 100644
index 0000000..7a598fd
--- /dev/null
+++ b/kdecore/cmake/modules/FindFAM.cmake
@@ -0,0 +1,22 @@
+# - Try to find the FAM directory notification library
+# Once done this will define
+#
+# FAM_FOUND - system has FAM
+# FAM_INCLUDE_DIR - the FAM include directory
+# FAM_LIBRARIES - The libraries needed to use FAM
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+FIND_PATH(FAM_INCLUDE_DIR fam.h)
+
+FIND_LIBRARY(FAM_LIBRARIES NAMES fam )
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(FAM DEFAULT_MSG FAM_INCLUDE_DIR FAM_LIBRARIES )
+
+MARK_AS_ADVANCED(FAM_INCLUDE_DIR FAM_LIBRARIES)
+
diff --git a/kdecore/cmake/modules/FindFFmpeg.cmake b/kdecore/cmake/modules/FindFFmpeg.cmake
new file mode 100644
index 0000000..526be5f
--- /dev/null
+++ b/kdecore/cmake/modules/FindFFmpeg.cmake
@@ -0,0 +1,148 @@
+# vim: ts=2 sw=2
+# - Try to find the required ffmpeg components(default: AVFORMAT, AVUTIL, AVCODEC)
+#
+# Once done this will define
+# FFMPEG_FOUND - System has the all required components.
+# FFMPEG_INCLUDE_DIRS - Include directory necessary for using the required components headers.
+# FFMPEG_LIBRARIES - Link these to use the required ffmpeg components.
+# FFMPEG_DEFINITIONS - Compiler switches required for using the required ffmpeg components.
+#
+# For each of the components it will additionaly set.
+# - AVCODEC
+# - AVDEVICE
+# - AVFORMAT
+# - AVUTIL
+# - POSTPROCESS
+# - SWSCALE
+# the following variables will be defined
+# <component>_FOUND - System has <component>
+# <component>_INCLUDE_DIRS - Include directory necessary for using the <component> headers
+# <component>_LIBRARIES - Link these to use <component>
+# <component>_DEFINITIONS - Compiler switches required for using <component>
+# <component>_VERSION - The components version
+#
+# Copyright (c) 2006, Matthias Kretz, <kretz@kde.org>
+# Copyright (c) 2008, Alexander Neundorf, <neundorf@kde.org>
+# Copyright (c) 2011, Michael Jansen, <kde@michael-jansen.biz>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+include(FindPackageHandleStandardArgs)
+
+# The default components were taken from a survey over other FindFFMPEG.cmake files
+if (NOT FFmpeg_FIND_COMPONENTS)
+ set(FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL)
+endif ()
+
+#
+### Macro: set_component_found
+#
+# Marks the given component as found if both *_LIBRARIES AND *_INCLUDE_DIRS is present.
+#
+macro(set_component_found _component )
+ if (${_component}_LIBRARIES AND ${_component}_INCLUDE_DIRS)
+ # message(STATUS " - ${_component} found.")
+ set(${_component}_FOUND TRUE)
+ else ()
+ # message(STATUS " - ${_component} not found.")
+ endif ()
+endmacro()
+
+#
+### Macro: find_component
+#
+# Checks for the given component by invoking pkgconfig and then looking up the libraries and
+# include directories.
+#
+macro(find_component _component _pkgconfig _library _header)
+
+ if (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ find_package(PkgConfig)
+ if (PKG_CONFIG_FOUND)
+ pkg_check_modules(PC_${_component} ${_pkgconfig})
+ endif ()
+ endif (NOT WIN32)
+
+ find_path(${_component}_INCLUDE_DIRS ${_header}
+ HINTS
+ ${PC_LIB${_component}_INCLUDEDIR}
+ ${PC_LIB${_component}_INCLUDE_DIRS}
+ PATH_SUFFIXES
+ ffmpeg
+ )
+
+ find_library(${_component}_LIBRARIES NAMES ${_library}
+ HINTS
+ ${PC_LIB${_component}_LIBDIR}
+ ${PC_LIB${_component}_LIBRARY_DIRS}
+ )
+
+ set(${_component}_DEFINITIONS ${PC_${_component}_CFLAGS_OTHER} CACHE STRING "The ${_component} CFLAGS.")
+ set(${_component}_VERSION ${PC_${_component}_VERSION} CACHE STRING "The ${_component} version number.")
+
+ set_component_found(${_component})
+
+ mark_as_advanced(
+ ${_component}_INCLUDE_DIRS
+ ${_component}_LIBRARIES
+ ${_component}_DEFINITIONS
+ ${_component}_VERSION)
+
+endmacro()
+
+
+# Check for cached results. If there are skip the costly part.
+if (NOT FFMPEG_LIBRARIES)
+
+ # Check for all possible component.
+ find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h)
+ find_component(AVFORMAT libavformat avformat libavformat/avformat.h)
+ find_component(AVDEVICE libavdevice avdevice libavdevice/avdevice.h)
+ find_component(AVUTIL libavutil avutil libavutil/avutil.h)
+ find_component(SWSCALE libswscale swscale libswscale/swscale.h)
+ find_component(POSTPROC libpostproc postproc libpostproc/postprocess.h)
+
+ # Check if the required components were found and add their stuff to the FFMPEG_* vars.
+ foreach (_component ${FFmpeg_FIND_COMPONENTS})
+ if (${_component}_FOUND)
+ # message(STATUS "Required component ${_component} present.")
+ set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${_component}_LIBRARIES})
+ set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${_component}_DEFINITIONS})
+ list(APPEND FFMPEG_INCLUDE_DIRS ${${_component}_INCLUDE_DIRS})
+ else ()
+ # message(STATUS "Required component ${_component} missing.")
+ endif ()
+ endforeach ()
+
+ # Build the include path with duplicates removed.
+ if (FFMPEG_INCLUDE_DIRS)
+ list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
+ endif ()
+
+ # cache the vars.
+ set(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} CACHE STRING "The FFmpeg include directories." FORCE)
+ set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE STRING "The FFmpeg libraries." FORCE)
+ set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} CACHE STRING "The FFmpeg cflags." FORCE)
+
+ mark_as_advanced(FFMPEG_INCLUDE_DIRS
+ FFMPEG_LIBRARIES
+ FFMPEG_DEFINITIONS)
+
+endif ()
+
+# Now set the noncached _FOUND vars for the components.
+foreach (_component AVCODEC AVDEVICE AVFORMAT AVUTIL POSTPROCESS SWSCALE)
+ set_component_found(${_component})
+endforeach ()
+
+# Compile the list of required vars
+set(_FFmpeg_REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS)
+foreach (_component ${FFmpeg_FIND_COMPONENTS})
+ list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES ${_component}_INCLUDE_DIRS)
+endforeach ()
+
+# Give a nice error message if some of the required vars are missing.
+find_package_handle_standard_args(FFmpeg DEFAULT_MSG ${_FFmpeg_REQUIRED_VARS})
diff --git a/kdecore/cmake/modules/FindFlac.cmake b/kdecore/cmake/modules/FindFlac.cmake
new file mode 100644
index 0000000..208e3fc
--- /dev/null
+++ b/kdecore/cmake/modules/FindFlac.cmake
@@ -0,0 +1,34 @@
+# - Try to find Flac, the Free Lossless Audio Codec
+# Once done this will define
+#
+# FLAC_FOUND - system has Flac
+# FLAC_INCLUDE_DIR - the Flac include directory
+# FLAC_LIBRARIES - Link these to use Flac
+# FLAC_OGGFLAC_LIBRARIES - Link these to use OggFlac
+#
+# No version checking is done - use FLAC_API_VERSION_CURRENT to
+# conditionally compile version-dependent code
+
+# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+FIND_PATH(FLAC_INCLUDE_DIR FLAC/metadata.h)
+
+FIND_LIBRARY(FLAC_LIBRARIES NAMES FLAC )
+
+FIND_LIBRARY(FLAC_OGG_LIBRARY NAMES OggFLAC)
+
+
+IF(FLAC_LIBRARIES AND FLAC_OGG_LIBRARY)
+ SET(FLAC_OGGFLAC_LIBRARIES ${FLAC_OGG_LIBRARY} ${FLAC_LIBRARIES})
+ENDIF(FLAC_LIBRARIES AND FLAC_OGG_LIBRARY)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Flac REQUIRED_VARS FLAC_LIBRARIES FLAC_INCLUDE_DIR)
+
+# show the FLAC_INCLUDE_DIR and FLAC_LIBRARIES variables only in the advanced view
+MARK_AS_ADVANCED(FLAC_INCLUDE_DIR FLAC_LIBRARIES FLAC_OGG_LIBRARY)
+
diff --git a/kdecore/cmake/modules/FindFlex.cmake b/kdecore/cmake/modules/FindFlex.cmake
new file mode 100644
index 0000000..6e54c5c
--- /dev/null
+++ b/kdecore/cmake/modules/FindFlex.cmake
@@ -0,0 +1,35 @@
+# - Try to find Flex
+# Once done this will define
+#
+# FLEX_FOUND - system has Flex
+# FLEX_EXECUTABLE - path of the flex executable
+# FLEX_VERSION - the version string, like "2.5.31"
+#
+# The minimum required version of Flex can be specified using the
+# standard syntax, e.g. find_package(Flex 2.5)
+
+
+# Copyright (c) 2008, Jakob Petsovits, <jpetso@gmx.at>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+FIND_PROGRAM(FLEX_EXECUTABLE NAMES flex)
+FIND_PATH(FLEX_INCLUDE_DIR FlexLexer.h )
+FIND_LIBRARY(FLEX_LIBRARY fl)
+
+IF(FLEX_EXECUTABLE AND NOT FLEX_VERSION)
+
+ EXECUTE_PROCESS(COMMAND ${FLEX_EXECUTABLE} --version
+ OUTPUT_VARIABLE _FLEX_VERSION_OUTPUT
+ )
+ STRING (REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" _FLEX_VERSION "${_FLEX_VERSION_OUTPUT}")
+ SET(FLEX_VERSION "${_FLEX_VERSION}" CACHE STRING "Version number of Flex" FORCE)
+ENDIF(FLEX_EXECUTABLE AND NOT FLEX_VERSION)
+
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Flex REQUIRED_VARS FLEX_EXECUTABLE
+ VERSION_VAR FLEX_VERSION )
+
+MARK_AS_ADVANCED(FLEX_INCLUDE_DIR FLEX_LIBRARY FLEX_EXECUTABLE)
diff --git a/kdecore/cmake/modules/FindFontconfig.cmake b/kdecore/cmake/modules/FindFontconfig.cmake
new file mode 100644
index 0000000..d95e46b
--- /dev/null
+++ b/kdecore/cmake/modules/FindFontconfig.cmake
@@ -0,0 +1,50 @@
+# - Try to find the Fontconfig
+# Once done this will define
+#
+# FONTCONFIG_FOUND - system has Fontconfig
+# FONTCONFIG_INCLUDE_DIR - The include directory to use for the fontconfig headers
+# FONTCONFIG_LIBRARIES - Link these to use FONTCONFIG
+# FONTCONFIG_DEFINITIONS - Compiler switches required for using FONTCONFIG
+
+# Copyright (c) 2006,2007 Laurent Montel, <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
+
+ # in cache already
+ set(FONTCONFIG_FOUND TRUE)
+
+else (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
+
+ if (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ find_package(PkgConfig)
+ pkg_check_modules(PC_FONTCONFIG QUIET fontconfig)
+
+ set(FONTCONFIG_DEFINITIONS ${PC_FONTCONFIG_CFLAGS_OTHER})
+ endif (NOT WIN32)
+
+ find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h
+ PATHS
+ ${PC_FONTCONFIG_INCLUDEDIR}
+ ${PC_FONTCONFIG_INCLUDE_DIRS}
+ /usr/X11/include
+ )
+
+ find_library(FONTCONFIG_LIBRARIES NAMES fontconfig
+ PATHS
+ ${PC_FONTCONFIG_LIBDIR}
+ ${PC_FONTCONFIG_LIBRARY_DIRS}
+ )
+
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR )
+
+ mark_as_advanced(FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIR)
+
+endif (FONTCONFIG_LIBRARIES AND FONTCONFIG_INCLUDE_DIR)
+
diff --git a/kdecore/cmake/modules/FindFreetype.cmake b/kdecore/cmake/modules/FindFreetype.cmake
new file mode 100644
index 0000000..61e44a1
--- /dev/null
+++ b/kdecore/cmake/modules/FindFreetype.cmake
@@ -0,0 +1,73 @@
+# - Try to find the freetype library
+# Once done this will define
+#
+# FREETYPE_FOUND - system has Freetype
+# FREETYPE_INCLUDE_DIRS - the FREETYPE include directories
+# FREETYPE_LIBRARIES - Link these to use FREETYPE
+# FREETYPE_INCLUDE_DIR - internal
+
+# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if (FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIR)
+
+ # in cache already
+ set(FREETYPE_FOUND TRUE)
+
+else (FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIR)
+
+ find_program(FREETYPECONFIG_EXECUTABLE NAMES freetype-config PATHS
+ /opt/local/bin
+ )
+
+ #reset vars
+ set(FREETYPE_LIBRARIES)
+ set(FREETYPE_INCLUDE_DIR)
+
+ # if freetype-config has been found
+ if(FREETYPECONFIG_EXECUTABLE)
+
+ exec_program(${FREETYPECONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE FREETYPE_LIBRARIES)
+
+ exec_program(${FREETYPECONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _freetype_pkgconfig_output)
+ if(FREETYPE_LIBRARIES AND _freetype_pkgconfig_output)
+ set(FREETYPE_FOUND TRUE)
+
+ # freetype-config can print out more than one -I, so we need to chop it up
+ # into a list and process each entry separately
+ separate_arguments(_freetype_pkgconfig_output)
+ foreach(value ${_freetype_pkgconfig_output})
+ string(REGEX REPLACE "-I(.+)" "\\1" value "${value}")
+ set(FREETYPE_INCLUDE_DIR ${FREETYPE_INCLUDE_DIR} ${value})
+ endforeach(value)
+ endif(FREETYPE_LIBRARIES AND _freetype_pkgconfig_output)
+
+ set( FREETYPE_LIBRARIES ${FREETYPE_LIBRARIES} )
+
+ mark_as_advanced(FREETYPE_LIBRARIES FREETYPE_INCLUDE_DIR)
+
+ else(FREETYPECONFIG_EXECUTABLE)
+ find_path (FREETYPE_INCLUDE_DIR freetype/freetype.h PATH_SUFFIXES freetype2)
+ find_library(FREETYPE_LIBRARIES freetype)
+ if(FREETYPE_INCLUDE_DIR AND FREETYPE_LIBRARIES)
+ set(FREETYPE_FOUND TRUE)
+ endif(FREETYPE_INCLUDE_DIR AND FREETYPE_LIBRARIES)
+ endif(FREETYPECONFIG_EXECUTABLE)
+
+
+ if (FREETYPE_FOUND)
+ if (NOT Freetype_FIND_QUIETLY)
+ message(STATUS "Found Freetype: ${FREETYPE_LIBRARIES}")
+ endif (NOT Freetype_FIND_QUIETLY)
+ else (FREETYPE_FOUND)
+ if (Freetype_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find FreeType library")
+ endif (Freetype_FIND_REQUIRED)
+ endif (FREETYPE_FOUND)
+
+endif (FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIR)
+
+set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR}")
diff --git a/kdecore/cmake/modules/FindGIF.cmake b/kdecore/cmake/modules/FindGIF.cmake
new file mode 100644
index 0000000..3dc400c
--- /dev/null
+++ b/kdecore/cmake/modules/FindGIF.cmake
@@ -0,0 +1,39 @@
+# - Try to find GIF
+# Once done this will define
+#
+# GIF_FOUND - system has GIF
+# GIF_INCLUDE_DIR - the GIF include directory
+# GIF_LIBRARIES - Libraries needed to use GIF
+# GIF_DEFINITIONS - Compiler switches required for using GIF
+
+# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
+# See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
+
+IF (GIF_INCLUDE_DIR AND GIF_LIBRARIES)
+ # Already in cache, be silent
+ SET(GIF_FIND_QUIETLY TRUE)
+ENDIF (GIF_INCLUDE_DIR AND GIF_LIBRARIES)
+
+FIND_PATH(GIF_INCLUDE_DIR gif_lib.h)
+
+SET(POTENTIAL_GIF_LIBS gif libgif ungif libungif giflib giflib4)
+FIND_LIBRARY(GIF_LIBRARIES NAMES ${POTENTIAL_GIF_LIBS})
+
+IF (GIF_INCLUDE_DIR AND GIF_LIBRARIES)
+ SET(CMAKE_REQUIRED_INCLUDES "${GIF_INCLUDE_DIR}" "${CMAKE_REQUIRED_INCLUDES}")
+ CHECK_STRUCT_MEMBER(GifFileType UserData gif_lib.h GIF_FOUND)
+ENDIF (GIF_INCLUDE_DIR AND GIF_LIBRARIES)
+
+IF (GIF_FOUND)
+ IF (NOT GIF_FIND_QUIETLY)
+ MESSAGE(STATUS "Found GIF: ${GIF_LIBRARIES}")
+ ENDIF (NOT GIF_FIND_QUIETLY)
+ELSE (GIF_FOUND)
+ IF (GIF_FIND_REQUIRED)
+ MESSAGE(STATUS "Looked for GIF libraries named ${POTENTIAL_GIF_LIBS}.")
+ MESSAGE(STATUS "Found no acceptable GIF library. This is fatal.")
+ MESSAGE(FATAL_ERROR "Could NOT find GIF")
+ ENDIF (GIF_FIND_REQUIRED)
+ENDIF (GIF_FOUND)
+
+MARK_AS_ADVANCED(GIF_INCLUDE_DIR GIF_LIBRARIES)
diff --git a/kdecore/cmake/modules/FindGLIB2.cmake b/kdecore/cmake/modules/FindGLIB2.cmake
new file mode 100644
index 0000000..09fd98d
--- /dev/null
+++ b/kdecore/cmake/modules/FindGLIB2.cmake
@@ -0,0 +1,52 @@
+# - Try to find the GLIB2 libraries
+# Once done this will define
+#
+# GLIB2_FOUND - system has glib2
+# GLIB2_INCLUDE_DIR - the glib2 include directory
+# GLIB2_LIBRARIES - glib2 library
+
+# Copyright (c) 2008 Laurent Montel, <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES)
+ # Already in cache, be silent
+ set(GLIB2_FIND_QUIETLY TRUE)
+endif(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES)
+
+find_package(PkgConfig)
+pkg_check_modules(PC_LibGLIB2 QUIET glib-2.0)
+
+find_path(GLIB2_MAIN_INCLUDE_DIR
+ NAMES glib.h
+ HINTS ${PC_LibGLIB2_INCLUDEDIR}
+ PATH_SUFFIXES glib-2.0)
+
+find_library(GLIB2_LIBRARY
+ NAMES glib-2.0
+ HINTS ${PC_LibGLIB2_LIBDIR}
+)
+
+set(GLIB2_LIBRARIES ${GLIB2_LIBRARY})
+
+# search the glibconfig.h include dir under the same root where the library is found
+get_filename_component(glib2LibDir "${GLIB2_LIBRARIES}" PATH)
+
+find_path(GLIB2_INTERNAL_INCLUDE_DIR glibconfig.h
+ PATH_SUFFIXES glib-2.0/include
+ HINTS ${PC_LibGLIB2_INCLUDEDIR} "${glib2LibDir}" ${CMAKE_SYSTEM_LIBRARY_PATH})
+
+set(GLIB2_INCLUDE_DIR "${GLIB2_MAIN_INCLUDE_DIR}")
+
+# not sure if this include dir is optional or required
+# for now it is optional
+if(GLIB2_INTERNAL_INCLUDE_DIR)
+ set(GLIB2_INCLUDE_DIR ${GLIB2_INCLUDE_DIR} "${GLIB2_INTERNAL_INCLUDE_DIR}")
+endif(GLIB2_INTERNAL_INCLUDE_DIR)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(GLIB2 DEFAULT_MSG GLIB2_LIBRARIES GLIB2_MAIN_INCLUDE_DIR)
+
+mark_as_advanced(GLIB2_INCLUDE_DIR GLIB2_LIBRARIES)
diff --git a/kdecore/cmake/modules/FindGMP.cmake b/kdecore/cmake/modules/FindGMP.cmake
new file mode 100644
index 0000000..17d175c
--- /dev/null
+++ b/kdecore/cmake/modules/FindGMP.cmake
@@ -0,0 +1,23 @@
+# Try to find the GMP librairies
+# GMP_FOUND - system has GMP lib
+# GMP_INCLUDE_DIR - the GMP include directory
+# GMP_LIBRARIES - Libraries needed to use GMP
+
+# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if (GMP_INCLUDE_DIR AND GMP_LIBRARIES)
+ # Already in cache, be silent
+ set(GMP_FIND_QUIETLY TRUE)
+endif (GMP_INCLUDE_DIR AND GMP_LIBRARIES)
+
+find_path(GMP_INCLUDE_DIR NAMES gmp.h )
+find_library(GMP_LIBRARIES NAMES gmp libgmp)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMP DEFAULT_MSG GMP_INCLUDE_DIR GMP_LIBRARIES)
+
+mark_as_advanced(GMP_INCLUDE_DIR GMP_LIBRARIES)
diff --git a/kdecore/cmake/modules/FindGObject.cmake b/kdecore/cmake/modules/FindGObject.cmake
new file mode 100644
index 0000000..af0c9f7
--- /dev/null
+++ b/kdecore/cmake/modules/FindGObject.cmake
@@ -0,0 +1,52 @@
+# - Try to find GObject
+# Once done this will define
+#
+# GOBJECT_FOUND - system has GObject
+# GOBJECT_INCLUDE_DIR - the GObject include directory
+# GOBJECT_LIBRARIES - the libraries needed to use GObject
+# GOBJECT_DEFINITIONS - Compiler switches required for using GObject
+
+# Copyright (c) 2011, Raphael Kubo da Costa <kubito@gmail.com>
+# Copyright (c) 2006, Tim Beaulen <tbscope@gmail.com>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+FIND_PACKAGE(PkgConfig)
+PKG_CHECK_MODULES(PC_GOBJECT gobject-2.0)
+SET(GOBJECT_DEFINITIONS ${PC_GOBJECT_CFLAGS_OTHER})
+
+FIND_PATH(GOBJECT_INCLUDE_DIR gobject.h
+ HINTS
+ ${PC_GOBJECT_INCLUDEDIR}
+ ${PC_GOBJECT_INCLUDE_DIRS}
+ PATH_SUFFIXES glib-2.0/gobject/
+ )
+
+FIND_LIBRARY(_GObjectLibs NAMES gobject-2.0
+ HINTS
+ ${PC_GOBJECT_LIBDIR}
+ ${PC_GOBJECT_LIBRARY_DIRS}
+ )
+FIND_LIBRARY(_GModuleLibs NAMES gmodule-2.0
+ HINTS
+ ${PC_GOBJECT_LIBDIR}
+ ${PC_GOBJECT_LIBRARY_DIRS}
+ )
+FIND_LIBRARY(_GThreadLibs NAMES gthread-2.0
+ HINTS
+ ${PC_GOBJECT_LIBDIR}
+ ${PC_GOBJECT_LIBRARY_DIRS}
+ )
+FIND_LIBRARY(_GLibs NAMES glib-2.0
+ HINTS
+ ${PC_GOBJECT_LIBDIR}
+ ${PC_GOBJECT_LIBRARY_DIRS}
+ )
+
+SET( GOBJECT_LIBRARIES ${_GObjectLibs} ${_GModuleLibs} ${_GThreadLibs} ${_GLibs} )
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GOBJECT DEFAULT_MSG GOBJECT_LIBRARIES GOBJECT_INCLUDE_DIR)
+
+MARK_AS_ADVANCED(GOBJECT_INCLUDE_DIR _GObjectLibs _GModuleLibs _GThreadLibs _GLibs)
diff --git a/kdecore/cmake/modules/FindGSSAPI.cmake b/kdecore/cmake/modules/FindGSSAPI.cmake
new file mode 100644
index 0000000..0951c67
--- /dev/null
+++ b/kdecore/cmake/modules/FindGSSAPI.cmake
@@ -0,0 +1,78 @@
+# - Try to detect the GSSAPI support
+# Once done this will define
+#
+# GSSAPI_FOUND - system supports GSSAPI
+# GSSAPI_INCS - the GSSAPI include directory
+# GSSAPI_LIBS - the libraries needed to use GSSAPI
+# GSSAPI_FLAVOR - the type of API - MIT or HEIMDAL
+
+# Copyright (c) 2006, Pino Toscano, <toscano.pino@tiscali.it>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if(GSSAPI_LIBS AND GSSAPI_FLAVOR)
+
+ # in cache already
+ set(GSSAPI_FOUND TRUE)
+
+else(GSSAPI_LIBS AND GSSAPI_FLAVOR)
+
+ find_program(KRB5_CONFIG NAMES krb5-config PATHS
+ /opt/local/bin
+ ONLY_CMAKE_FIND_ROOT_PATH # this is required when cross compiling with cmake 2.6 and ignored with cmake 2.4, Alex
+ )
+ mark_as_advanced(KRB5_CONFIG)
+
+ #reset vars
+ set(GSSAPI_INCS)
+ set(GSSAPI_LIBS)
+ set(GSSAPI_FLAVOR)
+
+ if(KRB5_CONFIG)
+
+ set(HAVE_KRB5_GSSAPI TRUE)
+ exec_program(${KRB5_CONFIG} ARGS --libs gssapi RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GSSAPI_LIBS)
+ if(_return_VALUE)
+ message(STATUS "GSSAPI configure check failed.")
+ set(HAVE_KRB5_GSSAPI FALSE)
+ endif(_return_VALUE)
+
+ exec_program(${KRB5_CONFIG} ARGS --cflags gssapi RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GSSAPI_INCS)
+ string(REGEX REPLACE "(\r?\n)+$" "" GSSAPI_INCS "${GSSAPI_INCS}")
+ string(REGEX REPLACE " *-I" ";" GSSAPI_INCS "${GSSAPI_INCS}")
+
+ exec_program(${KRB5_CONFIG} ARGS --vendor RETURN_VALUE _return_VALUE OUTPUT_VARIABLE gssapi_flavor_tmp)
+ set(GSSAPI_FLAVOR_MIT)
+ if(gssapi_flavor_tmp MATCHES ".*Massachusetts.*")
+ set(GSSAPI_FLAVOR "MIT")
+ else(gssapi_flavor_tmp MATCHES ".*Massachusetts.*")
+ set(GSSAPI_FLAVOR "HEIMDAL")
+ endif(gssapi_flavor_tmp MATCHES ".*Massachusetts.*")
+
+ if(NOT HAVE_KRB5_GSSAPI)
+ if (gssapi_flavor_tmp MATCHES "Sun Microsystems.*")
+ message(STATUS "Solaris Kerberos does not have GSSAPI; this is normal.")
+ set(GSSAPI_LIBS)
+ set(GSSAPI_INCS)
+ else(gssapi_flavor_tmp MATCHES "Sun Microsystems.*")
+ message(WARNING "${KRB5_CONFIG} failed unexpectedly.")
+ endif(gssapi_flavor_tmp MATCHES "Sun Microsystems.*")
+ endif(NOT HAVE_KRB5_GSSAPI)
+
+ if(GSSAPI_LIBS) # GSSAPI_INCS can be also empty, so don't rely on that
+ set(GSSAPI_FOUND TRUE)
+ message(STATUS "Found GSSAPI: ${GSSAPI_LIBS}")
+
+ set(GSSAPI_INCS ${GSSAPI_INCS})
+ set(GSSAPI_LIBS ${GSSAPI_LIBS})
+ set(GSSAPI_FLAVOR ${GSSAPI_FLAVOR})
+
+ mark_as_advanced(GSSAPI_INCS GSSAPI_LIBS GSSAPI_FLAVOR)
+
+ endif(GSSAPI_LIBS)
+
+ endif(KRB5_CONFIG)
+
+endif(GSSAPI_LIBS AND GSSAPI_FLAVOR)
diff --git a/kdecore/cmake/modules/FindGStreamer.cmake b/kdecore/cmake/modules/FindGStreamer.cmake
new file mode 100644
index 0000000..4379371
--- /dev/null
+++ b/kdecore/cmake/modules/FindGStreamer.cmake
@@ -0,0 +1,80 @@
+# - Try to find GStreamer
+# Once done this will define
+#
+# GSTREAMER_FOUND - system has GStreamer
+# GSTREAMER_INCLUDE_DIR - the GStreamer include directory
+# GSTREAMER_LIBRARIES - the libraries needed to use GStreamer
+# GSTREAMER_DEFINITIONS - Compiler switches required for using GStreamer
+
+# Copyright (c) 2006, Tim Beaulen <tbscope@gmail.com>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+# TODO: Other versions --> GSTREAMER_X_Y_FOUND (Example: GSTREAMER_0_8_FOUND and GSTREAMER_0_10_FOUND etc)
+
+IF (GSTREAMER_INCLUDE_DIR AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY)
+ # in cache already
+ SET(GStreamer_FIND_QUIETLY TRUE)
+ELSE (GSTREAMER_INCLUDE_DIR AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY)
+ SET(GStreamer_FIND_QUIETLY FALSE)
+ENDIF (GSTREAMER_INCLUDE_DIR AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY)
+
+IF (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ FIND_PACKAGE(PkgConfig)
+ PKG_CHECK_MODULES(PC_GSTREAMER QUIET gstreamer-0.10)
+ #MESSAGE(STATUS "DEBUG: GStreamer include directory = ${GSTREAMER_INCLUDE_DIRS}")
+ #MESSAGE(STATUS "DEBUG: GStreamer link directory = ${GSTREAMER_LIBRARY_DIRS}")
+ #MESSAGE(STATUS "DEBUG: GStreamer CFlags = ${GSTREAMER_CFLAGS_OTHER}")
+ SET(GSTREAMER_DEFINITIONS ${PC_GSTREAMER_CFLAGS_OTHER})
+ENDIF (NOT WIN32)
+
+FIND_PATH(GSTREAMER_INCLUDE_DIR gst/gst.h
+ PATHS
+ ${PC_GSTREAMER_INCLUDEDIR}
+ ${PC_GSTREAMER_INCLUDE_DIRS}
+ #PATH_SUFFIXES gst
+ )
+
+FIND_LIBRARY(GSTREAMER_LIBRARIES NAMES gstreamer-0.10
+ PATHS
+ ${PC_GSTREAMER_LIBDIR}
+ ${PC_GSTREAMER_LIBRARY_DIRS}
+ )
+
+FIND_LIBRARY(GSTREAMER_BASE_LIBRARY NAMES gstbase-0.10
+ PATHS
+ ${PC_GSTREAMER_LIBDIR}
+ ${PC_GSTREAMER_LIBRARY_DIRS}
+ )
+
+FIND_LIBRARY(GSTREAMER_INTERFACE_LIBRARY NAMES gstinterfaces-0.10
+ PATHS
+ ${PC_GSTREAMER_LIBDIR}
+ ${PC_GSTREAMER_LIBRARY_DIRS}
+ )
+
+IF (GSTREAMER_INCLUDE_DIR)
+ #MESSAGE(STATUS "DEBUG: Found GStreamer include dir: ${GSTREAMER_INCLUDE_DIR}")
+ELSE (GSTREAMER_INCLUDE_DIR)
+ MESSAGE(STATUS "GStreamer: WARNING: include dir not found")
+ENDIF (GSTREAMER_INCLUDE_DIR)
+
+IF (GSTREAMER_LIBRARIES)
+ #MESSAGE(STATUS "DEBUG: Found GStreamer library: ${GSTREAMER_LIBRARIES}")
+ELSE (GSTREAMER_LIBRARIES)
+ MESSAGE(STATUS "GStreamer: WARNING: library not found")
+ENDIF (GSTREAMER_LIBRARIES)
+
+IF (GSTREAMER_INTERFACE_LIBRARY)
+ #MESSAGE(STATUS "DEBUG: Found GStreamer interface library: ${GSTREAMER_INTERFACE_LIBRARY}")
+ELSE (GSTREAMER_INTERFACE_LIBRARY)
+ MESSAGE(STATUS "GStreamer: WARNING: interface library not found")
+ENDIF (GSTREAMER_INTERFACE_LIBRARY)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GStreamer DEFAULT_MSG GSTREAMER_LIBRARIES GSTREAMER_INCLUDE_DIR GSTREAMER_BASE_LIBRARY GSTREAMER_INTERFACE_LIBRARY)
+
+MARK_AS_ADVANCED(GSTREAMER_INCLUDE_DIR GSTREAMER_LIBRARIES GSTREAMER_BASE_LIBRARY GSTREAMER_INTERFACE_LIBRARY)
diff --git a/kdecore/cmake/modules/FindGettext.cmake b/kdecore/cmake/modules/FindGettext.cmake
new file mode 100644
index 0000000..91e88f7
--- /dev/null
+++ b/kdecore/cmake/modules/FindGettext.cmake
@@ -0,0 +1,246 @@
+# Try to find Gettext functionality
+# Once done this will define
+#
+# GETTEXT_FOUND - system has Gettext
+# GETTEXT_INCLUDE_DIR - Gettext include directory
+# GETTEXT_LIBRARIES - Libraries needed to use Gettext
+
+# TODO: This will enable translations only if Gettext functionality is
+# present in libc. Must have more robust system for release, where Gettext
+# functionality can also reside in standalone Gettext library, or the one
+# embedded within kdelibs (cf. gettext.m4 from Gettext source).
+#
+# Copyright (c) 2006, Chusslove Illich, <caslav.ilic@gmx.net>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if (LIBC_HAS_DGETTEXT OR LIBINTL_HAS_DGETTEXT)
+
+ # in cache already
+ set(GETTEXT_FOUND TRUE)
+
+else (LIBC_HAS_DGETTEXT OR LIBINTL_HAS_DGETTEXT)
+
+ include(CheckLibraryExists)
+ include(CheckFunctionExists)
+
+ find_path(GETTEXT_INCLUDE_DIR libintl.h)
+ if(GETTEXT_INCLUDE_DIR)
+ set(HAVE_LIBINTL_H 1)
+ else(GETTEXT_INCLUDE_DIR)
+ set(HAVE_LIBINTL_H 0)
+ endif(GETTEXT_INCLUDE_DIR)
+
+ set(GETTEXT_LIBRARIES)
+
+ if (HAVE_LIBINTL_H)
+ check_function_exists(dgettext LIBC_HAS_DGETTEXT)
+ if (LIBC_HAS_DGETTEXT)
+ set(GETTEXT_SOURCE "built in libc")
+ set(GETTEXT_FOUND TRUE)
+ else (LIBC_HAS_DGETTEXT)
+ find_library(LIBINTL_LIBRARY NAMES intl libintl )
+
+ check_library_exists(${LIBINTL_LIBRARY} "dgettext" "" LIBINTL_HAS_DGETTEXT)
+ if (LIBINTL_HAS_DGETTEXT)
+ set(GETTEXT_SOURCE "in ${LIBINTL_LIBRARY}")
+ set(GETTEXT_LIBRARIES ${LIBINTL_LIBRARY})
+ set(GETTEXT_FOUND TRUE)
+ endif (LIBINTL_HAS_DGETTEXT)
+ endif (LIBC_HAS_DGETTEXT)
+ endif (HAVE_LIBINTL_H)
+
+ if (GETTEXT_FOUND)
+ if (NOT Gettext_FIND_QUIETLY)
+ message(STATUS "Found Gettext: ${GETTEXT_SOURCE}")
+ endif (NOT Gettext_FIND_QUIETLY)
+ else (GETTEXT_FOUND)
+ if (Gettext_FIND_REQUIRED)
+ message(FATAL_ERROR "Could NOT find Gettext")
+ endif (Gettext_FIND_REQUIRED)
+ endif (GETTEXT_FOUND)
+
+ mark_as_advanced(GETTEXT_INCLUDE_DIR GETTEXT_LIBRARIES)
+
+endif (LIBC_HAS_DGETTEXT OR LIBINTL_HAS_DGETTEXT)
+
+
+# - Find GNU gettext tools
+# This module looks for the GNU gettext tools. This module defines the
+# following values:
+# GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool.
+# GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool.
+# GETTEXT_FOUND: True if gettext has been found.
+#
+# Additionally it provides the following macros:
+# GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN )
+# This will create a target "translations" which will convert the
+# given input po files into the binary output mo file. If the
+# ALL option is used, the translations will also be created when
+# building the default target.
+# GETTEXT_PROCESS_POT( <potfile> [ALL] [INSTALL_DESTINATION <destdir>] <lang1> <lang2> ... )
+# Process the given pot file to mo files.
+# If INSTALL_DESTINATION is given then automatically install rules will be created,
+# the language subdirectory will be taken into account (by default use share/locale/).
+# If ALL is specified, the pot file is processed when building the all traget.
+# It creates a custom target "potfile".
+#
+# GETTEXT_PROCESS_PO_FILES(<lang> [ALL] [INSTALL_DESTINATION <dir>] <po1> <po2> ...)
+# Process the given po files to mo files for the given language.
+# If INSTALL_DESTINATION is given then automatically install rules will be created,
+# the language subdirectory will be taken into account (by default use share/locale/).
+# If ALL is specified, the po files are processed when building the all traget.
+# It creates a custom target "pofiles".
+
+
+
+FIND_PROGRAM(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
+
+FIND_PROGRAM(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
+
+MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFile)
+
+ SET(_gmoFiles)
+ GET_FILENAME_COMPONENT(_potName ${_potFile} NAME)
+ STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})
+ GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE)
+
+ SET(_addToAll)
+ IF(${_firstPoFile} STREQUAL "ALL")
+ SET(_addToAll "ALL")
+ SET(_firstPoFile)
+ ENDIF(${_firstPoFile} STREQUAL "ALL")
+
+ FOREACH (_currentPoFile ${ARGN})
+ GET_FILENAME_COMPONENT(_absFile ${_currentPoFile} ABSOLUTE)
+ GET_FILENAME_COMPONENT(_abs_PATH ${_absFile} PATH)
+ GET_FILENAME_COMPONENT(_lang ${_absFile} NAME_WE)
+ SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)
+
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${_gmoFile}
+ COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_absFile} ${_absPotFile}
+ COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile}
+ DEPENDS ${_absPotFile} ${_absFile}
+ )
+
+ INSTALL(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
+ SET(_gmoFiles ${_gmoFiles} ${_gmoFile})
+
+ ENDFOREACH (_currentPoFile )
+
+ ADD_CUSTOM_TARGET(translations ${_addToAll} DEPENDS ${_gmoFiles})
+
+ENDMACRO(GETTEXT_CREATE_TRANSLATIONS )
+
+# GETTEXT_PROCESS_POT( <potfile> [ALL] [INSTALL_DESTINATION <destdir>] <lang1> <lang2> ... )
+MACRO(GETTEXT_PROCESS_POT_FILE _potFile)
+
+ SET(_gmoFiles)
+ SET(_args ${ARGN})
+ SET(_addToAll)
+ SET(_installDest)
+
+ IF(_args)
+ LIST(GET _args 0 _tmp)
+ IF("${_tmp}" STREQUAL "ALL")
+ SET(_addToAll ALL)
+ LIST(REMOVE_AT _args 0)
+ ENDIF("${_tmp}" STREQUAL "ALL")
+ ENDIF(_args)
+
+ IF(_args)
+ LIST(GET _args 0 _tmp)
+ IF("${_tmp}" STREQUAL "INSTALL_DESTINATION")
+ LIST(GET _args 1 _installDest )
+ LIST(REMOVE_AT _args 0 1)
+ ENDIF("${_tmp}" STREQUAL "INSTALL_DESTINATION")
+ ENDIF(_args)
+
+ GET_FILENAME_COMPONENT(_potName ${_potFile} NAME)
+ STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _potBasename ${_potName})
+ GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE)
+
+# message(STATUS "1 all ${_addToAll} dest ${_installDest} args: ${_args}")
+
+ FOREACH (_lang ${_args})
+ SET(_poFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.po")
+ SET(_gmoFile "${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo")
+
+ ADD_CUSTOM_COMMAND(
+ OUTPUT "${_poFile}"
+ COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_poFile} ${_absPotFile}
+ DEPENDS ${_absPotFile}
+ )
+
+ ADD_CUSTOM_COMMAND(
+ OUTPUT "${_gmoFile}"
+ COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_poFile}
+ DEPENDS ${_absPotFile} ${_poFile}
+ )
+
+ IF(_installDest)
+ INSTALL(FILES ${_gmoFile} DESTINATION ${_installDest}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
+ ENDIF(_installDest)
+ LIST(APPEND _gmoFiles ${_gmoFile})
+
+ ENDFOREACH (_lang )
+
+ ADD_CUSTOM_TARGET(potfile ${_addToAll} DEPENDS ${_gmoFiles})
+
+ENDMACRO(GETTEXT_PROCESS_POT_FILE)
+
+
+# GETTEXT_PROCESS_PO_FILES(<lang> [ALL] [INSTALL_DESTINATION <dir>] <po1> <po2> ...)
+MACRO(GETTEXT_PROCESS_PO_FILES _lang)
+ SET(_gmoFiles)
+ SET(_args ${ARGN})
+ SET(_addToAll)
+ SET(_installDest)
+
+ LIST(GET _args 0 _tmp)
+ IF("${_tmp}" STREQUAL "ALL")
+ SET(_addToAll ALL)
+ LIST(REMOVE_AT _args 0)
+ ENDIF("${_tmp}" STREQUAL "ALL")
+
+ LIST(GET _args 0 _tmp)
+ IF("${_tmp}" STREQUAL "INSTALL_DESTINATION")
+ LIST(GET _args 1 _installDest )
+ LIST(REMOVE_AT _args 0 1)
+ ENDIF("${_tmp}" STREQUAL "INSTALL_DESTINATION")
+
+# message(STATUS "2 all ${_addToAll} dest ${_installDest} args: ${_args}")
+
+ FOREACH(_current_PO_FILE ${_args})
+ GET_FILENAME_COMPONENT(_name ${_current_PO_FILE} NAME)
+ STRING(REGEX REPLACE "^(.+)(\\.[^.]+)$" "\\1" _basename ${_name})
+ SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo)
+ add_custom_command(OUTPUT ${_gmoFile}
+ COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_current_PO_FILE}
+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
+ DEPENDS ${_current_PO_FILE}
+ )
+
+ IF(_installDest)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gmo DESTINATION ${_installDest}/${_lang}/LC_MESSAGES/ RENAME ${_basename}.mo)
+ ENDIF(_installDest)
+ LIST(APPEND _gmoFiles ${_gmoFile})
+ ENDFOREACH(_current_PO_FILE)
+ ADD_CUSTOM_TARGET(pofiles ${_addToAll} DEPENDS ${_gmoFiles})
+ENDMACRO(GETTEXT_PROCESS_PO_FILES)
+
+
+#IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
+# SET(GETTEXT_FOUND TRUE)
+#ELSE (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
+# SET(GETTEXT_FOUND FALSE)
+# IF (GetText_REQUIRED)
+# MESSAGE(FATAL_ERROR "GetText not found")
+# ENDIF (GetText_REQUIRED)
+#ENDIF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )
+
+
+
diff --git a/kdecore/cmake/modules/FindGphoto2.cmake b/kdecore/cmake/modules/FindGphoto2.cmake
new file mode 100644
index 0000000..b1bd627
--- /dev/null
+++ b/kdecore/cmake/modules/FindGphoto2.cmake
@@ -0,0 +1,60 @@
+# cmake macro to test if we use gphoto2
+# GPHOTO2_FOUND - system has the GPHOTO2 library
+# GPHOTO2_INCLUDE_DIR - the GPHOTO2 include directory
+# GPHOTO2_LIBRARIES - The libraries needed to use GPHOTO2
+
+# Copyright (c) 2006, 2007 Laurent Montel, <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+option(KDE4_GPHOTO2 "do not build kamera (gphoto2 required)" ON)
+if (KDE4_GPHOTO2 )
+ IF (GPHOTO2_LIBRARIES AND GPHOTO2_INCLUDE_DIR)
+ # in cache already
+ SET(GPHOTO2_FOUND TRUE)
+ ELSE (GPHOTO2_LIBRARIES AND GPHOTO2_INCLUDE_DIR)
+
+ FIND_PROGRAM(GHOTO2CONFIG_EXECUTABLE NAMES gphoto2-config
+ )
+
+ FIND_PROGRAM(GHOTO2PORTCONFIG_EXECUTABLE NAMES gphoto2-port-config
+ )
+ set(GPHOTO2_LIBRARIES)
+ set(GPHOTO2_INCLUDE_DIRS)
+ # if gphoto2-port-config and gphoto2-config have been found
+ IF (GHOTO2PORTCONFIG_EXECUTABLE AND GHOTO2CONFIG_EXECUTABLE)
+ EXEC_PROGRAM(${GHOTO2PORTCONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GPHOTO2PORT_LIBRARY)
+ EXEC_PROGRAM(${GHOTO2CONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GPHOTO2_LIBRARY)
+
+ EXEC_PROGRAM(${GHOTO2PORTCONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _GPHOTO2PORT_RESULT_INCLUDE_DIR)
+ EXEC_PROGRAM(${GHOTO2CONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _GPHOTO2_RESULT_INCLUDE_DIR)
+
+ set(GPHOTO2_LIBRARIES ${GPHOTO2PORT_LIBRARY} ${GPHOTO2_LIBRARY})
+ # the cflags for poppler-qt4 can contain more than one include path
+ separate_arguments(_GPHOTO2_RESULT_INCLUDE_DIR)
+ foreach(_includedir ${_GPHOTO2_RESULT_INCLUDE_DIR})
+ string(REGEX REPLACE "-I(.+)" "\\1" _includedir "${_includedir}")
+ set(GPHOTO2_INCLUDE_DIR ${GPHOTO2_INCLUDE_DIR} ${_includedir})
+ endforeach(_includedir)
+ separate_arguments(_GPHOTO2PORT_RESULT_INCLUDE_DIR)
+ foreach(_includedir ${_GPHOTO2PORT_RESULT_INCLUDE_DIR})
+ string(REGEX REPLACE "-I(.+)" "\\1" _includedir "${_includedir}")
+ set(GPHOTO2PORT_INCLUDE_DIR ${GPHOTO2PORT_INCLUDE_DIR} ${_includedir})
+ endforeach(_includedir)
+
+
+
+ set(GPHOTO2_INCLUDE_DIRS ${GPHOTO2PORT_INCLUDE_DIR} ${GPHOTO2_INCLUDE_DIR} )
+ endif(GHOTO2PORTCONFIG_EXECUTABLE AND GHOTO2CONFIG_EXECUTABLE)
+
+ IF (GPHOTO2_LIBRARIES AND GPHOTO2_INCLUDE_DIRS)
+ SET(GPHOTO2_FOUND TRUE)
+ message(STATUS "Found gphoto2: ${GPHOTO2_LIBRARIES}")
+ ENDIF (GPHOTO2_LIBRARIES AND GPHOTO2_INCLUDE_DIRS)
+ ENDIF (GPHOTO2_LIBRARIES AND GPHOTO2_INCLUDE_DIR)
+ MARK_AS_ADVANCED(GPHOTO2_LIBRARIES GPHOTO2_INCLUDE_DIRS)
+
+endif(KDE4_GPHOTO2)
+
diff --git a/kdecore/cmake/modules/FindHUNSPELL.cmake b/kdecore/cmake/modules/FindHUNSPELL.cmake
new file mode 100644
index 0000000..26942b5
--- /dev/null
+++ b/kdecore/cmake/modules/FindHUNSPELL.cmake
@@ -0,0 +1,25 @@
+# - Try to find HUNSPELL
+# Once done this will define
+#
+# HUNSPELL_FOUND - system has HUNSPELL
+# HUNSPELL_INCLUDE_DIR - the HUNSPELL include directory
+# HUNSPELL_LIBRARIES - The libraries needed to use HUNSPELL
+# HUNSPELL_DEFINITIONS - Compiler switches required for using HUNSPELL
+
+
+IF (HUNSPELL_INCLUDE_DIR AND HUNSPELL_LIBRARIES)
+ # Already in cache, be silent
+ SET(HUNSPELL_FIND_QUIETLY TRUE)
+ENDIF (HUNSPELL_INCLUDE_DIR AND HUNSPELL_LIBRARIES)
+
+FIND_PATH(HUNSPELL_INCLUDE_DIR hunspell/hunspell.hxx )
+
+FIND_LIBRARY(HUNSPELL_LIBRARIES NAMES hunspell-1.3 hunspell-1.2)
+
+# handle the QUIETLY and REQUIRED arguments and set HUNSPELL_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(HUNSPELL DEFAULT_MSG HUNSPELL_LIBRARIES HUNSPELL_INCLUDE_DIR)
+
+
+MARK_AS_ADVANCED(HUNSPELL_INCLUDE_DIR HUNSPELL_LIBRARIES)
diff --git a/kdecore/cmake/modules/FindHUpnp.cmake b/kdecore/cmake/modules/FindHUpnp.cmake
new file mode 100644
index 0000000..0f4207e
--- /dev/null
+++ b/kdecore/cmake/modules/FindHUpnp.cmake
@@ -0,0 +1,31 @@
+# - Try to find HUPnP library
+# Once done this will define
+#
+# HUPNP_FOUND - system has HUPnP
+# HUPNP_INCLUDE_DIR - the LIBHUpnp include directory
+# HUPNP_LIBS - the LIBHUpnp libraries
+# HUPNP_VERSION_STRING - The version of HUpnp
+# HUPNP_VERSION_MAJOR - The major version of HUpnp
+# HUPNP_VERSION_MINOR - The minor version of HUpnp
+# HUPNP_VERSION_PATCH - The patch version of HUpnp
+#
+# Copyright (c) 2010, Paulo Romulo Alves Barros <paulo.romulo@kdemail.net>
+
+find_path( HUPNP_INCLUDE_DIR HUpnpCore/HUpnp )
+
+find_library( HUPNP_LIBS NAMES HUpnp HUpnp1 )
+
+if( HUPNP_INCLUDE_DIR AND EXISTS "${HUPNP_INCLUDE_DIR}/HUpnpCore/public/hupnpinfo.h" )
+ file( STRINGS "${HUPNP_INCLUDE_DIR}/HUpnpCore/public/hupnpinfo.h" HUPNP_INFO_H REGEX "^#define HUPNP_CORE_.*_VERSION .*$" )
+ string( REGEX REPLACE ".*HUPNP_CORE_MAJOR_VERSION ([0-9]+).*" "\\1" HUPNP_VERSION_MAJOR "${HUPNP_INFO_H}" )
+ string( REGEX REPLACE ".*HUPNP_CORE_MINOR_VERSION ([0-9]+).*" "\\1" HUPNP_VERSION_MINOR "${HUPNP_INFO_H}" )
+ string( REGEX REPLACE ".*HUPNP_CORE_PATCH_VERSION ([0-9]+).*" "\\1" HUPNP_VERSION_PATCH "${HUPNP_INFO_H}" )
+
+ set( HUPNP_VERSION_STRING "${HUPNP_VERSION_MAJOR}.${HUPNP_VERSION_MINOR}.${HUPNP_VERSION_PATCH}" )
+endif()
+
+include( FindPackageHandleStandardArgs )
+
+find_package_handle_standard_args( HUpnp DEFAULT_MSG HUPNP_INCLUDE_DIR HUPNP_LIBS )
+
+mark_as_advanced( HUPNP_INCLUDE_DIR HUPNP_LIBS )
diff --git a/kdecore/cmake/modules/FindIOKit.cmake b/kdecore/cmake/modules/FindIOKit.cmake
new file mode 100644
index 0000000..f3e3ecb
--- /dev/null
+++ b/kdecore/cmake/modules/FindIOKit.cmake
@@ -0,0 +1,23 @@
+# - Find IOKit on Mac
+#
+# IOKIT_LIBRARY - the library to use IOKit
+# IOKIT_FOUND - true if IOKit has been found
+
+# Copyright (c) 2009, Harald Fernengel <harry@kdevelop.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+include(CMakeFindFrameworks)
+
+cmake_find_frameworks(IOKit)
+cmake_find_frameworks(CoreFoundation)
+
+if (IOKit_FRAMEWORKS)
+ set(IOKIT_LIBRARY "-framework IOKit -framework CoreFoundation" CACHE FILEPATH "IOKit framework" FORCE)
+ set(IOKIT_FOUND 1)
+endif (IOKit_FRAMEWORKS)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(IOKit DEFAULT_MSG IOKIT_LIBRARY)
+
diff --git a/kdecore/cmake/modules/FindKDE4Internal.cmake b/kdecore/cmake/modules/FindKDE4Internal.cmake
new file mode 100644
index 0000000..916c9c2
--- /dev/null
+++ b/kdecore/cmake/modules/FindKDE4Internal.cmake
@@ -0,0 +1,1422 @@
+# - Find the KDE4 include and library dirs, KDE preprocessors and define a some macros
+#
+# This module defines the following variables:
+#
+# KDE4_FOUND - set to TRUE if everything required for building KDE software has been found
+#
+# KDE4_DEFINITIONS - compiler definitions required for compiling KDE software
+# KDE4_INCLUDE_DIR - the KDE 4 include directory
+# KDE4_INCLUDES - all include directories required for KDE, i.e.
+# KDE4_INCLUDE_DIR, but also the Qt4 include directories
+# and other platform specific include directories
+# KDE4_LIB_DIR - the directory where the KDE libraries are installed,
+# intended to be used with LINK_DIRECTORIES(). In general, this is not necessary.
+# KDE4_LIBEXEC_INSTALL_DIR - the directory where libexec executables from kdelibs are installed
+# KDE4_BIN_INSTALL_DIR - the directory where executables from kdelibs are installed
+# KDE4_SBIN_INSTALL_DIR - the directory where system executables from kdelibs are installed
+# KDE4_DATA_INSTALL_DIR - the parent directory where kdelibs applications install their data
+# KDE4_HTML_INSTALL_DIR - the directory where HTML documentation from kdelibs is installed
+# KDE4_CONFIG_INSTALL_DIR - the directory where config files from kdelibs are installed
+# KDE4_ICON_INSTALL_DIR - the directory where icons from kdelibs are
+# KDE4_IMPORTS_INSTALL_DIR - the directory where imports from kdelibs are
+# KDE4_KCFG_INSTALL_DIR - the directory where kconfig files from kdelibs are installed
+# KDE4_LOCALE_INSTALL_DIR - the directory where translations from kdelibs are installed
+# KDE4_MIME_INSTALL_DIR - the directory where mimetype desktop files from kdelibs are installed
+# KDE4_SOUND_INSTALL_DIR - the directory where sound files from kdelibs are installed
+# KDE4_TEMPLATES_INSTALL_DIR - the directory where templates (Create new file...) from kdelibs are installed
+# KDE4_WALLPAPER_INSTALL_DIR - the directory where wallpapers from kdelibs are installed
+# KDE4_KCONF_UPDATE_INSTALL_DIR - the directory where kconf_update files from kdelibs are installed
+# KDE4_AUTOSTART_INSTALL_DIR - the directory where autostart from kdelibs are installed
+# KDE4_XDG_APPS_INSTALL_DIR - the XDG apps dir from kdelibs
+# KDE4_XDG_DIRECTORY_INSTALL_DIR - the XDG directory from kdelibs
+# KDE4_SYSCONF_INSTALL_DIR - the directory where sysconfig files from kdelibs are installed
+# KDE4_MAN_INSTALL_DIR - the directory where man pages from kdelibs are installed
+# KDE4_INFO_INSTALL_DIR - the directory where info files from kdelibs are installed
+# KDE4_DBUS_INTERFACES_DIR - the directory where dbus interfaces from kdelibs are installed
+# KDE4_DBUS_SERVICES_DIR - the directory where dbus service files from kdelibs are installed
+#
+# The following variables are defined for the various tools required to
+# compile KDE software:
+#
+# KDE4_KCFGC_EXECUTABLE - the kconfig_compiler executable
+# KDE4_AUTOMOC_EXECUTABLE - the kde4automoc executable, deprecated, use AUTOMOC4_EXECUTABLE instead
+# KDE4_MEINPROC_EXECUTABLE - the meinproc4 executable
+# KDE4_MAKEKDEWIDGETS_EXECUTABLE - the makekdewidgets executable
+#
+# The following variables point to the location of the KDE libraries,
+# but shouldn't be used directly:
+#
+# KDE4_KDECORE_LIBRARY - the kdecore library
+# KDE4_KDEUI_LIBRARY - the kdeui library
+# KDE4_KIO_LIBRARY - the kio library
+# KDE4_KPARTS_LIBRARY - the kparts library
+# KDE4_KUTILS_LIBRARY - the kutils library
+# KDE4_KEMOTICONS_LIBRARY - the kemoticons library
+# KDE4_KIDLETIME_LIBRARY - the kidletime library
+# KDE4_KCMUTILS_LIBRARY - the kcmutils library
+# KDE4_KPRINTUTILS_LIBRARY - the kprintutils library
+# KDE4_KDE3SUPPORT_LIBRARY - the kde3support library
+# KDE4_KFILE_LIBRARY - the kfile library
+# KDE4_KHTML_LIBRARY - the khtml library
+# KDE4_KJS_LIBRARY - the kjs library
+# KDE4_KJSAPI_LIBRARY - the kjs public api library
+# KDE4_KNEWSTUFF2_LIBRARY - the knewstuff2 library
+# KDE4_KNEWSTUFF3_LIBRARY - the knewstuff3 library
+# KDE4_KDNSSD_LIBRARY - the kdnssd library
+# KDE4_PHONON_LIBRARY - the phonon library
+# KDE4_THREADWEAVER_LIBRARY- the threadweaver library
+# KDE4_SOLID_LIBRARY - the solid library
+# KDE4_KNOTIFYCONFIG_LIBRARY- the knotifyconfig library
+# KDE4_KROSSCORE_LIBRARY - the krosscore library
+# KDE4_KTEXTEDITOR_LIBRARY - the ktexteditor library
+# KDE4_NEPOMUK_LIBRARY - the nepomuk library
+# KDE4_PLASMA_LIBRARY - the plasma library
+# KDE4_KUNITCONVERSION_LIBRARY - the kunitconversion library
+# KDE4_KDEWEBKIT_LIBRARY - the kdewebkit library
+#
+# KDE4_PLASMA_OPENGL_FOUND - TRUE if the OpenGL support of Plasma has been found, NOTFOUND otherwise
+#
+# Compared to the variables above, the following variables
+# also contain all of the depending libraries, so the variables below
+# should be used instead of the ones above:
+#
+# KDE4_KDECORE_LIBS - the kdecore library and all depending libraries
+# KDE4_KDEUI_LIBS - the kdeui library and all depending libraries
+# KDE4_KIO_LIBS - the kio library and all depending libraries
+# KDE4_KPARTS_LIBS - the kparts library and all depending libraries
+# KDE4_KUTILS_LIBS - the kutils library and all depending libraries
+# KDE4_KEMOTICONS_LIBS - the kemoticons library and all depending libraries
+# KDE4_KIDLETIME_LIBS - the kidletime library and all depending libraries
+# KDE4_KCMUTILS_LIBS - the kcmutils library and all depending libraries
+# KDE4_KPRINTUTILS_LIBS - the kprintutils library and all depending libraries
+# KDE4_KDE3SUPPORT_LIBS - the kde3support library and all depending libraries
+# KDE4_KFILE_LIBS - the kfile library and all depending libraries
+# KDE4_KHTML_LIBS - the khtml library and all depending libraries
+# KDE4_KJS_LIBS - the kjs library and all depending libraries
+# KDE4_KJSAPI_LIBS - the kjs public api library and all depending libraries
+# KDE4_KNEWSTUFF2_LIBS - the knewstuff2 library and all depending libraries
+# KDE4_KNEWSTUFF3_LIBS - the knewstuff3 library and all depending libraries
+# KDE4_KDNSSD_LIBS - the kdnssd library and all depending libraries
+# KDE4_KDESU_LIBS - the kdesu library and all depending libraries
+# KDE4_KPTY_LIBS - the kpty library and all depending libraries
+# KDE4_PHONON_LIBS - the phonon library and all depending librairies
+# KDE4_THREADWEAVER_LIBRARIES- the threadweaver library and all depending libraries
+# KDE4_SOLID_LIBS - the solid library and all depending libraries
+# KDE4_KNOTIFYCONFIG_LIBS - the knotify config library and all depending libraries
+# KDE4_KROSSCORE_LIBS - the kross core library and all depending libraries
+# KDE4_KROSSUI_LIBS - the kross ui library which includes core and all depending libraries
+# KDE4_KTEXTEDITOR_LIBS - the ktexteditor library and all depending libraries
+# KDE4_NEPOMUK_LIBS - the nepomuk library and all depending libraries
+# KDE4_PLASMA_LIBS - the plasma library and all depending librairies
+# KDE4_KUNITCONVERSION_LIBS - the kunitconversion library and all depending libraries
+# KDE4_KDEWEBKIT_LIBS - the kdewebkit library and all depending libraries
+#
+# This module defines also a bunch of variables used as locations for install directories
+# for files of the package which is using this module. These variables don't say
+# anything about the location of the installed KDE.
+# They can be relative (to CMAKE_INSTALL_PREFIX) or absolute.
+# Under Windows they are always relative.
+#
+# BIN_INSTALL_DIR - the directory where executables will be installed (default is prefix/bin)
+# BUNDLE_INSTALL_DIR - Mac only: the directory where application bundles will be installed (default is /Applications/KDE4 )
+# SBIN_INSTALL_DIR - the directory where system executables will be installed (default is prefix/sbin)
+# LIB_INSTALL_DIR - the directory where libraries will be installed (default is prefix/lib)
+# CONFIG_INSTALL_DIR - the directory where config files will be installed
+# DATA_INSTALL_DIR - the parent directory where applications can install their data
+# HTML_INSTALL_DIR - the directory where HTML documentation will be installed
+# ICON_INSTALL_DIR - the directory where the icons will be installed (default prefix/share/icons/)
+# INFO_INSTALL_DIR - the directory where info files will be installed (default prefix/info)
+# KCFG_INSTALL_DIR - the directory where kconfig files will be installed
+# LOCALE_INSTALL_DIR - the directory where translations will be installed
+# MAN_INSTALL_DIR - the directory where man pages will be installed (default prefix/man/)
+# MIME_INSTALL_DIR - the directory where mimetype desktop files will be installed
+# PLUGIN_INSTALL_DIR - the subdirectory relative to the install prefix where plugins will be installed (default is ${KDE4_LIB_INSTALL_DIR}/kde4)
+# IMPORTS_INSTALL_DIR - the subdirectory relative to the install prefix where imports will be installed
+# SERVICES_INSTALL_DIR - the directory where service (desktop, protocol, ...) files will be installed
+# SERVICETYPES_INSTALL_DIR - the directory where servicestypes desktop files will be installed
+# SOUND_INSTALL_DIR - the directory where sound files will be installed
+# TEMPLATES_INSTALL_DIR - the directory where templates (Create new file...) will be installed
+# WALLPAPER_INSTALL_DIR - the directory where wallpapers will be installed
+# AUTOSTART_INSTALL_DIR - the directory where autostart files will be installed
+# DEMO_INSTALL_DIR - the directory where demos will be installed
+# KCONF_UPDATE_INSTALL_DIR - the directory where kconf_update files will be installed
+# SYSCONF_INSTALL_DIR - the directory where sysconfig files will be installed (default /etc)
+# XDG_APPS_INSTALL_DIR - the XDG apps dir
+# XDG_DIRECTORY_INSTALL_DIR- the XDG directory
+# XDG_MIME_INSTALL_DIR - the XDG mimetypes install dir
+# DBUS_INTERFACES_INSTALL_DIR - the directory where dbus interfaces will be installed (default is prefix/share/dbus-1/interfaces)
+# DBUS_SERVICES_INSTALL_DIR - the directory where dbus services will be installed (default is prefix/share/dbus-1/services )
+# DBUS_SYSTEM_SERVICES_INSTALL_DIR - the directory where dbus system services will be installed (default is prefix/share/dbus-1/system-services )
+#
+# The variable INSTALL_TARGETS_DEFAULT_ARGS can be used when installing libraries
+# or executables into the default locations.
+# The INSTALL_TARGETS_DEFAULT_ARGS variable should be used when libraries are installed.
+# It should also be used when installing applications, since then
+# on OS X application bundles will be installed to BUNDLE_INSTALL_DIR.
+# The variable MUST NOT be used for installing plugins.
+# It also MUST NOT be used for executables which are intended to go into sbin/ or libexec/.
+#
+# Usage is like this:
+# install(TARGETS kdecore kdeui ${INSTALL_TARGETS_DEFAULT_ARGS} )
+#
+# This will install libraries correctly under UNIX, OSX and Windows (i.e. dll's go
+# into bin/.
+#
+#
+# The following variable is provided, but seem to be unused:
+# LIBS_HTML_INSTALL_DIR /share/doc/HTML CACHE STRING "Is this still used ?")
+#
+# The following user adjustable options are provided:
+#
+# KDE4_ENABLE_FINAL - enable KDE-style enable-final all-in-one-compilation
+# KDE4_BUILD_TESTS - enable this to build the testcases
+# KDE4_ENABLE_FPIE - enable it to use gcc Position Independent Executables feature
+# KDE4_USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR - only present for CMake >= 2.6.3, defaults to TRUE
+# If enabled, the package should install its <package>Config.cmake file to
+# lib/cmake/<package>/ instead to lib/<package>/cmake
+# KDE4_SERIALIZE_TOOL - wrapper to serialize potentially resource-intensive commands during
+# parallel builds (set to 'icecc' when using icecream)
+#
+# It also adds the following macros and functions (from KDE4Macros.cmake)
+# KDE4_ADD_UI_FILES (SRCS_VAR file1.ui ... fileN.ui)
+# Use this to add Qt designer ui files to your application/library.
+#
+# KDE4_ADD_UI3_FILES (SRCS_VAR file1.ui ... fileN.ui)
+# Use this to add Qt designer ui files from Qt version 3 to your application/library.
+#
+# KDE4_ADD_KCFG_FILES (SRCS_VAR [GENERATE_MOC] [USE_RELATIVE_PATH] file1.kcfgc ... fileN.kcfgc)
+# Use this to add KDE config compiler files to your application/library.
+# Use optional GENERATE_MOC to generate moc if you use signals in your kcfg files.
+# Use optional USE_RELATIVE_PATH to generate the classes in the build following the given
+# relative path to the file.
+#
+# KDE4_ADD_WIDGET_FILES (SRCS_VAR file1.widgets ... fileN.widgets)
+# Use this to add widget description files for the makekdewidgets code generator
+# for Qt Designer plugins.
+#
+# KDE4_CREATE_FINAL_FILES (filename_CXX filename_C file1 ... fileN)
+# This macro is intended mainly for internal uses.
+# It is used for enable-final. It will generate two source files,
+# one for the C files and one for the C++ files.
+# These files will have the names given in filename_CXX and filename_C.
+#
+# KDE4_ADD_PLUGIN ( name [WITH_PREFIX] file1 ... fileN )
+# Create a KDE plugin (KPart, kioslave, etc.) from the given source files.
+# It supports KDE4_ENABLE_FINAL.
+# If WITH_PREFIX is given, the resulting plugin will have the prefix "lib", otherwise it won't.
+#
+# KDE4_ADD_KDEINIT_EXECUTABLE (name [NOGUI] [RUN_UNINSTALLED] file1 ... fileN)
+# Create a KDE application in the form of a module loadable via kdeinit.
+# A library named kdeinit_<name> will be created and a small executable which links to it.
+# It supports KDE4_ENABLE_FINAL
+# If the executable doesn't have a GUI, use the option NOGUI. By default on OS X
+# application bundles are created, with the NOGUI option no bundles but simple executables
+# are created. Under Windows this flag is also necessary to separate between applications
+# with GUI and without. On other UNIX systems this flag has no effect.
+# RUN_UNINSTALLED is deprecated and is ignored, for details see the documentation for
+# KDE4_ADD_EXECUTABLE().
+#
+# KDE4_ADD_EXECUTABLE (name [NOGUI] [TEST] [RUN_UNINSTALLED] file1 ... fileN)
+# Equivalent to ADD_EXECUTABLE(), but additionally adds some more features:
+# -support for KDE4_ENABLE_FINAL
+# -support for automoc
+# -automatic RPATH handling
+# If the executable doesn't have a GUI, use the option NOGUI. By default on OS X
+# application bundles are created, with the NOGUI option no bundles but simple executables
+# are created. Under Windows this flag is also necessary to separate between applications
+# with GUI and without. On other UNIX systems this flag has no effect.
+# The option TEST is for internal use only.
+# The option RUN_UNINSTALLED is ignored. It was necessary with KDE 4.0 and 4.1
+# if the executable had to be run from the build tree. Since KDE 4.2 all
+# executables can be always run uninstalled (the RPATH of executables which are not
+# yet installed points since then into the buildtree and is changed
+# to the proper location when installing, so RUN_UNINSTALLED is not necessary anymore).
+#
+# KDE4_ADD_LIBRARY (name [STATIC | SHARED | MODULE ] file1 ... fileN)
+# Equivalent to ADD_LIBRARY(). Additionally it supports KDE4_ENABLE_FINAL,
+# includes automoc-handling and sets LINK_INTERFACE_LIBRARIES target property empty.
+# The RPATH is set according to the global RPATH settings as set up by FindKDE4Internal.cmake
+# (CMAKE_SKIP_BUILD_RPATH=FALSE, CMAKE_BUILD_WITH_INSTALL_RPATH=FALSE, CMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE)
+# Under Windows it adds a -DMAKE_<name>_LIB definition to the compilation.
+#
+# KDE4_ADD_UNIT_TEST (testname [TESTNAME targetname] file1 ... fileN)
+# add a unit test, which is executed when running make test
+# it will be built with RPATH poiting to the build dir
+# The targets are always created, but only built for the "all"
+# target if the option KDE4_BUILD_TESTS is enabled. Otherwise the rules for the target
+# are created but not built by default. You can build them by manually building the target.
+# The name of the target can be specified using TESTNAME <targetname>, if it is not given
+# the macro will default to the <testname>
+# KDESRCDIR is set to the source directory of the test, this can be used with
+# KGlobal::dirs()->addResourceDir( "data", KDESRCDIR )
+#
+#
+# KDE4_ADD_APP_ICON (SRCS_VAR pattern)
+# adds an application icon to target source list.
+# Make sure you have a 128x128 icon, or the icon won't display on Mac OS X.
+# Mac OSX notes : the application icon is added to a Mac OS X bundle so that Finder and friends show the right thing.
+# Win32 notes: the application icon(s) are compiled into the application
+# There is some workaround in kde4_add_kdeinit_executable to make it possible for those applications as well.
+# Parameters:
+# SRCS_VAR - specifies the list of source files
+# pattern - regular expression for searching application icons
+# Example: KDE4_ADD_APP_ICON( myapp_SOURCES "pics/cr*-myapp.png")
+# Example: KDE4_ADD_APP_ICON( myapp_KDEINIT_SRCS "icons/oxygen/*/apps/myapp.png")
+#
+# KDE4_UPDATE_ICONCACHE()
+# Notifies the icon cache that new icons have been installed by updating
+# mtime of ${ICON_INSTALL_DIR}/hicolor directory.
+#
+# KDE4_INSTALL_ICONS( path theme)
+# Installs all png and svgz files in the current directory to the icon
+# directoy given in path, in the subdirectory for the given icon theme.
+#
+# KDE4_CREATE_HANDBOOK( docbookfile [INSTALL_DESTINATION installdest] [SUBDIR subdir])
+# Create the handbook from the docbookfile (using meinproc4)
+# The resulting handbook will be installed to <installdest> when using
+# INSTALL_DESTINATION <installdest>, or to <installdest>/<subdir> if
+# SUBDIR <subdir> is specified.
+#
+# KDE4_CREATE_MANPAGE( docbookfile section )
+# Create the manpage for the specified section from the docbookfile (using meinproc4)
+# The resulting manpage will be installed to <installdest> when using
+# INSTALL_DESTINATION <installdest>, or to <installdest>/<subdir> if
+# SUBDIR <subdir> is specified.
+#
+# KDE4_INSTALL_AUTH_ACTIONS( HELPER_ID ACTIONS_FILE )
+# This macro generates an action file, depending on the backend used, for applications using KAuth.
+# It accepts the helper id (the DBUS name) and a file containing the actions (check kdelibs/kdecore/auth/example
+# for file format). The macro will take care of generating the file according to the backend specified,
+# and to install it in the right location. This (at the moment) means that on Linux (PolicyKit) a .policy
+# file will be generated and installed into the policykit action directory (usually /usr/share/PolicyKit/policy/),
+# and on Mac (Authorization Services) will be added to the system action registry using the native MacOS API during
+# the install phase
+#
+# KDE4_INSTALL_AUTH_HELPER_FILES( HELPER_TARGET HELPER_ID HELPER_USER )
+# This macro adds the needed files for an helper executable meant to be used by applications using KAuth.
+# It accepts the helper target, the helper ID (the DBUS name) and the user under which the helper will run on.
+# This macro takes care of generate the needed files, and install them in the right location. This boils down
+# to a DBus policy to let the helper register on the system bus, and a service file for letting the helper
+# being automatically activated by the system bus.
+# *WARNING* You have to install the helper in ${LIBEXEC_INSTALL_DIR} to make sure everything will work.
+#
+#
+#
+# A note on the possible values for CMAKE_BUILD_TYPE and how KDE handles
+# the flags for those buildtypes. FindKDE4Internal supports the values
+# Debug, Release, RelWithDebInfo, Profile and Debugfull:
+#
+# Release
+# optimised for speed, qDebug/kDebug turned off, no debug symbols, no asserts
+# RelWithDebInfo (Release with debug info)
+# similar to Release, optimised for speed, but with debugging symbols on (-g)
+# Debug
+# optimised but debuggable, debugging on (-g)
+# (-fno-reorder-blocks -fno-schedule-insns -fno-inline)
+# DebugFull
+# no optimisation, full debugging on (-g3)
+# Profile
+# DebugFull + -ftest-coverage -fprofile-arcs
+#
+#
+# The default buildtype is RelWithDebInfo.
+# It is expected that the "Debug" build type be still debuggable with gdb
+# without going all over the place, but still produce better performance.
+# It's also important to note that gcc cannot detect all warning conditions
+# unless the optimiser is active.
+#
+#
+# This module allows to depend on a particular minimum version of kdelibs.
+# To acomplish that one should use the apropriate cmake syntax for
+# find_package. For example to depend on kdelibs >= 4.1.0 one should use
+#
+# find_package(KDE4 4.1.0 REQUIRED)
+#
+# In earlier versions of KDE you could use the variable KDE_MIN_VERSION to
+# have such a dependency. This variable is deprecated with KDE 4.2.0, but
+# will still work to make the module backwards-compatible.
+
+# _KDE4_PLATFORM_INCLUDE_DIRS is used only internally
+# _KDE4_PLATFORM_DEFINITIONS is used only internally
+
+# Copyright (c) 2006-2009, Alexander Neundorf <neundorf@kde.org>
+# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+# this is required now by cmake 2.6 and so must not be skipped by if(KDE4_FOUND) below
+cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
+# set the cmake policies to the 2.4.x compatibility settings (may change for KDE 4.3)
+cmake_policy(VERSION 2.4.5)
+
+# CMake 2.6, set compatibility behaviour to cmake 2.4
+# this must be executed always, because the CMAKE_MINIMUM_REQUIRED() command above
+# resets the policy settings, so we get a lot of warnings
+
+# CMP0000: don't require cmake_minimum_version() directly in the top level CMakeLists.txt, FindKDE4Internal.cmake is good enough
+cmake_policy(SET CMP0000 OLD)
+# CMP0002: in KDE4 we have multiple targets with the same name for the unit tests
+cmake_policy(SET CMP0002 OLD)
+# CMP0003: add the link paths to the link command as with cmake 2.4
+cmake_policy(SET CMP0003 OLD)
+# CMP0005: keep escaping behaviour for definitions added via add_definitions()
+cmake_policy(SET CMP0005 OLD)
+# since cmake 2.6.3: NEW behaviour is that setting policies doesn't "escape" the file
+# where this is done, macros and functions are executed with the policies as they
+# were when the were defined. Keep the OLD behaviour so we can set the policies here
+# for all KDE software without the big warning
+cmake_policy(SET CMP0011 OLD)
+# since cmake 2.6.4
+if(POLICY CMP0017)
+ cmake_policy(SET CMP0017 NEW)
+endif(POLICY CMP0017)
+
+# Only do something if it hasn't been found yet
+if(NOT KDE4_FOUND)
+
+# get the directory of the current file, used later on in the file
+get_filename_component( kde_cmake_module_dir ${CMAKE_CURRENT_LIST_FILE} PATH)
+
+
+include (MacroEnsureVersion)
+
+# We may only search for other packages with "REQUIRED" if we are required ourselves.
+# This file can be processed either (usually) included in FindKDE4.cmake or
+# (when building kdelibs) directly via FIND_PACKAGE(KDE4Internal), that's why
+# we have to check for both KDE4_FIND_REQUIRED and KDE4Internal_FIND_REQUIRED.
+if(KDE4_FIND_REQUIRED OR KDE4Internal_FIND_REQUIRED)
+ set(_REQ_STRING_KDE4 "REQUIRED")
+ set(_REQ_STRING_KDE4_MESSAGE "FATAL_ERROR")
+else(KDE4_FIND_REQUIRED OR KDE4Internal_FIND_REQUIRED)
+ set(_REQ_STRING_KDE4 )
+ set(_REQ_STRING_KDE4_MESSAGE "STATUS")
+endif(KDE4_FIND_REQUIRED OR KDE4Internal_FIND_REQUIRED)
+
+
+# Store CMAKE_MODULE_PATH and then append the current dir to it, so we are sure
+# we get the FindQt4.cmake located next to us and not a different one.
+# The original CMAKE_MODULE_PATH is restored later on.
+set(_kde_cmake_module_path_back ${CMAKE_MODULE_PATH})
+set(CMAKE_MODULE_PATH ${kde_cmake_module_dir} ${CMAKE_MODULE_PATH} )
+
+# if the minimum Qt requirement is changed, change all occurrence in the
+# following lines
+if( NOT QT_MIN_VERSION )
+ set(QT_MIN_VERSION "4.5.0")
+endif( NOT QT_MIN_VERSION )
+if( ${QT_MIN_VERSION} VERSION_LESS "4.5.0" )
+ set(QT_MIN_VERSION "4.5.0")
+endif( ${QT_MIN_VERSION} VERSION_LESS "4.5.0" )
+
+# Tell FindQt4.cmake to point the QT_QTFOO_LIBRARY targets at the imported targets
+# for the Qt libraries, so we get full handling of release and debug versions of the
+# Qt libs and are flexible regarding the install location of Qt under Windows:
+set(QT_USE_IMPORTED_TARGETS TRUE)
+
+#this line includes FindQt4.cmake, which searches the Qt library and headers
+# TODO: we should check here that all necessary modules of Qt have been found, e.g. QtDBus
+find_package(Qt4 ${_REQ_STRING_KDE4})
+
+# automoc4 (from kdesupport) is now required, Alex
+find_package(Automoc4 ${_REQ_STRING_KDE4})
+
+# cmake 2.6.0 and automoc4 < 0.9.84 don't work right for -D flags
+if (NOT AUTOMOC4_VERSION)
+ # the version macro was added for 0.9.84
+ set(AUTOMOC4_VERSION "0.9.83")
+endif (NOT AUTOMOC4_VERSION)
+set(_automoc4_min_version "0.9.88")
+macro_ensure_version("${_automoc4_min_version}" "${AUTOMOC4_VERSION}" _automoc4_version_ok)
+
+# for compatibility with KDE 4.0.x
+set(KDE4_AUTOMOC_EXECUTABLE "${AUTOMOC4_EXECUTABLE}" )
+
+# Perl is not required for building KDE software, but we had that here since 4.0
+find_package(Perl)
+if(NOT PERL_FOUND)
+ message(STATUS "Perl not found")
+endif(NOT PERL_FOUND)
+
+# restore the original CMAKE_MODULE_PATH
+set(CMAKE_MODULE_PATH ${_kde_cmake_module_path_back})
+
+# we check for Phonon not here, but further below, i.e. after KDELibsDependencies.cmake
+# has been loaded, which helps in the case that phonon is installed to the same
+# directory as kdelibs.
+# find_package(Phonon ${_REQ_STRING_KDE4})
+
+
+# Check that we really found everything.
+# If KDE4 was searched with REQUIRED, we error out with FATAL_ERROR if something wasn't found
+# already above in the other FIND_PACKAGE() calls.
+# If KDE4 was searched without REQUIRED and something in the FIND_PACKAGE() calls above wasn't found,
+# then we get here and must check that everything has actually been found. If something is missing,
+# we must not fail with FATAL_ERROR, but only not set KDE4_FOUND.
+
+if(NOT QT4_FOUND)
+ message(STATUS "KDE4 not found, because Qt4 was not found")
+ return()
+endif(NOT QT4_FOUND)
+
+if(NOT AUTOMOC4_FOUND OR NOT _automoc4_version_ok)
+ if(NOT AUTOMOC4_FOUND)
+ message(${_REQ_STRING_KDE4_MESSAGE} "KDE4 not found, because Automoc4 not found.")
+ return()
+ else(NOT AUTOMOC4_FOUND)
+ if(NOT _automoc4_version_ok)
+ message(${_REQ_STRING_KDE4_MESSAGE} "Your version of automoc4 is too old. You have ${AUTOMOC4_VERSION}, you need at least ${_automoc4_min_version}")
+ return()
+ endif(NOT _automoc4_version_ok)
+ endif(NOT AUTOMOC4_FOUND)
+endif(NOT AUTOMOC4_FOUND OR NOT _automoc4_version_ok)
+
+
+# now we are sure we have everything we need
+
+include (MacroLibrary)
+include (CheckCXXCompilerFlag)
+include (CheckCXXSourceCompiles)
+
+
+# are we trying to compile kdelibs ? kdelibs_SOURCE_DIR comes from "project(kdelibs)" in kdelibs/CMakeLists.txt
+# then enter bootstrap mode
+
+if(kdelibs_SOURCE_DIR)
+ set(_kdeBootStrapping TRUE)
+ message(STATUS "Building kdelibs...")
+else(kdelibs_SOURCE_DIR)
+ set(_kdeBootStrapping FALSE)
+endif(kdelibs_SOURCE_DIR)
+
+
+# helper macro, sets both the KDE4_FOO_LIBRARY and KDE4_FOO_LIBS variables to KDE4__foo
+# It is used both in bootstrapping and in normal mode.
+macro(_KDE4_SET_LIB_VARIABLES _var _lib _prefix)
+ set(KDE4_${_var}_LIBRARY ${_prefix}${_lib} )
+ set(KDE4_${_var}_LIBS ${_prefix}${_lib} )
+endmacro(_KDE4_SET_LIB_VARIABLES _var _lib _prefix)
+
+####################### #now try to find some kde stuff ################################
+
+if (_kdeBootStrapping)
+ set(KDE4_INCLUDE_DIR ${kdelibs_SOURCE_DIR})
+
+ set(EXECUTABLE_OUTPUT_PATH ${kdelibs_BINARY_DIR}/bin )
+
+ if (WIN32)
+ set(LIBRARY_OUTPUT_PATH ${EXECUTABLE_OUTPUT_PATH} )
+ # CMAKE_CFG_INTDIR is the output subdirectory created e.g. by XCode and MSVC
+ if (NOT WINCE)
+ set(KDE4_KCFGC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kconfig_compiler )
+ set(KDE4_MEINPROC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/meinproc4 )
+ else (NOT WINCE)
+ set(KDE4_KCFGC_EXECUTABLE ${HOST_BINDIR}/${CMAKE_CFG_INTDIR}/kconfig_compiler )
+ set(KDE4_MEINPROC_EXECUTABLE ${HOST_BINDIR}/${CMAKE_CFG_INTDIR}/meinproc4 )
+ endif(NOT WINCE)
+
+ set(KDE4_MEINPROC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/meinproc4 )
+ set(KDE4_KAUTH_POLICY_GEN_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kauth-policy-gen )
+ set(KDE4_MAKEKDEWIDGETS_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets )
+ else (WIN32)
+ set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib )
+ set(KDE4_KCFGC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kconfig_compiler${CMAKE_EXECUTABLE_SUFFIX}.shell )
+ set(KDE4_KAUTH_POLICY_GEN_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/kauth-policy-gen${CMAKE_EXECUTABLE_SUFFIX}.shell )
+ set(KDE4_MEINPROC_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/meinproc4${CMAKE_EXECUTABLE_SUFFIX}.shell )
+ set(KDE4_MAKEKDEWIDGETS_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets${CMAKE_EXECUTABLE_SUFFIX}.shell )
+ endif (WIN32)
+
+ set(KDE4_LIB_DIR ${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR})
+
+
+ # when building kdelibs, make the kcfg rules depend on the binaries...
+ set( _KDE4_KCONFIG_COMPILER_DEP kconfig_compiler)
+ set( _KDE4_KAUTH_POLICY_GEN_EXECUTABLE_DEP kauth-policy-gen)
+ set( _KDE4_MAKEKDEWIDGETS_DEP makekdewidgets)
+ set( _KDE4_MEINPROC_EXECUTABLE_DEP meinproc4)
+
+ set(KDE4_INSTALLED_VERSION_OK TRUE)
+
+else (_kdeBootStrapping)
+
+ # ... but NOT otherwise
+ set( _KDE4_KCONFIG_COMPILER_DEP)
+ set( _KDE4_MAKEKDEWIDGETS_DEP)
+ set( _KDE4_MEINPROC_EXECUTABLE_DEP)
+ set( _KDE4_KAUTH_POLICY_GEN_EXECUTABLE_DEP)
+
+ set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib )
+
+ if (WIN32)
+ # we don't want to be forced to set two paths into the build tree
+ set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin )
+
+ # on win32 the install dir is determined on runtime not install time
+ # KDELIBS_INSTALL_DIR and QT_INSTALL_DIR are used in KDELibsDependencies.cmake to setup
+ # kde install paths and library dependencies
+ get_filename_component(_DIR ${KDE4_KDECONFIG_EXECUTABLE} PATH )
+ get_filename_component(KDE4_INSTALL_DIR ${_DIR} PATH )
+ get_filename_component(_DIR ${QT_QMAKE_EXECUTABLE} PATH )
+ get_filename_component(QT_INSTALL_DIR ${_DIR} PATH )
+ endif (WIN32)
+
+ # These files contain information about the installed kdelibs, Alex
+ include(${kde_cmake_module_dir}/KDELibsDependencies.cmake)
+ include(${kde_cmake_module_dir}/KDEPlatformProfile.cmake)
+
+ # Check the version of KDE. It must be at least KDE_MIN_VERSION as set by the user.
+ # KDE_VERSION is set in KDELibsDependencies.cmake since KDE 4.0.x. Alex
+ # Support for the new-style (>= 2.6.0) support for requiring some version of a package:
+ if (NOT KDE_MIN_VERSION)
+ if (KDE4_FIND_VERSION_MAJOR)
+ set(KDE_MIN_VERSION "${KDE4_FIND_VERSION_MAJOR}.${KDE4_FIND_VERSION_MINOR}.${KDE4_FIND_VERSION_PATCH}")
+ else (KDE4_FIND_VERSION_MAJOR)
+ set(KDE_MIN_VERSION "4.0.0")
+ endif (KDE4_FIND_VERSION_MAJOR)
+ endif (NOT KDE_MIN_VERSION)
+
+ #message(FATAL_ERROR "KDE_MIN_VERSION=${KDE_MIN_VERSION} found ${KDE_VERSION} exact: -${KDE4_FIND_VERSION_EXACT}- version: -${KDE4_FIND_VERSION}-")
+ macro_ensure_version( ${KDE_MIN_VERSION} ${KDE_VERSION} KDE4_INSTALLED_VERSION_OK )
+
+
+ # KDE4_LIB_INSTALL_DIR and KDE4_INCLUDE_INSTALL_DIR are set in KDELibsDependencies.cmake,
+ # use them to set the KDE4_LIB_DIR and KDE4_INCLUDE_DIR "public interface" variables
+ set(KDE4_LIB_DIR ${KDE4_LIB_INSTALL_DIR} )
+ set(KDE4_INCLUDE_DIR ${KDE4_INCLUDE_INSTALL_DIR} )
+
+
+ # This setting is currently not recorded in KDELibsDependencies.cmake:
+ find_file(KDE4_PLASMA_OPENGL_FOUND plasma/glapplet.h PATHS ${KDE4_INCLUDE_DIR} NO_DEFAULT_PATH)
+
+ # Now include the file with the imported tools (executable targets).
+ # This export-file is generated and installed by the toplevel CMakeLists.txt of kdelibs.
+ # Having the libs and tools in two separate files should help with cross compiling.
+ include(${kde_cmake_module_dir}/KDELibs4ToolsTargets.cmake)
+
+ # get the build CONFIGURATIONS which were exported in this file, and use just the first
+ # of them to get the location of the installed executables
+ get_target_property(_importedConfigurations ${KDE4_TARGET_PREFIX}kconfig_compiler IMPORTED_CONFIGURATIONS )
+ list(GET _importedConfigurations 0 _firstConfig)
+
+ if(NOT WINCE)
+ get_target_property(KDE4_KCFGC_EXECUTABLE ${KDE4_TARGET_PREFIX}kconfig_compiler LOCATION_${_firstConfig})
+ get_target_property(KDE4_MEINPROC_EXECUTABLE ${KDE4_TARGET_PREFIX}meinproc4 LOCATION_${_firstConfig})
+ else(NOT WINCE)
+ set(KDE4_KCFGC_EXECUTABLE ${HOST_BINDIR}/${CMAKE_CFG_INTDIR}/kconfig_compiler )
+ set(KDE4_MEINPROC_EXECUTABLE ${HOST_BINDIR}/${CMAKE_CFG_INTDIR}/meinproc4 )
+ endif(NOT WINCE)
+ get_target_property(KDE4_KAUTH_POLICY_GEN_EXECUTABLE ${KDE4_TARGET_PREFIX}kauth-policy-gen LOCATION_${_firstConfig})
+ get_target_property(KDE4_MAKEKDEWIDGETS_EXECUTABLE ${KDE4_TARGET_PREFIX}makekdewidgets LOCATION_${_firstConfig})
+
+ # allow searching cmake modules in all given kde install locations (KDEDIRS based)
+ execute_process(COMMAND "${KDE4_KDECONFIG_EXECUTABLE}" --path data OUTPUT_VARIABLE _data_DIR ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+ file(TO_CMAKE_PATH "${_data_DIR}" _data_DIR)
+ foreach(dir ${_data_DIR})
+ set (apath "${dir}/cmake/modules")
+ if (EXISTS "${apath}")
+ set (included 0)
+ string(TOLOWER "${apath}" _apath)
+ # ignore already added pathes, case insensitive
+ foreach(adir ${CMAKE_MODULE_PATH})
+ string(TOLOWER "${adir}" _adir)
+ if ("${_adir}" STREQUAL "${_apath}")
+ set (included 1)
+ endif ("${_adir}" STREQUAL "${_apath}")
+ endforeach(adir)
+ if (NOT included)
+ message(STATUS "Adding ${apath} to CMAKE_MODULE_PATH")
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${apath}")
+ endif (NOT included)
+ endif (EXISTS "${apath}")
+ endforeach(dir)
+
+
+ # This file contains the exported library target from kdelibs (new with cmake 2.6.x), e.g.
+ # the library target "kdeui" is exported as "KDE4__kdeui". The "KDE4__" is used as
+ # "namespace" to separate the imported targets from "normal" targets, it is stored in
+ # KDE4_TARGET_PREFIX, which is set in KDELibsDependencies.cmake .
+ # This export-file is generated and installed by the toplevel CMakeLists.txt of kdelibs.
+ # Include it to "import" the libraries from kdelibs into the current projects as targets.
+ # This makes setting the _LIBRARY and _LIBS variables actually a bit superfluos, since e.g.
+ # the kdeui library could now also be used just as "KDE4__kdeui" and still have all their
+ # dependent libraries handled correctly. But to keep compatibility and not to change
+ # behaviour we set all these variables anyway as seen below. Alex
+ include(${kde_cmake_module_dir}/KDELibs4LibraryTargets.cmake)
+
+ # This one is for compatibility only:
+ set(KDE4_THREADWEAVER_LIBRARIES ${KDE4_TARGET_PREFIX}threadweaver )
+
+endif (_kdeBootStrapping)
+
+
+# Set the various KDE4_FOO_LIBRARY/LIBS variables.
+# In bootstrapping mode KDE4_TARGET_PREFIX is empty, so e.g. KDE4_KDECORE_LIBRARY
+# will be simply set to "kdecore".
+
+# Sorted by names:
+_kde4_set_lib_variables(KCMUTILS kcmutils "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KDE3SUPPORT kde3support "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KDECORE kdecore "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KDEUI kdeui "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KDEWEBKIT kdewebkit "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KDNSSD kdnssd "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KEMOTICONS kemoticons "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KFILE kfile "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KHTML khtml "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KIDLETIME kidletime "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KIO kio "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KJS kjs "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KJSAPI kjsapi "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KNEWSTUFF2 knewstuff2 "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KNEWSTUFF3 knewstuff3 "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KNOTIFYCONFIG knotifyconfig "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KPARTS kparts "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KPRINTUTILS kprintutils "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KROSSCORE krosscore "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KROSSUI krossui "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KTEXTEDITOR ktexteditor "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KUNITCONVERSION kunitconversion "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(KUTILS kutils "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(PLASMA plasma "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(SOLID solid "${KDE4_TARGET_PREFIX}")
+_kde4_set_lib_variables(THREADWEAVER threadweaver "${KDE4_TARGET_PREFIX}")
+
+if (UNIX)
+ _kde4_set_lib_variables(KDEFAKES kdefakes "${KDE4_TARGET_PREFIX}")
+ _kde4_set_lib_variables(KDESU kdesu "${KDE4_TARGET_PREFIX}")
+ _kde4_set_lib_variables(KPTY kpty "${KDE4_TARGET_PREFIX}")
+endif (UNIX)
+
+# The nepomuk target does not always exist, since is is built conditionally. When bootstrapping
+# we set it always anyways.
+if(_kdeBootStrapping OR TARGET ${KDE4_TARGET_PREFIX}nepomuk)
+ _kde4_set_lib_variables(NEPOMUK nepomuk "${KDE4_TARGET_PREFIX}")
+endif(_kdeBootStrapping OR TARGET ${KDE4_TARGET_PREFIX}nepomuk)
+
+
+################### try to find Phonon ############################################
+
+# we do this here instead of above together with the checks for Perl etc.
+# since FindPhonon.cmake also uses ${KDE4_LIB_INSTALL_DIR} to check for Phonon,
+# which helps with finding the phonon installed as part of kdesupport:
+
+# only make Phonon REQUIRED if KDE4 itself is REQUIRED
+find_package(Phonon 4.3.80 ${_REQ_STRING_KDE4})
+set(KDE4_PHONON_LIBRARY ${PHONON_LIBRARY})
+set(KDE4_PHONON_LIBS ${PHONON_LIBS})
+set(KDE4_PHONON_INCLUDES ${PHONON_INCLUDES})
+
+if(NOT PHONON_FOUND)
+ message(STATUS "KDE4 not found, because Phonon was not found")
+ return()
+endif(NOT PHONON_FOUND)
+
+
+##################### provide some options ##########################################
+
+option(KDE4_ENABLE_FINAL "Enable final all-in-one compilation")
+option(KDE4_BUILD_TESTS "Build the tests")
+option(KDE4_ENABLE_HTMLHANDBOOK "Create targets htmlhandbook for creating the html versions of the docbook docs")
+set(KDE4_SERIALIZE_TOOL "" CACHE STRING "Tool to serialize resource-intensive commands in parallel builds")
+
+# if CMake 2.6.3 or above is used, provide an option which should be used by other KDE packages
+# whether to install a CMake FooConfig.cmake into lib/foo/cmake/ or /lib/cmake/foo/
+# (with 2.6.3 and above also lib/cmake/foo/ is supported):
+if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.6.2)
+ option(KDE4_USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR "Prefer to install the <package>Config.cmake files to lib/cmake/<package> instead to lib/<package>/cmake" TRUE)
+else(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.6.2)
+ set(KDE4_USE_COMMON_CMAKE_PACKAGE_CONFIG_DIR FALSE)
+endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.6.2)
+
+# Position-Independent-Executable is a feature of Binutils, Libc, and GCC that creates an executable
+# which is something between a shared library and a normal executable.
+# Programs compiled with these features appear as ?shared object? with the file command.
+# info from "http://www.linuxfromscratch.org/hlfs/view/unstable/glibc/chapter02/pie.html"
+option(KDE4_ENABLE_FPIE "Enable platform supports PIE linking")
+
+if (WIN32)
+ list(APPEND CMAKE_MODULE_PATH "${CMAKE_INSTALL_PREFIX}/share/apps/cmake/modules")
+ find_package(KDEWin REQUIRED)
+ option(KDE4_ENABLE_UAC_MANIFEST "add manifest to make vista uac happy" OFF)
+ if (KDE4_ENABLE_UAC_MANIFEST)
+ find_program(KDE4_MT_EXECUTABLE mt
+ PATHS ${KDEWIN_INCLUDE_DIR}/../bin
+ NO_DEFAULT_PATH
+ )
+ if (KDE4_MT_EXECUTABLE)
+ message(STATUS "Found KDE manifest tool at ${KDE4_MT_EXECUTABLE} ")
+ else (KDE4_MT_EXECUTABLE)
+ message(STATUS "KDE manifest tool not found, manifest generating for Windows Vista disabled")
+ set (KDE4_ENABLE_UAC_MANIFEST OFF)
+ endif (KDE4_MT_EXECUTABLE)
+ endif (KDE4_ENABLE_UAC_MANIFEST)
+endif (WIN32)
+
+##################### some more settings ##########################################
+
+if( KDE4_ENABLE_FINAL)
+ add_definitions(-DKDE_USE_FINAL)
+endif(KDE4_ENABLE_FINAL)
+
+if(KDE4_SERIALIZE_TOOL)
+ # parallel build with many meinproc invocations can consume a huge amount of memory
+ set(KDE4_MEINPROC_EXECUTABLE ${KDE4_SERIALIZE_TOOL} ${KDE4_MEINPROC_EXECUTABLE})
+endif(KDE4_SERIALIZE_TOOL)
+
+# If we are building ! kdelibs, check where kdelibs are installed.
+# If they are installed in a directory which contains "lib64", we default to "64" for LIB_SUFFIX,
+# so the current project will by default also go into lib64.
+# The same for lib32. Alex
+set(_Init_LIB_SUFFIX "")
+if ("${KDE4_LIB_DIR}" MATCHES lib64)
+ set(_Init_LIB_SUFFIX 64)
+endif ("${KDE4_LIB_DIR}" MATCHES lib64)
+if ("${KDE4_LIB_DIR}" MATCHES lib32)
+ set(_Init_LIB_SUFFIX 32)
+endif ("${KDE4_LIB_DIR}" MATCHES lib32)
+
+set(LIB_SUFFIX "${_Init_LIB_SUFFIX}" CACHE STRING "Define suffix of directory name (32/64)" )
+
+
+########## the following are directories where stuff will be installed to ###########
+#
+# this has to be after find_xxx() block above, since there KDELibsDependencies.cmake is included
+# which contains the install dirs from kdelibs, which are reused below
+
+if (WIN32)
+# use relative install prefix to avoid hardcoded install paths in cmake_install.cmake files
+
+ set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" ) # The subdirectory relative to the install prefix where libraries will be installed (default is ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX})
+
+ set(EXEC_INSTALL_PREFIX "" ) # Base directory for executables and libraries
+ set(SHARE_INSTALL_PREFIX "share" ) # Base directory for files which go to share/
+ set(BIN_INSTALL_DIR "bin" ) # The install dir for executables (default ${EXEC_INSTALL_PREFIX}/bin)
+ set(SBIN_INSTALL_DIR "sbin" ) # The install dir for system executables (default ${EXEC_INSTALL_PREFIX}/sbin)
+
+ set(LIBEXEC_INSTALL_DIR "${BIN_INSTALL_DIR}" ) # The subdirectory relative to the install prefix where libraries will be installed (default is ${BIN_INSTALL_DIR})
+ set(INCLUDE_INSTALL_DIR "include" ) # The subdirectory to the header prefix
+
+ set(PLUGIN_INSTALL_DIR "lib${LIB_SUFFIX}/kde4" ) # "The subdirectory relative to the install prefix where plugins will be installed (default is ${LIB_INSTALL_DIR}/kde4)
+ set(IMPORTS_INSTALL_DIR "${PLUGIN_INSTALL_DIR}/imports" ) # "The subdirectory relative to the install prefix where imports will be installed
+ set(CONFIG_INSTALL_DIR "share/config" ) # The config file install dir
+ set(DATA_INSTALL_DIR "share/apps" ) # The parent directory where applications can install their data
+ set(HTML_INSTALL_DIR "share/doc/HTML" ) # The HTML install dir for documentation
+ set(ICON_INSTALL_DIR "share/icons" ) # The icon install dir (default ${SHARE_INSTALL_PREFIX}/share/icons/)
+ set(KCFG_INSTALL_DIR "share/config.kcfg" ) # The install dir for kconfig files
+ set(LOCALE_INSTALL_DIR "share/locale" ) # The install dir for translations
+ set(MIME_INSTALL_DIR "share/mimelnk" ) # The install dir for the mimetype desktop files
+ set(SERVICES_INSTALL_DIR "share/kde4/services" ) # The install dir for service (desktop, protocol, ...) files
+ set(SERVICETYPES_INSTALL_DIR "share/kde4/servicetypes" ) # The install dir for servicestypes desktop files
+ set(SOUND_INSTALL_DIR "share/sounds" ) # The install dir for sound files
+ set(TEMPLATES_INSTALL_DIR "share/templates" ) # The install dir for templates (Create new file...)
+ set(WALLPAPER_INSTALL_DIR "share/wallpapers" ) # The install dir for wallpapers
+ set(DEMO_INSTALL_DIR "share/demos" ) # The install dir for demos
+ set(KCONF_UPDATE_INSTALL_DIR "share/apps/kconf_update" ) # The kconf_update install dir
+ set(AUTOSTART_INSTALL_DIR "share/autostart" ) # The install dir for autostart files
+
+ set(XDG_APPS_INSTALL_DIR "share/applications/kde4" ) # The XDG apps dir
+ set(XDG_DIRECTORY_INSTALL_DIR "share/desktop-directories" ) # The XDG directory
+ set(XDG_MIME_INSTALL_DIR "share/mime/packages" ) # The install dir for the xdg mimetypes
+
+ set(SYSCONF_INSTALL_DIR "etc" ) # The sysconfig install dir (default /etc)
+ set(MAN_INSTALL_DIR "share/man" ) # The man install dir (default ${SHARE_INSTALL_PREFIX}/man/)
+ set(INFO_INSTALL_DIR "share/info" ) # The info install dir (default ${SHARE_INSTALL_PREFIX}/info)")
+ set(DBUS_INTERFACES_INSTALL_DIR "share/dbus-1/interfaces" ) # The dbus interfaces install dir (default ${SHARE_INSTALL_PREFIX}/dbus-1/interfaces)")
+ set(DBUS_SERVICES_INSTALL_DIR "share/dbus-1/services" ) # The dbus services install dir (default ${SHARE_INSTALL_PREFIX}/dbus-1/services)")
+ set(DBUS_SYSTEM_SERVICES_INSTALL_DIR "share/dbus-1/system-services" ) # The dbus system services install dir (default ${SHARE_INSTALL_PREFIX}/dbus-1/system-services)")
+
+else (WIN32)
+
+ # This macro implements some very special logic how to deal with the cache.
+ # By default the various install locations inherit their value from their "parent" variable
+ # so if you set CMAKE_INSTALL_PREFIX, then EXEC_INSTALL_PREFIX, PLUGIN_INSTALL_DIR will
+ # calculate their value by appending subdirs to CMAKE_INSTALL_PREFIX .
+ # This would work completely without using the cache.
+ # But if somebody wants e.g. a different EXEC_INSTALL_PREFIX this value has to go into
+ # the cache, otherwise it will be forgotten on the next cmake run.
+ # Once a variable is in the cache, it doesn't depend on its "parent" variables
+ # anymore and you can only change it by editing it directly.
+ # this macro helps in this regard, because as long as you don't set one of the
+ # variables explicitely to some location, it will always calculate its value from its
+ # parents. So modifying CMAKE_INSTALL_PREFIX later on will have the desired effect.
+ # But once you decide to set e.g. EXEC_INSTALL_PREFIX to some special location
+ # this will go into the cache and it will no longer depend on CMAKE_INSTALL_PREFIX.
+ #
+ # additionally if installing to the same location as kdelibs, the other install
+ # directories are reused from the installed kdelibs
+ macro(_SET_FANCY _var _value _comment)
+ set(predefinedvalue "${_value}")
+ if ("${CMAKE_INSTALL_PREFIX}" STREQUAL "${KDE4_INSTALL_DIR}" AND DEFINED KDE4_${_var})
+ set(predefinedvalue "${KDE4_${_var}}")
+ endif ("${CMAKE_INSTALL_PREFIX}" STREQUAL "${KDE4_INSTALL_DIR}" AND DEFINED KDE4_${_var})
+
+ if (NOT DEFINED ${_var})
+ set(${_var} ${predefinedvalue})
+ else (NOT DEFINED ${_var})
+ set(${_var} "${${_var}}" CACHE PATH "${_comment}")
+ endif (NOT DEFINED ${_var})
+ endmacro(_SET_FANCY)
+
+ if(APPLE)
+ set(BUNDLE_INSTALL_DIR "/Applications/KDE4" CACHE PATH "Directory where application bundles will be installed to on OSX" )
+ endif(APPLE)
+
+ _set_fancy(EXEC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" "Base directory for executables and libraries")
+ _set_fancy(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share" "Base directory for files which go to share/")
+ _set_fancy(BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" "The install dir for executables (default ${EXEC_INSTALL_PREFIX}/bin)")
+ _set_fancy(SBIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/sbin" "The install dir for system executables (default ${EXEC_INSTALL_PREFIX}/sbin)")
+ _set_fancy(LIB_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX}" "The subdirectory relative to the install prefix where libraries will be installed (default is ${EXEC_INSTALL_PREFIX}/lib${LIB_SUFFIX})")
+ _set_fancy(LIBEXEC_INSTALL_DIR "${LIB_INSTALL_DIR}/kde4/libexec" "The subdirectory relative to the install prefix where libraries will be installed (default is ${LIB_INSTALL_DIR}/kde4/libexec)")
+ _set_fancy(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" "The subdirectory to the header prefix")
+
+ _set_fancy(PLUGIN_INSTALL_DIR "${LIB_INSTALL_DIR}/kde4" "The subdirectory relative to the install prefix where plugins will be installed (default is ${LIB_INSTALL_DIR}/kde4)")
+ _set_fancy(IMPORTS_INSTALL_DIR "${PLUGIN_INSTALL_DIR}/imports" "The subdirectory relative to the install prefix where imports will be installed")
+ _set_fancy(CONFIG_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/config" "The config file install dir")
+ _set_fancy(DATA_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/apps" "The parent directory where applications can install their data")
+ _set_fancy(HTML_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/doc/HTML" "The HTML install dir for documentation")
+ _set_fancy(ICON_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/icons" "The icon install dir (default ${SHARE_INSTALL_PREFIX}/share/icons/)")
+ _set_fancy(KCFG_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/config.kcfg" "The install dir for kconfig files")
+ _set_fancy(LOCALE_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/locale" "The install dir for translations")
+ _set_fancy(MIME_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/mimelnk" "The install dir for the mimetype desktop files")
+ _set_fancy(SERVICES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/kde4/services" "The install dir for service (desktop, protocol, ...) files")
+ _set_fancy(SERVICETYPES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/kde4/servicetypes" "The install dir for servicestypes desktop files")
+ _set_fancy(SOUND_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/sounds" "The install dir for sound files")
+ _set_fancy(TEMPLATES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/templates" "The install dir for templates (Create new file...)")
+ _set_fancy(WALLPAPER_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/wallpapers" "The install dir for wallpapers")
+ _set_fancy(DEMO_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/demos" "The install dir for demos")
+ _set_fancy(KCONF_UPDATE_INSTALL_DIR "${DATA_INSTALL_DIR}/kconf_update" "The kconf_update install dir")
+ _set_fancy(AUTOSTART_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/autostart" "The install dir for autostart files")
+
+ _set_fancy(XDG_APPS_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/applications/kde4" "The XDG apps dir")
+ _set_fancy(XDG_DIRECTORY_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/desktop-directories" "The XDG directory")
+ _set_fancy(XDG_MIME_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/mime/packages" "The install dir for the xdg mimetypes")
+
+ _set_fancy(SYSCONF_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/etc" "The sysconfig install dir (default ${CMAKE_INSTALL_PREFIX}/etc)")
+ _set_fancy(MAN_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/man" "The man install dir (default ${SHARE_INSTALL_PREFIX}/man/)")
+ _set_fancy(INFO_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/info" "The info install dir (default ${SHARE_INSTALL_PREFIX}/info)")
+ _set_fancy(DBUS_INTERFACES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/dbus-1/interfaces" "The dbus interfaces install dir (default ${SHARE_INSTALL_PREFIX}/dbus-1/interfaces)")
+ _set_fancy(DBUS_SERVICES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/dbus-1/services" "The dbus services install dir (default ${SHARE_INSTALL_PREFIX}/dbus-1/services)")
+ _set_fancy(DBUS_SYSTEM_SERVICES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/dbus-1/system-services" "The dbus system services install dir (default ${SHARE_INSTALL_PREFIX}/dbus-1/system-services)")
+
+endif (WIN32)
+
+
+# For more documentation see above.
+# Later on it will be possible to extend this for installing OSX frameworks
+# The COMPONENT Devel argument has the effect that static libraries belong to the
+# "Devel" install component. If we use this also for all install() commands
+# for header files, it will be possible to install
+# -everything: make install OR cmake -P cmake_install.cmake
+# -only the development files: cmake -DCOMPONENT=Devel -P cmake_install.cmake
+# -everything except the development files: cmake -DCOMPONENT=Unspecified -P cmake_install.cmake
+# This can then also be used for packaging with cpack.
+set(INSTALL_TARGETS_DEFAULT_ARGS RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
+ LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
+ ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" COMPONENT Devel )
+
+
+# on the Mac support an extra install directory for application bundles starting with cmake 2.6
+if(APPLE)
+ set(INSTALL_TARGETS_DEFAULT_ARGS ${INSTALL_TARGETS_DEFAULT_ARGS}
+ BUNDLE DESTINATION "${BUNDLE_INSTALL_DIR}" )
+endif(APPLE)
+
+
+############## add some more default search paths ###############
+#
+# the KDE4_xxx_INSTALL_DIR variables are empty when building kdelibs itself
+# and otherwise point to the kde4 install dirs
+
+set(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH}
+ "${KDE4_INCLUDE_INSTALL_DIR}")
+
+set(CMAKE_SYSTEM_PROGRAM_PATH ${CMAKE_SYSTEM_PROGRAM_PATH}
+ "${KDE4_BIN_INSTALL_DIR}" )
+
+set(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH}
+ "${KDE4_LIB_INSTALL_DIR}" )
+
+# under Windows dlls may be also installed in bin/
+if(WIN32)
+ set(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH}
+ "${_CMAKE_INSTALL_DIR}/bin"
+ "${CMAKE_INSTALL_PREFIX}/bin" )
+endif(WIN32)
+
+
+######################################################
+# and now the platform specific stuff
+######################################################
+
+# Set a default build type for single-configuration
+# CMake generators if no build type is set.
+if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE RelWithDebInfo)
+endif (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
+
+
+if (WIN32)
+
+ if(CYGWIN)
+ message(FATAL_ERROR "Cygwin is NOT supported, use mingw or MSVC to build KDE4.")
+ endif(CYGWIN)
+
+ # limit win32 packaging to kdelibs at now
+ # don't know if package name, version and notes are always available
+ if(_kdeBootStrapping)
+ find_package(KDEWIN_Packager)
+ if (KDEWIN_PACKAGER_FOUND)
+ kdewin_packager("kdelibs" "${KDE_VERSION}" "KDE base library" "")
+ endif (KDEWIN_PACKAGER_FOUND)
+
+ include(Win32Macros)
+ addExplorerWrapper("kdelibs")
+ endif(_kdeBootStrapping)
+
+ set( _KDE4_PLATFORM_INCLUDE_DIRS ${KDEWIN_INCLUDES})
+
+ # if we are compiling kdelibs, add KDEWIN_LIBRARIES explicitely,
+ # otherwise they come from KDELibsDependencies.cmake, Alex
+ if (_kdeBootStrapping)
+ set( KDE4_KDECORE_LIBS ${KDE4_KDECORE_LIBS} ${KDEWIN_LIBRARIES} )
+ endif (_kdeBootStrapping)
+
+ # we prefer to use a different postfix for debug libs only on Windows
+ # does not work atm
+ set(CMAKE_DEBUG_POSTFIX "")
+
+ # windows, microsoft compiler
+ if(MSVC)
+ set( _KDE4_PLATFORM_DEFINITIONS -DKDE_FULL_TEMPLATE_EXPORT_INSTANTIATION -DWIN32_LEAN_AND_MEAN )
+
+ # C4250: 'class1' : inherits 'class2::member' via dominance
+ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4250" )
+ # C4251: 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
+ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4251" )
+ # C4396: 'identifier' : 'function' the inline specifier cannot be used when a friend declaration refers to a specialization of a function template
+ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4396" )
+ # to avoid a lot of deprecated warnings
+ add_definitions( -D_CRT_SECURE_NO_DEPRECATE
+ -D_CRT_SECURE_NO_WARNINGS
+ -D_CRT_NONSTDC_NO_DEPRECATE
+ -D_SCL_SECURE_NO_WARNINGS
+ )
+ # 'identifier' : no suitable definition provided for explicit template instantiation request
+ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4661" )
+ endif(MSVC)
+
+
+ # for visual studio IDE set the path correctly for custom commands
+ # maybe under windows bat-files should be generated for running apps during the build
+ if(MSVC_IDE)
+ get_filename_component(PERL_LOCATION "${PERL_EXECUTABLE}" PATH)
+ file(TO_NATIVE_PATH "${PERL_LOCATION}" PERL_PATH_WINDOWS)
+ file(TO_NATIVE_PATH "${QT_BINARY_DIR}" QT_BIN_DIR_WINDOWS)
+ set(CMAKE_MSVCIDE_RUN_PATH "${PERL_PATH_WINDOWS}\;${QT_BIN_DIR_WINDOWS}"
+ CACHE STATIC "MSVC IDE Run path" FORCE)
+ endif(MSVC_IDE)
+
+ # we don't support anything below w2k and all winapi calls are unicodes
+ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_WIN32_WINNT=0x0501 -DWINVER=0x0501 -D_WIN32_IE=0x0501 -DUNICODE" )
+endif (WIN32)
+
+
+# setup default RPATH/install_name handling, may be overridden by KDE4_HANDLE_RPATH_FOR_EXECUTABLE
+# It sets up to build with full RPATH. When installing, RPATH will be changed to the LIB_INSTALL_DIR
+# and all link directories which are not inside the current build dir.
+if (UNIX)
+ set( _KDE4_PLATFORM_INCLUDE_DIRS)
+
+ # the rest is RPATH handling
+ # here the defaults are set
+ # which are partly overwritten in kde4_handle_rpath_for_library()
+ # and kde4_handle_rpath_for_executable(), both located in KDE4Macros.cmake, Alex
+ if (APPLE)
+ set(CMAKE_INSTALL_NAME_DIR ${LIB_INSTALL_DIR})
+ else (APPLE)
+ # add our LIB_INSTALL_DIR to the RPATH (but only when it is not one of the standard system link
+ # directories listed in CMAKE_{PLATFORM,C,CXX}_IMPLICIT_LINK_DIRECTORIES) and use the RPATH figured out by cmake when compiling
+
+ list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${LIB_INSTALL_DIR}" _isSystemPlatformLibDir)
+ list(FIND CMAKE_C_IMPLICIT_LINK_DIRECTORIES "${LIB_INSTALL_DIR}" _isSystemCLibDir)
+ list(FIND CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "${LIB_INSTALL_DIR}" _isSystemCxxLibDir)
+ if("${_isSystemPlatformLibDir}" STREQUAL "-1" AND "${_isSystemCLibDir}" STREQUAL "-1" AND "${_isSystemCxxLibDir}" STREQUAL "-1")
+ set(CMAKE_INSTALL_RPATH "${LIB_INSTALL_DIR}")
+ endif("${_isSystemPlatformLibDir}" STREQUAL "-1" AND "${_isSystemCLibDir}" STREQUAL "-1" AND "${_isSystemCxxLibDir}" STREQUAL "-1")
+
+ set(CMAKE_SKIP_BUILD_RPATH FALSE)
+ set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+ endif (APPLE)
+endif (UNIX)
+
+
+if (Q_WS_X11)
+ # Done by FindQt4.cmake already
+ #find_package(X11 REQUIRED)
+ # UNIX has already set _KDE4_PLATFORM_INCLUDE_DIRS, so append
+ set(_KDE4_PLATFORM_INCLUDE_DIRS ${_KDE4_PLATFORM_INCLUDE_DIRS} ${X11_INCLUDE_DIR} )
+endif (Q_WS_X11)
+
+
+# This will need to be modified later to support either Qt/X11 or Qt/Mac builds
+if (APPLE)
+
+ set ( _KDE4_PLATFORM_DEFINITIONS -D__APPLE_KDE__ )
+
+ # we need to set MACOSX_DEPLOYMENT_TARGET to (I believe) at least 10.2 or maybe 10.3 to allow
+ # -undefined dynamic_lookup; in the future we should do this programmatically
+ # hmm... why doesn't this work?
+ set (ENV{MACOSX_DEPLOYMENT_TARGET} 10.3)
+
+ # "-undefined dynamic_lookup" means we don't care about missing symbols at link-time by default
+ # this is bad, but unavoidable until there is the equivalent of libtool -no-undefined implemented
+ # or perhaps it already is, and I just don't know where to look ;)
+
+ set (CMAKE_SHARED_LINKER_FLAGS "-single_module -multiply_defined suppress ${CMAKE_SHARED_LINKER_FLAGS}")
+ set (CMAKE_MODULE_LINKER_FLAGS "-multiply_defined suppress ${CMAKE_MODULE_LINKER_FLAGS}")
+ #set(CMAKE_SHARED_LINKER_FLAGS "-single_module -undefined dynamic_lookup -multiply_defined suppress")
+ #set(CMAKE_MODULE_LINKER_FLAGS "-undefined dynamic_lookup -multiply_defined suppress")
+
+ # we profile...
+ if(CMAKE_BUILD_TYPE_TOLOWER MATCHES profile)
+ set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
+ set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
+ endif(CMAKE_BUILD_TYPE_TOLOWER MATCHES profile)
+
+ # removed -Os, was there a special reason for using -Os instead of -O2 ?, Alex
+ # optimization flags are set below for the various build types
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-common")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common")
+endif (APPLE)
+
+
+if (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU)
+ if (CMAKE_COMPILER_IS_GNUCXX)
+ set ( _KDE4_PLATFORM_DEFINITIONS -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_GNU_SOURCE)
+ set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}")
+ set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_MODULE_LINKER_FLAGS}")
+
+ set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--enable-new-dtags ${CMAKE_SHARED_LINKER_FLAGS}")
+ set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--enable-new-dtags ${CMAKE_MODULE_LINKER_FLAGS}")
+ set ( CMAKE_EXE_LINKER_FLAGS "-Wl,--enable-new-dtags ${CMAKE_EXE_LINKER_FLAGS}")
+
+ # we profile...
+ if(CMAKE_BUILD_TYPE_TOLOWER MATCHES profile)
+ set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
+ set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage")
+ endif(CMAKE_BUILD_TYPE_TOLOWER MATCHES profile)
+ endif (CMAKE_COMPILER_IS_GNUCXX)
+ if (CMAKE_C_COMPILER MATCHES "icc")
+ set ( _KDE4_PLATFORM_DEFINITIONS -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_GNU_SOURCE)
+ set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}")
+ set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_MODULE_LINKER_FLAGS}")
+ endif (CMAKE_C_COMPILER MATCHES "icc")
+endif (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU)
+
+if (UNIX)
+ set ( _KDE4_PLATFORM_DEFINITIONS "${_KDE4_PLATFORM_DEFINITIONS} -D_LARGEFILE64_SOURCE")
+
+ check_cxx_source_compiles("
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+ We can't simply define LARGE_OFF_T to be 9223372036854775807,
+ since some C++ compilers masquerading as C compilers
+ incorrectly reject 9223372036854775807. */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+
+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1];
+ int main() { return 0; }
+" _OFFT_IS_64BIT)
+
+ if (NOT _OFFT_IS_64BIT)
+ set ( _KDE4_PLATFORM_DEFINITIONS "${_KDE4_PLATFORM_DEFINITIONS} -D_FILE_OFFSET_BITS=64")
+ endif (NOT _OFFT_IS_64BIT)
+endif (UNIX)
+
+if (CMAKE_SYSTEM_NAME MATCHES BSD)
+ set ( _KDE4_PLATFORM_DEFINITIONS -D_GNU_SOURCE )
+ set ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lc")
+ set ( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -lc")
+endif (CMAKE_SYSTEM_NAME MATCHES BSD)
+
+
+############################################################
+# compiler specific settings
+############################################################
+
+
+# this macro is for internal use only.
+macro(KDE_CHECK_FLAG_EXISTS FLAG VAR DOC)
+ if(NOT ${VAR} MATCHES "${FLAG}")
+ set(${VAR} "${${VAR}} ${FLAG}" CACHE STRING "Flags used by the linker during ${DOC} builds." FORCE)
+ endif(NOT ${VAR} MATCHES "${FLAG}")
+endmacro(KDE_CHECK_FLAG_EXISTS FLAG VAR)
+
+if (MSVC)
+ set (KDE4_ENABLE_EXCEPTIONS -EHsc)
+
+ # Qt disables the native wchar_t type, do it too to avoid linking issues
+ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Zc:wchar_t-" )
+
+ # make sure that no header adds libcmt by default using #pragma comment(lib, "libcmt.lib") as done by mfc/afx.h
+ kde_check_flag_exists("/NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt" CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "Release with Debug Info")
+ kde_check_flag_exists("/NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt" CMAKE_EXE_LINKER_FLAGS_RELEASE "release")
+ kde_check_flag_exists("/NODEFAULTLIB:libcmt /DEFAULTLIB:msvcrt" CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "release minsize")
+ kde_check_flag_exists("/NODEFAULTLIB:libcmtd /DEFAULTLIB:msvcrtd" CMAKE_EXE_LINKER_FLAGS_DEBUG "debug")
+endif(MSVC)
+
+# This macro is for internal use only
+# Return the directories present in gcc's include path.
+macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _result)
+ set(${_result})
+ set(_gccOutput)
+ file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n" )
+ execute_process(COMMAND ${CMAKE_C_COMPILER} -v -E -x ${_lang} -dD dummy
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles
+ ERROR_VARIABLE _gccOutput
+ OUTPUT_VARIABLE _gccStdout )
+ file(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy")
+
+ if( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+) *\n *End of (search) list" )
+ SET(${_result} ${CMAKE_MATCH_1})
+ STRING(REPLACE "\n" " " ${_result} "${${_result}}")
+ SEPARATE_ARGUMENTS(${_result})
+ ENDIF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+) *\n *End of (search) list" )
+ENDMACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang)
+
+if (CMAKE_COMPILER_IS_GNUCC)
+ _DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c _dirs)
+ set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
+ ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES} ${_dirs})
+endif (CMAKE_COMPILER_IS_GNUCC)
+
+if (CMAKE_COMPILER_IS_GNUCXX)
+ _DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c++ _dirs)
+ set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
+ ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES} ${_dirs})
+
+ set (KDE4_ENABLE_EXCEPTIONS "-fexceptions -UQT_NO_EXCEPTIONS")
+ # Select flags.
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG -DQT_NO_DEBUG")
+ set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG -DQT_NO_DEBUG")
+ set(CMAKE_CXX_FLAGS_DEBUG "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline")
+ set(CMAKE_CXX_FLAGS_DEBUGFULL "-g3 -fno-inline")
+ set(CMAKE_CXX_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
+ set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG -DQT_NO_DEBUG")
+ set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG -DQT_NO_DEBUG")
+ set(CMAKE_C_FLAGS_DEBUG "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline")
+ set(CMAKE_C_FLAGS_DEBUGFULL "-g3 -fno-inline")
+ set(CMAKE_C_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
+
+ if (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU)
+ set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-long-long -std=iso9899:1990 -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
+ # As off Qt 4.6.x we need to override the new exception macros if we want compile with -fno-exceptions
+ 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-check-new -fno-common")
+ add_definitions (-D_BSD_SOURCE)
+ endif (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU)
+
+ if (CMAKE_SYSTEM_NAME STREQUAL GNU)
+ set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread")
+ set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -pthread")
+ endif (CMAKE_SYSTEM_NAME STREQUAL GNU)
+
+ # gcc under Windows
+ if (MINGW)
+ set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--export-all-symbols -Wl,--disable-auto-import")
+ set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--export-all-symbols -Wl,--disable-auto-import")
+ endif (MINGW)
+
+ check_cxx_compiler_flag(-fPIE HAVE_FPIE_SUPPORT)
+ if(KDE4_ENABLE_FPIE)
+ if(HAVE_FPIE_SUPPORT)
+ set (KDE4_CXX_FPIE_FLAGS "-fPIE")
+ set (KDE4_PIE_LDFLAGS "-pie")
+ else(HAVE_FPIE_SUPPORT)
+ message(STATUS "Your compiler doesn't support the PIE flag")
+ endif(HAVE_FPIE_SUPPORT)
+ endif(KDE4_ENABLE_FPIE)
+
+ check_cxx_compiler_flag(-Woverloaded-virtual __KDE_HAVE_W_OVERLOADED_VIRTUAL)
+ if(__KDE_HAVE_W_OVERLOADED_VIRTUAL)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual")
+ endif(__KDE_HAVE_W_OVERLOADED_VIRTUAL)
+
+ # visibility support
+ check_cxx_compiler_flag(-fvisibility=hidden __KDE_HAVE_GCC_VISIBILITY)
+ set( __KDE_HAVE_GCC_VISIBILITY ${__KDE_HAVE_GCC_VISIBILITY} CACHE BOOL "GCC support for hidden visibility")
+
+ # get the gcc version
+ exec_program(${CMAKE_C_COMPILER} ARGS ${CMAKE_C_COMPILER_ARG1} --version OUTPUT_VARIABLE _gcc_version_info)
+
+ string (REGEX MATCH "[345]\\.[0-9]\\.[0-9]" _gcc_version "${_gcc_version_info}")
+ # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the patch level, handle this here:
+ if (NOT _gcc_version)
+ string (REGEX MATCH ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0" _gcc_version "${gcc_on_macos}")
+ if (gcc_on_macos)
+ string (REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0" _gcc_version "${_gcc_version_info}")
+ endif (gcc_on_macos)
+ endif (NOT _gcc_version)
+
+ if (_gcc_version)
+ macro_ensure_version("4.1.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_1)
+ macro_ensure_version("4.2.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_2)
+ macro_ensure_version("4.3.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_3)
+ endif (_gcc_version)
+
+ # save a little by making local statics not threadsafe
+ # ### do not enable it for older compilers, see
+ # ### http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31806
+ if (GCC_IS_NEWER_THAN_4_3)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-threadsafe-statics")
+ endif (GCC_IS_NEWER_THAN_4_3)
+
+ set(_GCC_COMPILED_WITH_BAD_ALLOCATOR FALSE)
+ if (GCC_IS_NEWER_THAN_4_1)
+ exec_program(${CMAKE_C_COMPILER} ARGS ${CMAKE_C_COMPILER_ARG1} -v OUTPUT_VARIABLE _gcc_alloc_info)
+ string(REGEX MATCH "(--enable-libstdcxx-allocator=mt)" _GCC_COMPILED_WITH_BAD_ALLOCATOR "${_gcc_alloc_info}")
+ endif (GCC_IS_NEWER_THAN_4_1)
+
+ if (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR AND NOT WIN32)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
+ set (KDE4_C_FLAGS "-fvisibility=hidden")
+ # check that Qt defines Q_DECL_EXPORT as __attribute__ ((visibility("default")))
+ # if it doesn't and KDE compiles with hidden default visibiltiy plugins will break
+ set(_source "#include <QtCore/QtGlobal>\n int main()\n {\n #ifndef QT_VISIBILITY_AVAILABLE \n #error QT_VISIBILITY_AVAILABLE is not available\n #endif \n }\n")
+ set(_source_file ${CMAKE_BINARY_DIR}/CMakeTmp/check_qt_visibility.cpp)
+ file(WRITE "${_source_file}" "${_source}")
+ set(_include_dirs "-DINCLUDE_DIRECTORIES:STRING=${QT_INCLUDES}")
+
+ try_compile(_compile_result ${CMAKE_BINARY_DIR} ${_source_file} CMAKE_FLAGS "${_include_dirs}" OUTPUT_VARIABLE _compile_output_var)
+
+ if(NOT _compile_result)
+ message("${_compile_output_var}")
+ message(FATAL_ERROR "Qt compiled without support for -fvisibility=hidden. This will break plugins and linking of some applications. Please fix your Qt installation (try passing --reduce-exports to configure).")
+ endif(NOT _compile_result)
+
+ if (GCC_IS_NEWER_THAN_4_2)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=return-type -fvisibility-inlines-hidden")
+ endif (GCC_IS_NEWER_THAN_4_2)
+ else (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR AND NOT WIN32)
+ set (__KDE_HAVE_GCC_VISIBILITY 0)
+ endif (__KDE_HAVE_GCC_VISIBILITY AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR AND NOT WIN32)
+
+endif (CMAKE_COMPILER_IS_GNUCXX)
+
+
+if (CMAKE_C_COMPILER MATCHES "icc")
+
+ set (KDE4_ENABLE_EXCEPTIONS -fexceptions)
+ # Select flags.
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
+ set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG -DQT_NO_DEBUG")
+ set(CMAKE_CXX_FLAGS_DEBUG "-O2 -g -fno-inline -noalign")
+ set(CMAKE_CXX_FLAGS_DEBUGFULL "-g -fno-inline -noalign")
+ set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g")
+ set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG -DQT_NO_DEBUG")
+ set(CMAKE_C_FLAGS_DEBUG "-O2 -g -fno-inline -noalign")
+ set(CMAKE_C_FLAGS_DEBUGFULL "-g -fno-inline -noalign")
+
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ansi -Wall -w1 -Wpointer-arith -fno-common")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ansi -Wall -w1 -Wpointer-arith -fno-exceptions -fno-common")
+
+ # visibility support
+ set(__KDE_HAVE_ICC_VISIBILITY)
+# check_cxx_compiler_flag(-fvisibility=hidden __KDE_HAVE_ICC_VISIBILITY)
+# if (__KDE_HAVE_ICC_VISIBILITY)
+# set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
+# endif (__KDE_HAVE_ICC_VISIBILITY)
+
+endif (CMAKE_C_COMPILER MATCHES "icc")
+
+
+########### end of platform specific stuff ##########################
+
+
+# KDE4Macros.cmake contains all the KDE specific macros
+include(${kde_cmake_module_dir}/KDE4Macros.cmake)
+
+
+# decide whether KDE4 has been found
+set(KDE4_FOUND FALSE)
+if (KDE4_INCLUDE_DIR AND KDE4_LIB_DIR AND KDE4_KCFGC_EXECUTABLE AND KDE4_INSTALLED_VERSION_OK)
+ set(KDE4_FOUND TRUE)
+endif (KDE4_INCLUDE_DIR AND KDE4_LIB_DIR AND KDE4_KCFGC_EXECUTABLE AND KDE4_INSTALLED_VERSION_OK)
+
+
+macro (KDE4_PRINT_RESULTS)
+
+ # inside kdelibs the include dir and lib dir are internal, not "found"
+ if (NOT _kdeBootStrapping)
+ if(KDE4_INCLUDE_DIR)
+ message(STATUS "Found KDE 4.8 include dir: ${KDE4_INCLUDE_DIR}")
+ else(KDE4_INCLUDE_DIR)
+ message(STATUS "ERROR: unable to find the KDE 4 headers")
+ endif(KDE4_INCLUDE_DIR)
+
+ if(KDE4_LIB_DIR)
+ message(STATUS "Found KDE 4.8 library dir: ${KDE4_LIB_DIR}")
+ else(KDE4_LIB_DIR)
+ message(STATUS "ERROR: unable to find the KDE 4 core library")
+ endif(KDE4_LIB_DIR)
+ endif (NOT _kdeBootStrapping)
+
+ if(KDE4_KCFGC_EXECUTABLE)
+ message(STATUS "Found the KDE4 kconfig_compiler preprocessor: ${KDE4_KCFGC_EXECUTABLE}")
+ else(KDE4_KCFGC_EXECUTABLE)
+ message(STATUS "Didn't find the KDE4 kconfig_compiler preprocessor")
+ endif(KDE4_KCFGC_EXECUTABLE)
+
+ if(AUTOMOC4_EXECUTABLE)
+ message(STATUS "Found automoc4: ${AUTOMOC4_EXECUTABLE}")
+ else(AUTOMOC4_EXECUTABLE)
+ message(STATUS "Didn't find automoc4")
+ endif(AUTOMOC4_EXECUTABLE)
+endmacro (KDE4_PRINT_RESULTS)
+
+
+if (KDE4Internal_FIND_REQUIRED AND NOT KDE4_FOUND)
+ #bail out if something wasn't found
+ kde4_print_results()
+ if (NOT KDE4_INSTALLED_VERSION_OK)
+ message(FATAL_ERROR "ERROR: the installed kdelibs version ${KDE_VERSION} is too old, at least version ${KDE_MIN_VERSION} is required")
+ endif (NOT KDE4_INSTALLED_VERSION_OK)
+
+ if (NOT KDE4_KCFGC_EXECUTABLE)
+ message(FATAL_ERROR "ERROR: could not detect a usable kconfig_compiler")
+ endif (NOT KDE4_KCFGC_EXECUTABLE)
+
+ message(FATAL_ERROR "ERROR: could NOT find everything required for compiling KDE 4 programs")
+endif (KDE4Internal_FIND_REQUIRED AND NOT KDE4_FOUND)
+
+if (NOT KDE4Internal_FIND_QUIETLY)
+ kde4_print_results()
+endif (NOT KDE4Internal_FIND_QUIETLY)
+
+#add the found Qt and KDE include directories to the current include path
+#the ${KDE4_INCLUDE_DIR}/KDE directory is for forwarding includes, eg. #include <KMainWindow>
+set(KDE4_INCLUDES
+ ${KDE4_INCLUDE_DIR}
+ ${KDE4_INCLUDE_DIR}/KDE
+ ${KDE4_PHONON_INCLUDES}
+ ${QT_INCLUDES}
+ ${_KDE4_PLATFORM_INCLUDE_DIRS}
+)
+
+# Used by kdebug.h: the "toplevel dir" is one level above CMAKE_SOURCE_DIR
+get_filename_component(_KDE4_CMAKE_TOPLEVEL_DIR "${CMAKE_SOURCE_DIR}/.." ABSOLUTE)
+string(LENGTH "${_KDE4_CMAKE_TOPLEVEL_DIR}" _KDE4_CMAKE_TOPLEVEL_DIR_LENGTH)
+
+set(KDE4_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS} -DQT_NO_STL -DQT_NO_CAST_TO_ASCII -D_REENTRANT -DKDE_DEPRECATED_WARNINGS -DKDE4_CMAKE_TOPLEVEL_DIR_LENGTH=${_KDE4_CMAKE_TOPLEVEL_DIR_LENGTH})
+
+if (NOT _kde4_uninstall_rule_created)
+ set(_kde4_uninstall_rule_created TRUE)
+
+ configure_file("${kde_cmake_module_dir}/kde4_cmake_uninstall.cmake.in" "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake" @ONLY)
+
+ add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake")
+
+endif (NOT _kde4_uninstall_rule_created)
+
+endif(NOT KDE4_FOUND)
diff --git a/kdecore/cmake/modules/FindKDE4Workspace.cmake b/kdecore/cmake/modules/FindKDE4Workspace.cmake
new file mode 100644
index 0000000..660c7b8
--- /dev/null
+++ b/kdecore/cmake/modules/FindKDE4Workspace.cmake
@@ -0,0 +1,71 @@
+# Find if we installed kdebase/workspaces.
+# Once done this will define
+#
+# KDE4WORKSPACE_FOUND - system has KDE workspace installed
+# KDE4WORKSPACE_INCLUDE_DIR - the KDE workspace include directory
+#
+# It also sets variables for the following libraries:
+# KDE4WORKSPACE_TASKMANAGER_LIBRARY, KDE4WORKSPACE_TASKMANAGER_LIBS
+# KDE4WORKSPACE_KWORKSPACE_LIBRARY, KDE4WORKSPACE_KWORKSPACE_LIBS
+# KDE4WORKSPACE_SOLIDCONTROLIFACES_LIBRARY, KDE4WORKSPACE_SOLIDCONTROLIFACES_LIBS
+# KDE4WORKSPACE_SOLIDCONTROL_LIBRARY, KDE4WORKSPACE_SOLIDCONTROL_LIBS
+# KDE4WORKSPACE_PROCESSUI_LIBRARY, KDE4WORKSPACE_PROCESSUI_LIBS
+# KDE4WORKSPACE_LSOFUI_LIBRARY, KDE4WORKSPACE_LSOFUI_LIBS
+# KDE4WORKSPACE_PLASMACLOCK_LIBRARY, KDE4WORKSPACE_PLASMACLOCK_LIBS
+# KDE4WORKSPACE_NEPOMUKQUERYCLIENT_LIBRARY, KDE4WORKSPACE_NEPOMUKQUERYCLIENT_LIBS
+# KDE4WORKSPACE_NEPOMUKQUERY_LIBRARY, KDE4WORKSPACE_NEPOMUKQUERY_LIBS
+# KDE4WORKSPACE_KSCREENSAVER_LIBRARY, KDE4WORKSPACE_KSCREENSAVER_LIBS
+# KDE4WORKSPACE_WEATHERION_LIBRARY, KDE4WORKSPACE_WEATHERION_LIBS
+# KDE4WORKSPACE_KWINEFFECTS_LIBRARY, KDE4WORKSPACE_KWINEFFECTS_LIBS
+# KDE4WORKSPACE_KDECORATIONS_LIBRARY, KDE4WORKSPACE_KDECORATIONS_LIBS
+# KDE4WORKSPACE_KSGRD_LIBRARY, KDE4WORKSPACE_KSGRD_LIBS
+# KDE4WORKSPACE_KEPHAL_LIBRARY, KDE4WORKSPACE_KEPHAL_LIBS
+#
+# And the following locations:
+# KDE4WORKSPACE_LIB_DIR
+# KDE4WORKSPACE_LIBEXEC_DIR
+# KDE4WORKSPACE_INCLUDE_DIR
+# KDE4WORKSPACE_BIN_DIR
+# KDE4WORKSPACE_SBIN_DIR
+# KDE4WORKSPACE_DATA_DIR
+# KDE4WORKSPACE_HTML_DIR
+# KDE4WORKSPACE_CONFIG_DIR
+# KDE4WORKSPACE_ICON_DIR
+# KDE4WORKSPACE_KCFG_DIR
+# KDE4WORKSPACE_LOCALE_DIR
+# KDE4WORKSPACE_MIME_DIR
+# KDE4WORKSPACE_SOUND_DIR
+# KDE4WORKSPACE_TEMPLATES_DIR
+# KDE4WORKSPACE_WALLPAPER_DIR
+# KDE4WORKSPACE_KCONF_UPDATE_DIR
+# KDE4WORKSPACE_AUTOSTART_DIR
+# KDE4WORKSPACE_XDG_APPS_DIR
+# KDE4WORKSPACE_XDG_DIRECTORY_DIR
+# KDE4WORKSPACE_SYSCONF_DIR
+# KDE4WORKSPACE_MAN_DIR
+# KDE4WORKSPACE_INFO_DIR
+# KDE4WORKSPACE_DBUS_INTERFACES_DIR
+# KDE4WORKSPACE_DBUS_SERVICES_DIR
+# KDE4WORKSPACE_SERVICES_DIR
+# KDE4WORKSPACE_SERVICETYPES_DIR
+
+# Copyright (c) 2008, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+# The find_package() call below loads the file KDE4WorkspaceConfig.cmake file.
+# This file is created and installed by kdebase/workspace/CMakeLists.txt
+# It contains settings for all install location of kdebase/workspace, as e.g.
+# KDE4WORKSPACE_INCLUDE_DIR, and also variables for all libraries.
+# See kdebase/workspace/CMakeLists.txt and kdebase/workspace/KDE4WorkspaceConfig.cmake.in
+# for details. Alex
+
+
+set(_KDE4Workspace_FIND_QUIETLY ${KDE4Workspace_FIND_QUIETLY})
+find_package(KDE4Workspace QUIET NO_MODULE PATHS ${KDE4_LIB_DIR}/KDE4Workspace/cmake )
+set(KDE4Workspace_FIND_QUIETLY ${_KDE4Workspace_FIND_QUIETLY})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(KDE4Workspace DEFAULT_MSG KDE4Workspace_CONFIG )
+
diff --git a/kdecore/cmake/modules/FindKDevPlatform.cmake b/kdecore/cmake/modules/FindKDevPlatform.cmake
new file mode 100644
index 0000000..a458a2d
--- /dev/null
+++ b/kdecore/cmake/modules/FindKDevPlatform.cmake
@@ -0,0 +1,45 @@
+#
+# Find the KDevelop Platform modules and sets various variables accordingly
+#
+# Example usage of this module:
+# find_package(KDevPlatform 1.0.0 REQUIRED)
+#
+# The version number and REQUIRED flag are optional. You can set CMAKE_PREFIX_PATH
+# variable to help it find the required files and directories
+
+# KDEVPLATFORM_FOUND - set to TRUE if the platform was found and the version is compatible FALSE otherwise
+#
+# KDEVPLATFORM_VERSION - The version number of kdevplatform
+# KDEVPLATFORM_VERSION_MAJOR - The major version number of kdevplatform
+# KDEVPLATFORM_VERSION_MINOR - The minor version number of kdevplatform
+# KDEVPLATFORM_VERSION_PATCH - The patch version number of kdevplatform
+# KDEVPLATFORM_INCLUDE_DIR - include dir of the platform, for example /usr/include/kdevplatform
+# KDEVPLATFORM_INTERFACES_LIBRARIES - interfaces module library
+# KDEVPLATFORM_LANGUAGE_LIBRARIES - language module library
+# KDEVPLATFORM_OUTPUTVIEW_LIBRARIES - outputview module library
+# KDEVPLATFORM_PROJECT_LIBRARIES - project module library
+# KDEVPLATFORM_SUBLIME_LIBRARIES - sublime module library
+# KDEVPLATFORM_SHELL_LIBRARIES - shell module library
+# KDEVPLATFORM_TESTS_LIBRARIES - library to write tests for plugins,
+# contains some useful tools and a way to replace parts of Core
+# classes with custom implementations
+# KDEVPLATFORM_UTIL_LIBRARIES - util module library
+# KDEVPLATFORM_VCS_LIBRARIES - vcs module library
+# KDEVPLATFORM_DEBUGGER_LIBRARIES - debugger module library
+#
+# The following macros are added (from KDevPlatformMacros.cmake):
+#
+# KDEVPLATFORM_ADD_APP_TEMPLATES( template1 ... templateN )
+# Use this to get packaged template archives for the given templates.
+# Parameters should be the directories containing the templates.
+#
+# Copyright 2007 Andreas Pakulat <apaku@gmx.de>
+# Redistribution and use is allowed according to the terms of the BSD license.
+
+set(_KDevPlatform_FIND_QUIETLY ${KDevPlatform_FIND_QUIETLY})
+find_package( KDevPlatform ${KDevPlatform_FIND_VERSION} NO_MODULE )
+set(KDevPlatform_FIND_QUIETLY ${_KDevPlatform_FIND_QUIETLY})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(KDevPlatform DEFAULT_MSG KDevPlatform_CONFIG )
+
diff --git a/kdecore/cmake/modules/FindKNepomuk.cmake b/kdecore/cmake/modules/FindKNepomuk.cmake
new file mode 100644
index 0000000..655f6fe
--- /dev/null
+++ b/kdecore/cmake/modules/FindKNepomuk.cmake
@@ -0,0 +1,39 @@
+# Once done this will define
+#
+# KNEPOMUK_FOUND - system has the Nepomuk-KDE backbone lib KNep
+# KNEPOMUK_INCLUDES - the libKNep include directory
+# KNEPOMUK_LIBRARIES - Link these to use libKNep
+#
+
+# Copyright (c) 2008, Sebastian Trueg, <sebastian@trueg.de>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if(KNEPOMUK_INCLUDES AND KNEPOMUK_LIBRARIES)
+ set(KNepomuk_FIND_QUIETLY TRUE)
+endif(KNEPOMUK_INCLUDES AND KNEPOMUK_LIBRARIES)
+
+FIND_PATH(KNEPOMUK_INCLUDES
+ NAMES
+ knepomuk/knepomuk.h
+ PATHS
+ ${KDE4_INCLUDE_DIR}
+ ${INCLUDE_INSTALL_DIR}
+)
+
+FIND_LIBRARY(KNEPOMUK_LIBRARIES
+ NAMES
+ knepomuk
+ PATHS
+ ${KDE4_LIB_DIR}
+ ${LIB_INSTALL_DIR}
+)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(KNepomuk DEFAULT_MSG KNEPOMUK_INCLUDES KNEPOMUK_LIBRARIES )
+
+
+MARK_AS_ADVANCED(KNEPOMUK_INCLUDES KNEPOMUK_LIBRARIES)
+
diff --git a/kdecore/cmake/modules/FindKdcraw.cmake b/kdecore/cmake/modules/FindKdcraw.cmake
new file mode 100644
index 0000000..518033d
--- /dev/null
+++ b/kdecore/cmake/modules/FindKdcraw.cmake
@@ -0,0 +1,124 @@
+# - Try to find the Kdcraw library
+#
+# If you have put a local version of libkdcraw into your source tree,
+# set KDCRAW_LOCAL_DIR to the relative path to the local directory.
+#
+# Once done this will define
+#
+# KDCRAW_FOUND - system has libkdcraw
+# KDCRAW_INCLUDE_DIR - the libkdcraw include directory
+# KDCRAW_LIBRARIES - Link these to use libkdcraw
+# KDCRAW_DEFINITIONS - Compiler switches required for using libkdcraw
+#
+
+# Copyright (c) 2008, Gilles Caulier, <caulier.gilles@gmail.com>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if (KDCRAW_INCLUDE_DIR AND KDCRAW_LIBRARIES AND KDCRAW_DEFINITIONS)
+
+ message(STATUS "Found Kdcraw library in cache: ${KDCRAW_LIBRARIES}")
+
+ # in cache already
+ set(KDCRAW_FOUND TRUE)
+
+else (KDCRAW_INCLUDE_DIR AND KDCRAW_LIBRARIES AND KDCRAW_DEFINITIONS)
+
+ message(STATUS "Check Kdcraw library in local sub-folder...")
+
+ # Check if library is not in local sub-folder
+
+ if (KDCRAW_LOCAL_DIR)
+ set (KDCRAW_LOCAL_FOUND TRUE)
+ else (KDCRAW_LOCAL_DIR)
+ find_file(KDCRAW_LOCAL_FOUND libkdcraw/kdcraw.h ${CMAKE_SOURCE_DIR}/libkdcraw ${CMAKE_SOURCE_DIR}/libs/libkdcraw NO_DEFAULT_PATH)
+
+ if (KDCRAW_LOCAL_FOUND)
+ # Was it found in libkdcraw/ or in libs/libkdcraw?
+ find_file(KDCRAW_LOCAL_FOUND_IN_LIBS libkdcraw/kdcraw.h ${CMAKE_SOURCE_DIR}/libs/libkdcraw NO_DEFAULT_PATH)
+ if (KDCRAW_LOCAL_FOUND_IN_LIBS)
+ set(KDCRAW_LOCAL_DIR libs/libkdcraw)
+ else (KDCRAW_LOCAL_FOUND_IN_LIBS)
+ set(KDCRAW_LOCAL_DIR libkdcraw)
+ endif (KDCRAW_LOCAL_FOUND_IN_LIBS)
+ endif (KDCRAW_LOCAL_FOUND)
+ endif (KDCRAW_LOCAL_DIR)
+
+ if (KDCRAW_LOCAL_FOUND)
+
+ # we need two include directories: because the version.h file is put into the build directory
+ # TODO KDCRAW_INCLUDE_DIR sounds like it should contain only one directory...
+ set(KDCRAW_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/${KDCRAW_LOCAL_DIR} ${CMAKE_BINARY_DIR}/${KDCRAW_LOCAL_DIR})
+ set(KDCRAW_DEFINITIONS "-I${CMAKE_SOURCE_DIR}/${KDCRAW_LOCAL_DIR}" "-I${CMAKE_BINARY_DIR}/${KDCRAW_LOCAL_DIR}")
+ set(KDCRAW_LIBRARIES kdcraw)
+ message(STATUS "Found Kdcraw library in local sub-folder: ${CMAKE_SOURCE_DIR}/${KDCRAW_LOCAL_DIR}")
+ set(KDCRAW_FOUND TRUE)
+ mark_as_advanced(KDCRAW_INCLUDE_DIR KDCRAW_LIBRARIES KDCRAW_DEFINITIONS)
+
+ else(KDCRAW_LOCAL_FOUND)
+
+ message(STATUS "Check Kdcraw library using pkg-config...")
+ if (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ include(UsePkgConfig)
+
+ PKGCONFIG(libkdcraw _KDCRAWIncDir _KDCRAWLinkDir _KDCRAWLinkFlags _KDCRAWCflags)
+
+ if (_KDCRAWLinkFlags)
+ # query pkg-config asking for a libkdcraw >= 0.2.0
+ exec_program(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.2.0 libkdcraw RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
+ if (_return_VALUE STREQUAL "0")
+ message(STATUS "Found libkdcraw release >= 0.2.0")
+ set(KDCRAW_VERSION_GOOD_FOUND TRUE)
+ else (_return_VALUE STREQUAL "0")
+ message(STATUS "Found libkdcaw release < 0.2.0, too old")
+ set(KDCRAW_VERSION_GOOD_FOUND FALSE)
+ set(KDCRAW_FOUND FALSE)
+ endif (_return_VALUE STREQUAL "0")
+ else (_KDCRAWLinkFlags)
+ set(KDCRAW_VERSION_GOOD_FOUND FALSE)
+ set(KDCRAW_FOUND FALSE)
+ endif (_KDCRAWLinkFlags)
+ else (NOT WIN32)
+ set(KDCRAW_VERSION_GOOD_FOUND TRUE)
+ endif (NOT WIN32)
+
+ if (KDCRAW_VERSION_GOOD_FOUND)
+ set(KDCRAW_DEFINITIONS "${_KDCRAWCflags}")
+
+ find_path(KDCRAW_INCLUDE_DIR libkdcraw/version.h
+ ${_KDCRAWIncDir}
+ )
+
+ find_library(KDCRAW_LIBRARIES NAMES kdcraw
+ PATHS
+ ${_KDCRAWLinkDir}
+ )
+
+ if (KDCRAW_INCLUDE_DIR AND KDCRAW_LIBRARIES)
+ set(KDCRAW_FOUND TRUE)
+ endif (KDCRAW_INCLUDE_DIR AND KDCRAW_LIBRARIES)
+ endif (KDCRAW_VERSION_GOOD_FOUND)
+ if (KDCRAW_FOUND)
+ if (NOT Kdcraw_FIND_QUIETLY)
+ message(STATUS "Found libkdcraw: ${KDCRAW_LIBRARIES}")
+ endif (NOT Kdcraw_FIND_QUIETLY)
+ else (KDCRAW_FOUND)
+ if (Kdcraw_FIND_REQUIRED)
+ if (NOT KDCRAW_INCLUDE_DIR)
+ message(FATAL_ERROR "Could NOT find libkdcraw header files")
+ endif (NOT KDCRAW_INCLUDE_DIR)
+ if (NOT KDCRAW_LIBRARIES)
+ message(FATAL_ERROR "Could NOT find libkdcraw library")
+ endif (NOT KDCRAW_LIBRARIES)
+ endif (Kdcraw_FIND_REQUIRED)
+ endif (KDCRAW_FOUND)
+
+ mark_as_advanced(KDCRAW_INCLUDE_DIR KDCRAW_LIBRARIES KDCRAW_DEFINITIONS)
+
+ endif(KDCRAW_LOCAL_FOUND)
+
+endif (KDCRAW_INCLUDE_DIR AND KDCRAW_LIBRARIES AND KDCRAW_DEFINITIONS)
diff --git a/kdecore/cmake/modules/FindKdeMultimedia.cmake b/kdecore/cmake/modules/FindKdeMultimedia.cmake
new file mode 100644
index 0000000..c885029
--- /dev/null
+++ b/kdecore/cmake/modules/FindKdeMultimedia.cmake
@@ -0,0 +1,48 @@
+# Module to see if we have KDE4 kdemultimedia installed
+#
+# This module defines
+# KDEMULTIMEDIA_INCLUDE_DIR - the include dir
+# KCDDB_LIBRARY - the kcddb library
+# KCOMPACTDISC_LIBRARY - the kcompactdisk library
+# KDEMULTIMEDIA_LIBRARIES - all of the KDE multimedia libraries together
+# KDEMULTIMEDIA_FOUND - true if the above have been found
+
+# KDEMULTIMEDIA_INCLUDE_DIR
+# KDEMULTIMEDIA_FOUND
+# Copyright (C) 2007 Laurent Montel <montel@kde.org>
+# Copyright (C) 2007 Gerd Fleischer <gerdfleischer@web.de>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if (KDEMULTIMEDIA_INCLUDE_DIR)
+ # Already in cache, be silent
+ set(KDEMULTIMEDIA_FOUND TRUE)
+endif (KDEMULTIMEDIA_INCLUDE_DIR)
+
+
+find_path(KDEMULTIMEDIA_INCLUDE_DIR NAMES libkcddb/kcddb.h libkcompactdisc/kcompactdisc.h
+ PATHS
+ ${INCLUDE_INSTALL_DIR}
+)
+
+find_library(KCDDB_LIBRARY NAMES kcddb
+ PATHS
+ ${LIB_INSTALL_DIR}
+)
+
+find_library(KCOMPACTDISC_LIBRARY NAMES kcompactdisc
+ PATHS
+ ${LIB_INSTALL_DIR}
+)
+
+# audioencoder, audiocdplugins?
+
+set(KDEMULTIMEDIA_LIBRARIES ${KCDDB_LIBRARY} ${KCOMPACTDISC_LIBRARY})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(KdeMultimedia DEFAULT_MSG KDEMULTIMEDIA_LIBRARIES KDEMULTIMEDIA_INCLUDE_DIR )
+
+mark_as_advanced(KDEMULTIMEDIA_INCLUDE_DIR KDEMULTIMEDIA_LIBRARIES)
+
diff --git a/kdecore/cmake/modules/FindKdepim.cmake b/kdecore/cmake/modules/FindKdepim.cmake
new file mode 100644
index 0000000..5757b0a
--- /dev/null
+++ b/kdecore/cmake/modules/FindKdepim.cmake
@@ -0,0 +1,3 @@
+# Nothing should require kdepim. We'll show a fatal error and an explanation.
+message(FATAL_ERROR "You must not use the FindKdepim CMake module. If you need more informations about this error, please contact us on the kde-pim mailing list.")
+
diff --git a/kdecore/cmake/modules/FindKdepimLibs.cmake b/kdecore/cmake/modules/FindKdepimLibs.cmake
new file mode 100644
index 0000000..6bca31c
--- /dev/null
+++ b/kdecore/cmake/modules/FindKdepimLibs.cmake
@@ -0,0 +1,84 @@
+# Find if we installed kdepimlibs before to compile it
+# Once done this will define
+#
+# KDEPIMLIBS_FOUND - system has KDE PIM Libraries
+# KDEPIMLIBS_INCLUDE_DIR - the KDE PIM Libraries include directory
+# KDEPIMLIBS_INCLUDE_DIRS - the KDE PIM Libraries include directory and CamelCase headers
+#
+# It also sets variables for the following libraries:
+# KDEPIMLIBS_AKONADI_LIBS
+# KDEPIMLIBS_AKONADI_CONTACT_LIBS
+# KDEPIMLIBS_AKONADI_KABC_LIBS
+# KDEPIMLIBS_AKONADI_KMIME_LIBS
+# KDEPIMLIBS_GPGMEPP_LIBS
+# KDEPIMLIBS_KABC_LIBS
+# KDEPIMLIBS_KALARMCAL_LIBS
+# KDEPIMLIBS_KBLOG_LIBS
+# KDEPIMLIBS_KCAL_LIBS
+# KDEPIMLIBS_KCALCORE_LIBS
+# KDEPIMLIBS_KCALUTILS_LIBS
+# KDEPIMLIBS_KHOLIDAYS_LIBS
+# KDEPIMLIBS_KIMAP_LIBS
+# KDEPIMLIBS_KLDAP_LIBS
+# KDEPIMLIBS_KMIME_LIBS
+# KDEPIMLIBS_KONTACTINTERFACE_LIBS
+# KDEPIMLIBS_KPIMIDENTITIES_LIBS
+# KDEPIMLIBS_KPIMTEXTEDIT_LIBS
+# KDEPIMLIBS_KPIMUTILS_LIBS
+# KDEPIMLIBS_KRESOURCES_LIBS
+# KDEPIMLIBS_KTNEF_LIBS
+# KDEPIMLIBS_KXMLRPCCLIENT_LIBS
+# KDEPIMLIBS_MAILTRANSPORT_LIBS
+# KDEPIMLIBS_MICROBLOG_LIBS
+# KDEPIMLIBS_QGPGME_LIBS
+# KDEPIMLIBS_SYNDICATION_LIBS
+#
+# And the following locations:
+# KDEPIMLIBS_DATA_DIR
+# KDEPIMLIBS_DBUS_INTERFACES_DIR
+# KDEPIMLIBS_DBUS_SERVICES_DIR
+# KDEPIMLIBS_INCLUDE_DIR
+# KDEPIMLIBS_INCLUDE_DIRS
+# KDEPIMLIBS_LIB_DIR
+# KDEPIMLIBS_BIN_DIR
+# KDEPIMLIBS_LIBEXEC_DIR
+# KDEPIMLIBS_SBIN_DIR
+# KDEPIMLIBS_HTML_DIR
+# KDEPIMLIBS_CONFIG_DIR
+# KDEPIMLIBS_ICON_DIR
+# KDEPIMLIBS_KCFG_DIR
+# KDEPIMLIBS_LOCALE_DIR
+# KDEPIMLIBS_MIME_DIR
+# KDEPIMLIBS_SOUND_DIR
+# KDEPIMLIBS_TEMPLATES_DIR
+# KDEPIMLIBS_KCONF_UPDATE_DIR
+# KDEPIMLIBS_AUTOSTART_DIR
+# KDEPIMLIBS_XDG_APPS_DIR
+# KDEPIMLIBS_XDG_DIRECTORY_DIR
+# KDEPIMLIBS_SYSCONF_DIR
+# KDEPIMLIBS_MAN_DIR
+# KDEPIMLIBS_INFO_DIR
+# KDEPIMLIBS_SERVICES_DIR
+# KDEPIMLIBS_SERVICETYPES_DIR
+
+
+# Copyright (c) 2008, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+# The find_package() call below loads the file KdepimLibsConfig.cmake file.
+# This file is created and installed by kdepimlibs/CMakeLists.txt
+# It contains settings for all install location of kdepimlibs, as e.g.
+# KDEPIMLIBS_INCLUDE_DIR, and also variables for all libraries.
+# See kdepimlibs/CMakeLists.txt and kdepimlibs/KdepimLibsConfig.cmake.in
+# for details. Alex
+
+
+set(_KdepimLibs_FIND_QUIETLY ${KdepimLibs_FIND_QUIETLY})
+find_package(KdepimLibs ${KdepimLibs_FIND_VERSION} QUIET NO_MODULE PATHS ${KDE4_LIB_DIR}/KdepimLibs/cmake )
+set(KdepimLibs_FIND_QUIETLY ${_KdepimLibs_FIND_QUIETLY})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(KdepimLibs DEFAULT_MSG KdepimLibs_CONFIG )
+
diff --git a/kdecore/cmake/modules/FindKexiv2.cmake b/kdecore/cmake/modules/FindKexiv2.cmake
new file mode 100644
index 0000000..4487537
--- /dev/null
+++ b/kdecore/cmake/modules/FindKexiv2.cmake
@@ -0,0 +1,123 @@
+# - Try to find the KExiv2 library
+#
+# If you have put a local version of libkexiv2 into your source tree,
+# set KEXIV2_LOCAL_DIR to the relative path to the local directory.
+#
+# Once done this will define
+#
+# KEXIV2_FOUND - system has libkexiv2
+# KEXIV2_INCLUDE_DIR - the libkexiv2 include directory
+# KEXIV2_LIBRARIES - Link these to use libkexiv2
+# KEXIV2_DEFINITIONS - Compiler switches required for using libkexiv2
+#
+
+# Copyright (c) 2008, Gilles Caulier, <caulier.gilles@gmail.com>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if (KEXIV2_INCLUDE_DIR AND KEXIV2_LIBRARIES AND KEXIV2_DEFINITIONS)
+
+ message(STATUS "Found Kexiv2 library in cache: ${KEXIV2_LIBRARIES}")
+
+ # in cache already
+ set(KEXIV2_FOUND TRUE)
+
+else (KEXIV2_INCLUDE_DIR AND KEXIV2_LIBRARIES AND KEXIV2_DEFINITIONS)
+
+ message(STATUS "Check Kexiv2 library in local sub-folder...")
+
+ # Check if library is not in local sub-folder
+
+ if (KEXIV2_LOCAL_DIR)
+ set(KEXIV2_LOCAL_FOUND TRUE)
+ else (KEXIV2_LOCAL_DIR)
+ find_file(KEXIV2_LOCAL_FOUND libkexiv2/version.h.cmake ${CMAKE_SOURCE_DIR}/libkexiv2 ${CMAKE_SOURCE_DIR}/libs/libkexiv2 NO_DEFAULT_PATH)
+
+ if (KEXIV2_LOCAL_FOUND)
+ # Was it found in libkexiv2/ or in libs/libkexiv2?
+ find_file(KEXIV2_LOCAL_FOUND_IN_LIBS libkexiv2/version.h.cmake ${CMAKE_SOURCE_DIR}/libs/libkexiv2 NO_DEFAULT_PATH)
+ if (KEXIV2_LOCAL_FOUND_IN_LIBS)
+ set(KEXIV2_LOCAL_DIR libs/libkexiv2)
+ else (KEXIV2_LOCAL_FOUND_IN_LIBS)
+ set(KEXIV2_LOCAL_DIR libkexiv2)
+ endif (KEXIV2_LOCAL_FOUND_IN_LIBS)
+ endif (KEXIV2_LOCAL_FOUND)
+
+ endif (KEXIV2_LOCAL_DIR)
+
+ if (KEXIV2_LOCAL_FOUND)
+ # we need two include directories: because the version.h file is put into the build directory
+ # TODO KEXIV2_INCLUDE_DIR sounds like it should contain only one directory...
+ set(KEXIV2_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/${KEXIV2_LOCAL_DIR} ${CMAKE_BINARY_DIR}/${KEXIV2_LOCAL_DIR})
+ set(KEXIV2_DEFINITIONS "-I${CMAKE_SOURCE_DIR}/${KEXIV2_LOCAL_DIR}" "-I${CMAKE_BINARY_DIR}/${KEXIV2_LOCAL_DIR}")
+ set(KEXIV2_LIBRARIES kexiv2)
+ message(STATUS "Found Kexiv2 library in local sub-folder: ${CMAKE_SOURCE_DIR}/${KEXIV2_LOCAL_DIR}")
+ set(KEXIV2_FOUND TRUE)
+ mark_as_advanced(KEXIV2_INCLUDE_DIR KEXIV2_LIBRARIES KEXIV2_DEFINITIONS)
+
+ else(KEXIV2_LOCAL_FOUND)
+ if(NOT WIN32)
+ message(STATUS "Check Kexiv2 library using pkg-config...")
+
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ include(UsePkgConfig)
+
+ PKGCONFIG(libkexiv2 _KEXIV2IncDir _KEXIV2LinkDir _KEXIV2LinkFlags _KEXIV2Cflags)
+
+ if(_KEXIV2LinkFlags)
+ # query pkg-config asking for a libkexiv2 >= 0.2.0
+ exec_program(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.2.0 libkexiv2 RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
+ if(_return_VALUE STREQUAL "0")
+ message(STATUS "Found libkexiv2 release >= 0.2.0")
+ set(KEXIV2_VERSION_GOOD_FOUND TRUE)
+ else(_return_VALUE STREQUAL "0")
+ message(STATUS "Found libkexiv2 release < 0.2.0, too old")
+ set(KEXIV2_VERSION_GOOD_FOUND FALSE)
+ set(KEXIV2_FOUND FALSE)
+ endif(_return_VALUE STREQUAL "0")
+ else(_KEXIV2LinkFlags)
+ set(KEXIV2_VERSION_GOOD_FOUND FALSE)
+ set(KEXIV2_FOUND FALSE)
+ endif(_KEXIV2LinkFlags)
+ else(NOT WIN32)
+ set(KEXIV2_VERSION_GOOD_FOUND TRUE)
+ endif(NOT WIN32)
+
+ if(KEXIV2_VERSION_GOOD_FOUND)
+ set(KEXIV2_DEFINITIONS "${_KEXIV2Cflags}")
+
+ find_path(KEXIV2_INCLUDE_DIR libkexiv2/version.h
+ ${_KEXIV2IncDir}
+ )
+
+ find_library(KEXIV2_LIBRARIES NAMES kexiv2
+ PATHS
+ ${_KEXIV2LinkDir}
+ )
+
+ if (KEXIV2_INCLUDE_DIR AND KEXIV2_LIBRARIES)
+ set(KEXIV2_FOUND TRUE)
+ endif (KEXIV2_INCLUDE_DIR AND KEXIV2_LIBRARIES)
+ endif(KEXIV2_VERSION_GOOD_FOUND)
+ if (KEXIV2_FOUND)
+ if (NOT Kexiv2_FIND_QUIETLY)
+ message(STATUS "Found libkexiv2: ${KEXIV2_LIBRARIES}")
+ endif (NOT Kexiv2_FIND_QUIETLY)
+ else (KEXIV2_FOUND)
+ if (Kexiv2_FIND_REQUIRED)
+ if (NOT KEXIV2_INCLUDE_DIR)
+ message(FATAL_ERROR "Could NOT find libkexiv2 header files")
+ endif (NOT KEXIV2_INCLUDE_DIR)
+ if (NOT KEXIV2_LIBRARIES)
+ message(FATAL_ERROR "Could NOT find libkexiv2 library")
+ endif (NOT KEXIV2_LIBRARIES)
+ endif (Kexiv2_FIND_REQUIRED)
+ endif (KEXIV2_FOUND)
+
+ mark_as_advanced(KEXIV2_INCLUDE_DIR KEXIV2_LIBRARIES KEXIV2_DEFINITIONS)
+
+ endif(KEXIV2_LOCAL_FOUND)
+
+endif (KEXIV2_INCLUDE_DIR AND KEXIV2_LIBRARIES AND KEXIV2_DEFINITIONS)
diff --git a/kdecore/cmake/modules/FindKipi.cmake b/kdecore/cmake/modules/FindKipi.cmake
new file mode 100644
index 0000000..13521e5
--- /dev/null
+++ b/kdecore/cmake/modules/FindKipi.cmake
@@ -0,0 +1,116 @@
+# - Try to find the Kipi library
+#
+# If you have put a local version of libkipi into your source tree,
+# set KIPI_LOCAL_DIR to the relative path to the local directory.
+#
+# Once done this will define
+#
+# KIPI_FOUND - system has libkipi
+# KIPI_INCLUDE_DIR - the libkipi include directory
+# KIPI_LIBRARIES - Link these to use libkipi
+# KIPI_DEFINITIONS - Compiler switches required for using libkipi
+#
+
+# Copyright (c) 2008, Gilles Caulier, <caulier.gilles@gmail.com>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if (KIPI_INCLUDE_DIR AND KIPI_LIBRARIES AND KIPI_DEFINITIONS)
+
+ message(STATUS "Found Kipi library in cache: ${KIPI_LIBRARIES}")
+
+ # in cache already
+ set(KIPI_FOUND TRUE)
+
+else (KIPI_INCLUDE_DIR AND KIPI_LIBRARIES AND KIPI_DEFINITIONS)
+
+ message(STATUS "Check Kipi library in local sub-folder...")
+
+ # Check if library is not in local sub-folder
+
+ if (KIPI_LOCAL_DIR)
+ set (KIPI_LOCAL_FOUND TRUE)
+ else (KIPI_LOCAL_DIR)
+ find_file(KIPI_LOCAL_FOUND libkipi/kipi.h ${CMAKE_SOURCE_DIR}/libkipi ${CMAKE_SOURCE_DIR}/libs/libkipi NO_DEFAULT_PATH)
+
+ if (KIPI_LOCAL_FOUND)
+ # Was it found in libkdcraw/ or in libs/libkdcraw?
+ find_file(KIPI_LOCAL_FOUND_IN_LIBS libkipi/kipi.h ${CMAKE_SOURCE_DIR}/libs/libkipi NO_DEFAULT_PATH)
+ if (KIPI_LOCAL_FOUND_IN_LIBS)
+ set(KIPI_LOCAL_DIR libs/libkipi)
+ else (KIPI_LOCAL_FOUND_IN_LIBS)
+ set(KIPI_LOCAL_DIR libkipi)
+ endif (KIPI_LOCAL_FOUND_IN_LIBS)
+ endif (KIPI_LOCAL_FOUND)
+ endif (KIPI_LOCAL_DIR)
+
+ if (KIPI_LOCAL_FOUND)
+ # we need two include directories: because the version.h file is put into the build directory
+ # TODO KIPI_INCLUDE_DIR sounds like it should contain only one directory...
+ set(KIPI_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/${KIPI_LOCAL_DIR} ${CMAKE_BINARY_DIR}/${KIPI_LOCAL_DIR})
+ set(KIPI_DEFINITIONS "-I${CMAKE_SOURCE_DIR}/${KIPI_LOCAL_DIR}" "-I${CMAKE_BINARY_DIR}/${KIPI_LOCAL_DIR}")
+ set(KIPI_LIBRARIES kipi)
+ message(STATUS "Found Kipi library in local sub-folder: ${CMAKE_SOURCE_DIR}/${KIPI_LOCAL_DIR}")
+ set(KIPI_FOUND TRUE)
+ mark_as_advanced(KIPI_INCLUDE_DIR KIPI_LIBRARIES KIPI_DEFINITIONS)
+
+ else (KIPI_LOCAL_FOUND)
+
+ if (NOT WIN32)
+ message(STATUS "Check Kipi library using pkg-config...")
+
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ include(UsePkgConfig)
+
+ PKGCONFIG(libkipi _KIPIIncDir _KIPILinkDir _KIPILinkFlags _KIPICflags)
+
+ if (_KIPILinkFlags)
+ # query pkg-config asking for a libkipi >= 0.2.0
+ exec_program(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.2.0 libkipi RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
+ if (_return_VALUE STREQUAL "0")
+ message(STATUS "Found libkipi release >= 0.2.0")
+ set(KIPI_VERSION_GOOD_FOUND TRUE)
+ else (_return_VALUE STREQUAL "0")
+ message(STATUS "Found libkipi release < 0.2.0, too old")
+ set(KIPI_VERSION_GOOD_FOUND FALSE)
+ set(KIPI_FOUND FALSE)
+ endif (_return_VALUE STREQUAL "0")
+ else (_KIPILinkFlags)
+ set(KIPI_VERSION_GOOD_FOUND FALSE)
+ set(KIPI_FOUND FALSE)
+ endif (_KIPILinkFlags)
+ else (NOT WIN32)
+ set(KIPI_VERSION_GOOD_FOUND TRUE)
+ endif (NOT WIN32)
+ if (KIPI_VERSION_GOOD_FOUND)
+ set(KIPI_DEFINITIONS ${_KIPICflags})
+
+ find_path(KIPI_INCLUDE_DIR NAMES libkipi/version.h PATHS ${KDE4_INCLUDE_DIR} ${_KIPIIncDir})
+ find_library(KIPI_LIBRARIES NAMES kipi PATHS ${KDE4_LIB_DIR} ${_KIPILinkDir})
+
+ if (KIPI_INCLUDE_DIR AND KIPI_LIBRARIES)
+ set(KIPI_FOUND TRUE)
+ endif (KIPI_INCLUDE_DIR AND KIPI_LIBRARIES)
+ endif (KIPI_VERSION_GOOD_FOUND)
+ if (KIPI_FOUND)
+ if (NOT Kipi_FIND_QUIETLY)
+ message(STATUS "Found libkipi: ${KIPI_LIBRARIES}")
+ endif (NOT Kipi_FIND_QUIETLY)
+ else (KIPI_FOUND)
+ if (Kipi_FIND_REQUIRED)
+ if (NOT KIPI_INCLUDE_DIR)
+ message(FATAL_ERROR "Could NOT find libkipi header files")
+ endif (NOT KIPI_INCLUDE_DIR)
+ if (NOT KIPI_LIBRARIES)
+ message(FATAL_ERROR "Could NOT find libkipi library")
+ endif (NOT KIPI_LIBRARIES)
+ endif (Kipi_FIND_REQUIRED)
+ endif (KIPI_FOUND)
+
+ mark_as_advanced(KIPI_INCLUDE_DIR KIPI_LIBRARIES KIPI_DEFINITIONS)
+
+ endif (KIPI_LOCAL_FOUND)
+
+endif (KIPI_INCLUDE_DIR AND KIPI_LIBRARIES AND KIPI_DEFINITIONS)
diff --git a/kdecore/cmake/modules/FindKonto.cmake b/kdecore/cmake/modules/FindKonto.cmake
new file mode 100644
index 0000000..d3c3458
--- /dev/null
+++ b/kdecore/cmake/modules/FindKonto.cmake
@@ -0,0 +1,38 @@
+# Once done this will define
+#
+# KONTO_FOUND - system has the Nepomuk-KDE backbone lib Konto
+# KONTO_INCLUDES - the libKonto include directory
+# KONTO_LIBRARIES - Link these to use libKonto
+#
+
+# Copyright (c) 2008, Sebastian Trueg, <sebastian@trueg.de>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if(KONTO_INCLUDES AND KONTO_LIBRARIES)
+ # Already in cache, be silent
+ set(Konto_FIND_QUIETLY TRUE)
+endif(KONTO_INCLUDES AND KONTO_LIBRARIES
+
+
+FIND_PATH(KONTO_INCLUDES
+ NAMES
+ konto/class.h
+ PATHS
+ ${KDE4_INCLUDE_DIR}
+ ${INCLUDE_INSTALL_DIR}
+)
+
+FIND_LIBRARY(KONTO_LIBRARIES
+ NAMES
+ konto
+ PATHS
+ ${KDE4_LIB_DIR}
+ ${LIB_INSTALL_DIR}
+)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Kondo DEFAULT_MSG KONTO_INCLUDES KONTO_LIBRARIES)
+
diff --git a/kdecore/cmake/modules/FindKopete.cmake b/kdecore/cmake/modules/FindKopete.cmake
new file mode 100644
index 0000000..cf65b5a
--- /dev/null
+++ b/kdecore/cmake/modules/FindKopete.cmake
@@ -0,0 +1,87 @@
+# - Try to find the Kopete library
+# Once done this will define
+#
+# Kopete_FOUND - system has kopete
+# KOPETE_INCLUDE_DIR - the kopete include directory
+# KOPETE_LIBRARIES - Link these to use kopete
+
+# Copyright (c) 2007 Charles Connell <charles@connells.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if(KOPETE_INCLUDE_DIR AND KOPETE_LIBRARIES)
+
+ # read from cache
+ set(Kopete_FOUND TRUE)
+
+else(KOPETE_INCLUDE_DIR AND KOPETE_LIBRARIES)
+
+ FIND_PATH(KOPETE_INCLUDE_DIR
+ NAMES
+ kopete/kopete_export.h
+ PATHS
+ ${KDE4_INCLUDE_DIR}
+ ${INCLUDE_INSTALL_DIR}
+ )
+
+ FIND_LIBRARY(KOPETE_LIBRARIES
+ NAMES
+ kopete
+ PATHS
+ ${KDE4_LIB_DIR}
+ ${LIB_INSTALL_DIR}
+ )
+ if(KOPETE_INCLUDE_DIR AND KOPETE_LIBRARIES)
+ set(Kopete_FOUND TRUE)
+ endif(KOPETE_INCLUDE_DIR AND KOPETE_LIBRARIES)
+
+ if(MSVC)
+ FIND_LIBRARY(KOPETE_LIBRARIES_DEBUG
+ NAMES
+ kopeted
+ PATHS
+ ${KDE4_LIB_DIR}
+ ${LIB_INSTALL_DIR}
+ )
+ if(NOT KOPETE_LIBRARIES_DEBUG)
+ set(Kopete_FOUND FALSE)
+ endif(NOT KOPETE_LIBRARIES_DEBUG)
+
+ if(MSVC_IDE)
+ if( NOT KOPETE_LIBRARIES_DEBUG OR NOT KOPETE_LIBRARIES)
+ message(FATAL_ERROR "\nCould NOT find the debug AND release version of the Kopete library.\nYou need to have both to use MSVC projects.\nPlease build and install both kopete libraries first.\n")
+ endif( NOT KOPETE_LIBRARIES_DEBUG OR NOT KOPETE_LIBRARIES)
+ else(MSVC_IDE)
+ string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
+ if(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
+ set(KOPETE_LIBRARIES ${KOPETE_LIBRARIES_DEBUG})
+ else(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
+ set(KOPETE_LIBRARIES ${KOPETE_LIBRARIES})
+ endif(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug)
+ endif(MSVC_IDE)
+ endif(MSVC)
+
+ if(Kopete_FOUND)
+ if(NOT Kopete_FIND_QUIETLY)
+ message(STATUS "Found Kopete: ${KOPETE_LIBRARIES}")
+ endif(NOT Kopete_FIND_QUIETLY)
+ else(Kopete_FOUND)
+ if(Kopete_FIND_REQUIRED)
+ if(NOT KOPETE_INCLUDE_DIR)
+ message(FATAL_ERROR "Could not find Kopete includes.")
+ endif(NOT KOPETE_INCLUDE_DIR)
+ if(NOT KOPETE_LIBRARIES)
+ message(FATAL_ERROR "Could not find Kopete library.")
+ endif(NOT KOPETE_LIBRARIES)
+ else(Kopete_FIND_REQUIRED)
+ if(NOT KOPETE_INCLUDE_DIR)
+ message(STATUS "Could not find Kopete includes.")
+ endif(NOT KOPETE_INCLUDE_DIR)
+ if(NOT KOPETE_LIBRARIES)
+ message(STATUS "Could not find Kopete library.")
+ endif(NOT KOPETE_LIBRARIES)
+ endif(Kopete_FIND_REQUIRED)
+ endif(Kopete_FOUND)
+
+endif(KOPETE_INCLUDE_DIR AND KOPETE_LIBRARIES)
diff --git a/kdecore/cmake/modules/FindKorundum.cmake b/kdecore/cmake/modules/FindKorundum.cmake
new file mode 100644
index 0000000..d921f61
--- /dev/null
+++ b/kdecore/cmake/modules/FindKorundum.cmake
@@ -0,0 +1,20 @@
+# - Find Korundum - the KDE Ruby bindings
+#
+# This module finds if Korundum is installed.
+# It defines the following variables:
+# KORUNDUM_PATH - the path to the korundum ruby file
+# KORUNDUM_FOUND - true if it has been found
+
+# Copyright (c) 2006, Egon Willighagen, <egonw@users.sf.net>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+find_path(KORUNDUM_PATH Korundum.rb /usr/lib/ruby/1.8)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Korundum DEFAULT_MSG KORUNDUM_PATH)
+
+# just for compat.:
+set(Korumdum_PATH ${KORUNDUM_PATH})
+set(Korumdum_FOUND ${KORUNDUM_FOUND})
diff --git a/kdecore/cmake/modules/FindLCMS.cmake b/kdecore/cmake/modules/FindLCMS.cmake
new file mode 100644
index 0000000..abc9ece
--- /dev/null
+++ b/kdecore/cmake/modules/FindLCMS.cmake
@@ -0,0 +1,60 @@
+# - Find LCMS
+# Find the LCMS (Little Color Management System) library and includes and
+# This module defines
+# LCMS_INCLUDE_DIR, where to find lcms.h
+# LCMS_LIBRARIES, the libraries needed to use LCMS.
+# LCMS_DOT_VERSION, The version number of the LCMS library, e.g. "1.19"
+# LCMS_VERSION, Similar to LCMS_DOT_VERSION, but without the dots, e.g. "119"
+# LCMS_FOUND, If false, do not try to use LCMS.
+#
+# The minimum required version of LCMS can be specified using the
+# standard syntax, e.g. find_package(LCMS 1.10)
+
+# Copyright (c) 2008, Adrian Page, <adrian@pagenet.plus.com>
+# Copyright (c) 2009, Cyrille Berger, <cberger@cberger.net>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+# use pkg-config to get the directories and then use these values
+# in the FIND_PATH() and FIND_LIBRARY() calls
+if(NOT WIN32)
+ find_package(PkgConfig)
+ pkg_check_modules(PC_LCMS lcms)
+ set(LCMS_DEFINITIONS ${PC_LCMS_CFLAGS_OTHER})
+endif(NOT WIN32)
+
+find_path(LCMS_INCLUDE_DIR lcms.h
+ HINTS
+ ${PC_LCMS_INCLUDEDIR}
+ ${PC_LCMS_INCLUDE_DIRS}
+ PATH_SUFFIXES lcms liblcms1
+)
+
+find_library(LCMS_LIBRARIES NAMES lcms liblcms lcms-1 liblcms-1
+ HINTS
+ ${PC_LCMS_LIBDIR}
+ ${PC_LCMS_LIBRARY_DIRS}
+ PATH_SUFFIXES lcms
+)
+
+# Store the LCMS version number in the cache, so we don't have to search everytime again
+if(LCMS_INCLUDE_DIR AND NOT LCMS_VERSION)
+ file(READ ${LCMS_INCLUDE_DIR}/lcms.h LCMS_VERSION_CONTENT)
+ string(REGEX MATCH "#define LCMS_VERSION[ ]*[0-9]*\n" LCMS_VERSION_MATCH ${LCMS_VERSION_CONTENT})
+ if(LCMS_VERSION_MATCH)
+ string(REGEX REPLACE "#define LCMS_VERSION[ ]*([0-9]*)\n" "\\1" _LCMS_VERSION ${LCMS_VERSION_MATCH})
+ string(SUBSTRING ${_LCMS_VERSION} 0 1 LCMS_MAJOR_VERSION)
+ string(SUBSTRING ${_LCMS_VERSION} 1 2 LCMS_MINOR_VERSION)
+ endif(LCMS_VERSION_MATCH)
+ set(LCMS_VERSION "${LCMS_MAJOR_VERSION}${LCMS_MINOR_VERSION}" CACHE STRING "Version number of lcms" FORCE)
+ set(LCMS_DOT_VERSION "${LCMS_MAJOR_VERSION}.${LCMS_MINOR_VERSION}" CACHE STRING "Version number of lcms split into components" FORCE)
+endif(LCMS_INCLUDE_DIR AND NOT LCMS_VERSION)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LCMS REQUIRED_VARS LCMS_LIBRARIES LCMS_INCLUDE_DIR
+ VERSION_VAR LCMS_DOT_VERSION )
+
+mark_as_advanced(LCMS_INCLUDE_DIR LCMS_LIBRARIES LCMS_VERSION)
+
diff --git a/kdecore/cmake/modules/FindLibArt.cmake b/kdecore/cmake/modules/FindLibArt.cmake
new file mode 100644
index 0000000..b14cd9d
--- /dev/null
+++ b/kdecore/cmake/modules/FindLibArt.cmake
@@ -0,0 +1,63 @@
+# - Try to find the LibArt 2D graphics library
+# Once done this will define
+#
+# LIBART_FOUND - system has the LibArt
+# LIBART_INCLUDE_DIR - the LibArt include directory
+# LIBART_LIBRARIES - The libraries needed to use LibArt
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if (LIBART_INCLUDE_DIR AND LIBART_LIBRARIES)
+
+ # in cache already
+ SET(LIBART_FOUND TRUE)
+
+else (LIBART_INCLUDE_DIR AND LIBART_LIBRARIES)
+
+ IF (NOT WIN32)
+ find_package(PkgConfig)
+
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ pkg_check_modules(PC_LIBART QUIET libart-2.0)
+
+ ######### ?? where is this used ?? ###############
+ set(LIBART_DEFINITIONS ${PC_LIBART_CFLAGS_OTHER})
+ ENDIF (NOT WIN32)
+
+ FIND_PATH(LIBART_INCLUDE_DIR NAMES libart_lgpl/libart.h
+ PATHS
+ ${PC_LIBART_INCLUDEDIR}
+ ${PC_LIBART_INCLUDE_DIRS}
+ PATH_SUFFIXES libart-2.0
+ )
+
+ FIND_LIBRARY(LIBART_LIBRARIES NAMES art_lgpl_2
+ PATHS
+ ${PC_LIBART_LIBDIR}
+ ${PC_LIBART_LIBRARY_DIRS}
+ )
+
+
+ if (LIBART_INCLUDE_DIR AND LIBART_LIBRARIES)
+ set(LIBART_FOUND TRUE)
+ endif (LIBART_INCLUDE_DIR AND LIBART_LIBRARIES)
+
+
+ if (LIBART_FOUND)
+ if (NOT LibArt_FIND_QUIETLY)
+ message(STATUS "Found libart: ${LIBART_LIBRARIES}")
+ endif (NOT LibArt_FIND_QUIETLY)
+ else (LIBART_FOUND)
+ if (LibArt_FIND_REQUIRED)
+ message(FATAL_ERROR "Could NOT find libart")
+ endif (LibArt_FIND_REQUIRED)
+ endif (LIBART_FOUND)
+
+ MARK_AS_ADVANCED(LIBART_INCLUDE_DIR LIBART_LIBRARIES)
+
+endif (LIBART_INCLUDE_DIR AND LIBART_LIBRARIES)
diff --git a/kdecore/cmake/modules/FindLibAttica.cmake b/kdecore/cmake/modules/FindLibAttica.cmake
new file mode 100644
index 0000000..bb919da
--- /dev/null
+++ b/kdecore/cmake/modules/FindLibAttica.cmake
@@ -0,0 +1,63 @@
+# Try to find the Attica library
+# Once done this will define
+#
+# LIBATTICA_FOUND Indicates that Attica was found
+# LIBATTICA_LIBRARIES Libraries needed to use Attica
+# LIBATTICA_LIBRARY_DIRS Paths needed for linking against Attica
+# LIBATTICA_INCLUDE_DIR Path needed for finding Attica include files
+#
+# The minimum required version of LibAttica can be specified using the
+# standard syntax, e.g. find_package(LibAttica 0.20)
+
+# Copyright (c) 2009 Frederik Gladhorn <gladhorn@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+
+# Support LIBATTICA_MIN_VERSION for compatibility:
+IF(NOT LibAttica_FIND_VERSION)
+ SET(LibAttica_FIND_VERSION "${LIBATTICA_MIN_VERSION}")
+ENDIF(NOT LibAttica_FIND_VERSION)
+
+# the minimum version of LibAttica we require
+IF(NOT LibAttica_FIND_VERSION)
+ SET(LibAttica_FIND_VERSION "0.1.0")
+ENDIF(NOT LibAttica_FIND_VERSION)
+
+
+IF (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ FIND_PACKAGE(PkgConfig)
+ PKG_CHECK_MODULES(PC_LIBATTICA QUIET libattica)
+ SET(LIBATTICA_DEFINITIONS ${PC_ATTICA_CFLAGS_OTHER})
+ENDIF (NOT WIN32)
+
+FIND_PATH(LIBATTICA_INCLUDE_DIR attica/provider.h
+ HINTS
+ ${PC_LIBATTICA_INCLUDEDIR}
+ ${PC_LIBATTICA_INCLUDE_DIRS}
+ PATH_SUFFIXES attica
+ )
+
+# Store the version number in the cache, so we don't have to search everytime:
+IF(LIBATTICA_INCLUDE_DIR AND NOT LIBATTICA_VERSION)
+ FILE(READ ${LIBATTICA_INCLUDE_DIR}/attica/version.h LIBATTICA_VERSION_CONTENT)
+ STRING (REGEX MATCH "LIBATTICA_VERSION_STRING \".*\"\n" LIBATTICA_VERSION_MATCH "${LIBATTICA_VERSION_CONTENT}")
+ IF(LIBATTICA_VERSION_MATCH)
+ STRING(REGEX REPLACE "LIBATTICA_VERSION_STRING \"(.*)\"\n" "\\1" _LIBATTICA_VERSION ${LIBATTICA_VERSION_MATCH})
+ ENDIF(LIBATTICA_VERSION_MATCH)
+ SET(LIBATTICA_VERSION "${_LIBATTICA_VERSION}" CACHE STRING "Version number of LibAttica" FORCE)
+ENDIF(LIBATTICA_INCLUDE_DIR AND NOT LIBATTICA_VERSION)
+
+
+FIND_LIBRARY(LIBATTICA_LIBRARIES NAMES attica libattica
+ HINTS
+ ${PC_LIBATTICA_LIBDIR}
+ ${PC_LIBATTICA_LIBRARY_DIRS}
+ )
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibAttica REQUIRED_VARS LIBATTICA_LIBRARIES LIBATTICA_INCLUDE_DIR
+ VERSION_VAR LIBATTICA_VERSION)
+
+MARK_AS_ADVANCED(LIBATTICA_INCLUDE_DIR LIBATTICA_LIBRARIES)
diff --git a/kdecore/cmake/modules/FindLibKonq.cmake b/kdecore/cmake/modules/FindLibKonq.cmake
new file mode 100644
index 0000000..eaf4c08
--- /dev/null
+++ b/kdecore/cmake/modules/FindLibKonq.cmake
@@ -0,0 +1,22 @@
+# - Try to find konqueror library
+# Once done this will define
+#
+# LIBKONQ_FOUND - system has libkonq library
+# LIBKONQ_INCLUDE_DIR - the LIBKONQ include directory
+# LIBKONQ_LIBRARY - the libkonq library
+
+# Original file: FindMarbleWidget.cmake (found in digikam-0.10.0-beta2)
+# copyright 2008 by Patrick Spendrin <ps_ml@gmx.de>
+# Copyright (c) 2009, Alexander Neundorf, <neundorf@kde.org>
+# use this file as you like
+#
+# Modifications to find libkonq by Joachim Eibl 2008
+
+find_path(LIBKONQ_INCLUDE_DIR konq_popupmenuplugin.h )
+
+find_library(LIBKONQ_LIBRARY konq)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LIBKONQ DEFAULT_MSG LIBKONQ_INCLUDE_DIR LIBKONQ_LIBRARY )
+
+mark_as_advanced(LIBKONQ_INCLUDE_DIR LIBKONQ_LIBRARY)
diff --git a/kdecore/cmake/modules/FindLibLZMA.cmake b/kdecore/cmake/modules/FindLibLZMA.cmake
new file mode 100644
index 0000000..1a341b2
--- /dev/null
+++ b/kdecore/cmake/modules/FindLibLZMA.cmake
@@ -0,0 +1,45 @@
+# - Find LibLZMA
+# Find LibLZMA headers and library
+#
+# LIBLZMA_FOUND - True if liblzma is found.
+# LIBLZMA_INCLUDE_DIRS - Directory where liblzma headers are located.
+# LIBLZMA_LIBRARIES - Lzma libraries to link against.
+# LIBLZMA_HAS_AUTO_DECODER - True if lzma_auto_decoder() is found (required).
+# LIBLZMA_HAS_EASY_ENCODER - True if lzma_easy_encoder() is found (required).
+# LIBLZMA_HAS_LZMA_PRESET - True if lzma_lzma_preset() is found (required).
+
+
+# Copyright (c) 2008, Per Øyvind Karlsen, <peroyvind@mandriva.org>
+# Copyright (c) 2009, Alexander Neundorf, <neundorf@kde.org>
+# Copyright (c) 2009, Helio Chissini de Castro, <helio@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+FIND_PATH(LIBLZMA_INCLUDE_DIR lzma.h )
+FIND_LIBRARY(LIBLZMA_LIBRARY lzma)
+
+SET(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY})
+SET(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR})
+
+
+# We're using new code known now as XZ, even library still been called LZMA
+# it can be found in http://tukaani.org/xz/
+# Avoid using old codebase
+IF (LIBLZMA_LIBRARIES)
+ INCLUDE(CheckLibraryExists)
+ CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARIES} lzma_auto_decoder "" LIBLZMA_HAS_AUTO_DECODER)
+ CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARIES} lzma_easy_encoder "" LIBLZMA_HAS_EASY_ENCODER)
+ CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARIES} lzma_lzma_preset "" LIBLZMA_HAS_LZMA_PRESET)
+ENDIF (LIBLZMA_LIBRARIES)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBLZMA DEFAULT_MSG LIBLZMA_INCLUDE_DIR
+ LIBLZMA_LIBRARY
+ LIBLZMA_HAS_AUTO_DECODER
+ LIBLZMA_HAS_EASY_ENCODER
+ LIBLZMA_HAS_LZMA_PRESET
+ )
+
+MARK_AS_ADVANCED( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY )
diff --git a/kdecore/cmake/modules/FindLibPython.py b/kdecore/cmake/modules/FindLibPython.py
new file mode 100644
index 0000000..ec21b33
--- /dev/null
+++ b/kdecore/cmake/modules/FindLibPython.py
@@ -0,0 +1,13 @@
+
+# Copyright (c) 2007, Simon Edwards <simon@simonzone.com>
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+import sys
+import distutils.sysconfig
+
+print("exec_prefix:%s" % sys.exec_prefix)
+print("short_version:%s" % sys.version[:3])
+print("long_version:%s" % sys.version.split()[0])
+print("py_inc_dir:%s" % distutils.sysconfig.get_python_inc())
+print("site_packages_dir:%s" % distutils.sysconfig.get_python_lib(plat_specific=1))
diff --git a/kdecore/cmake/modules/FindLibXml2.cmake b/kdecore/cmake/modules/FindLibXml2.cmake
new file mode 100644
index 0000000..8385804
--- /dev/null
+++ b/kdecore/cmake/modules/FindLibXml2.cmake
@@ -0,0 +1,58 @@
+# - Try to find LibXml2
+# Once done this will define
+#
+# LIBXML2_FOUND - System has LibXml2
+# LIBXML2_INCLUDE_DIR - The LibXml2 include directory
+# LIBXML2_LIBRARIES - The libraries needed to use LibXml2
+# LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2
+# LIBXML2_XMLLINT_EXECUTABLE - The XML checking tool xmllint coming with LibXml2
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+IF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
+ # in cache already
+ SET(LibXml2_FIND_QUIETLY TRUE)
+ENDIF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES)
+
+IF (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ FIND_PACKAGE(PkgConfig)
+ PKG_CHECK_MODULES(PC_LIBXML QUIET libxml-2.0)
+ SET(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER})
+ENDIF (NOT WIN32)
+
+FIND_PATH(LIBXML2_INCLUDE_DIR libxml/xpath.h
+ HINTS
+ ${PC_LIBXML_INCLUDEDIR}
+ ${PC_LIBXML_INCLUDE_DIRS}
+ PATH_SUFFIXES libxml2
+ )
+
+FIND_LIBRARY(LIBXML2_LIBRARIES NAMES xml2 libxml2
+ HINTS
+ ${PC_LIBXML_LIBDIR}
+ ${PC_LIBXML_LIBRARY_DIRS}
+ )
+
+FIND_PROGRAM(LIBXML2_XMLLINT_EXECUTABLE xmllint)
+# for backwards compat. with KDE 4.0.x:
+SET(XMLLINT_EXECUTABLE "${LIBXML2_XMLLINT_EXECUTABLE}")
+
+IF( NOT LIBXML2_XMLLINT_EXECUTABLE )
+ MESSAGE(STATUS "xmllint program not found. Install it if you want validate generated doc file.")
+ENDIF(NOT LIBXML2_XMLLINT_EXECUTABLE )
+
+
+INCLUDE(FindPackageHandleStandardArgs)
+
+# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
+# all listed variables are TRUE
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR)
+
+MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES LIBXML2_XMLLINT_EXECUTABLE)
+
diff --git a/kdecore/cmake/modules/FindLibXslt.cmake b/kdecore/cmake/modules/FindLibXslt.cmake
new file mode 100644
index 0000000..58d2e1d
--- /dev/null
+++ b/kdecore/cmake/modules/FindLibXslt.cmake
@@ -0,0 +1,72 @@
+# - Try to find LibXslt
+# Once done this will define
+#
+# LIBXSLT_FOUND - system has LibXslt
+# LIBXSLT_INCLUDE_DIR - the LibXslt include directory
+# LIBXSLT_LIBRARIES - Link these to LibXslt
+# LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt
+# LIBXSLT_XSLTPROC_EXECUTABLE - path to the xsltproc tool
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+IF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
+ # in cache already
+ SET(LibXslt_FIND_QUIETLY TRUE)
+ENDIF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
+
+IF (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ find_package(PkgConfig)
+ pkg_check_modules(PC_XSLT QUIET libxslt)
+ SET(LIBXSLT_DEFINITIONS ${PC_XSLT_CFLAGS_OTHER})
+ENDIF (NOT WIN32)
+
+FIND_PATH(LIBXSLT_INCLUDE_DIR libxslt/xslt.h
+ PATHS
+ ${PC_XSLT_INCLUDEDIR}
+ ${PC_XSLT_INCLUDE_DIRS}
+ )
+
+FIND_LIBRARY(LIBXSLT_LIBRARIES NAMES xslt libxslt
+ PATHS
+ ${PC_XSLT_LIBDIR}
+ ${PC_XSLT_LIBRARY_DIRS}
+ )
+
+FIND_LIBRARY(LIBEXSLT_LIBRARIES NAMES exslt libexslt
+ PATHS
+ ${PC_XSLT_LIBDIR}
+ ${PC_XSLT_LIBRARY_DIRS}
+ )
+
+IF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
+ SET(LIBXSLT_FOUND TRUE)
+ELSE (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
+ SET(LIBXSLT_FOUND FALSE)
+ENDIF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
+
+if(NOT WINCE)
+FIND_PROGRAM(LIBXSLT_XSLTPROC_EXECUTABLE xsltproc)
+else(NOT WINCE)
+FIND_PROGRAM(LIBXSLT_XSLTPROC_EXECUTABLE xsltproc PATHS ${HOST_BINDIR} NO_DEFAULT_PATH)
+endif(NOT WINCE)
+# For compatibility with FindLibXslt.cmake from KDE 4.[01].x
+SET(XSLTPROC_EXECUTABLE ${LIBXSLT_XSLTPROC_EXECUTABLE})
+
+IF (LIBXSLT_FOUND)
+ IF (NOT LibXslt_FIND_QUIETLY)
+ MESSAGE(STATUS "Found LibXslt: ${LIBXSLT_LIBRARIES}")
+ ENDIF (NOT LibXslt_FIND_QUIETLY)
+ELSE (LIBXSLT_FOUND)
+ IF (LibXslt_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could NOT find LibXslt")
+ ENDIF (LibXslt_FIND_REQUIRED)
+ENDIF (LIBXSLT_FOUND)
+
+MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR LIBXSLT_LIBRARIES LIBEXSLT_LIBRARIES LIBXSLT_XSLTPROC_EXECUTABLE)
+
diff --git a/kdecore/cmake/modules/FindLibintl.cmake b/kdecore/cmake/modules/FindLibintl.cmake
new file mode 100644
index 0000000..52ae647
--- /dev/null
+++ b/kdecore/cmake/modules/FindLibintl.cmake
@@ -0,0 +1,46 @@
+# Try to find Libintl functionality
+# Once done this will define
+#
+# LIBINTL_FOUND - system has Libintl
+# LIBINTL_INCLUDE_DIR - Libintl include directory
+# LIBINTL_LIBRARIES - Libraries needed to use Libintl
+#
+# TODO: This will enable translations only if Gettext functionality is
+# present in libc. Must have more robust system for release, where Gettext
+# functionality can also reside in standalone Gettext library, or the one
+# embedded within kdelibs (cf. gettext.m4 from Gettext source).
+
+# Copyright (c) 2006, Chusslove Illich, <caslav.ilic@gmx.net>
+# Copyright (c) 2007, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if(LIBINTL_INCLUDE_DIR AND LIBINTL_LIB_FOUND)
+ set(Libintl_FIND_QUIETLY TRUE)
+endif(LIBINTL_INCLUDE_DIR AND LIBINTL_LIB_FOUND)
+
+find_path(LIBINTL_INCLUDE_DIR libintl.h)
+
+set(LIBINTL_LIB_FOUND FALSE)
+
+if(LIBINTL_INCLUDE_DIR)
+ include(CheckFunctionExists)
+ check_function_exists(dgettext LIBINTL_LIBC_HAS_DGETTEXT)
+
+ if (LIBINTL_LIBC_HAS_DGETTEXT)
+ set(LIBINTL_LIBRARIES)
+ set(LIBINTL_LIB_FOUND TRUE)
+ else (LIBINTL_LIBC_HAS_DGETTEXT)
+ find_library(LIBINTL_LIBRARIES NAMES intl libintl )
+ if(LIBINTL_LIBRARIES)
+ set(LIBINTL_LIB_FOUND TRUE)
+ endif(LIBINTL_LIBRARIES)
+ endif (LIBINTL_LIBC_HAS_DGETTEXT)
+
+endif(LIBINTL_INCLUDE_DIR)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Libintl DEFAULT_MSG LIBINTL_INCLUDE_DIR LIBINTL_LIB_FOUND)
+
+mark_as_advanced(LIBINTL_INCLUDE_DIR LIBINTL_LIBRARIES LIBINTL_LIBC_HAS_DGETTEXT LIBINTL_LIB_FOUND)
diff --git a/kdecore/cmake/modules/FindLibraryWithDebug.cmake b/kdecore/cmake/modules/FindLibraryWithDebug.cmake
new file mode 100644
index 0000000..58cd730
--- /dev/null
+++ b/kdecore/cmake/modules/FindLibraryWithDebug.cmake
@@ -0,0 +1,113 @@
+#
+# FIND_LIBRARY_WITH_DEBUG
+# -> enhanced FIND_LIBRARY to allow the search for an
+# optional debug library with a WIN32_DEBUG_POSTFIX similar
+# to CMAKE_DEBUG_POSTFIX when creating a shared lib
+# it has to be the second and third argument
+
+# Copyright (c) 2007, Christian Ehrlicher, <ch.ehrlicher@gmx.de>
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+MACRO(FIND_LIBRARY_WITH_DEBUG var_name win32_dbg_postfix_name dgb_postfix libname)
+
+ IF(NOT "${win32_dbg_postfix_name}" STREQUAL "WIN32_DEBUG_POSTFIX")
+
+ # no WIN32_DEBUG_POSTFIX -> simply pass all arguments to FIND_LIBRARY
+ FIND_LIBRARY(${var_name}
+ ${win32_dbg_postfix_name}
+ ${dgb_postfix}
+ ${libname}
+ ${ARGN}
+ )
+
+ ELSE(NOT "${win32_dbg_postfix_name}" STREQUAL "WIN32_DEBUG_POSTFIX")
+
+ IF(NOT WIN32)
+ # on non-win32 we don't need to take care about WIN32_DEBUG_POSTFIX
+
+ FIND_LIBRARY(${var_name} ${libname} ${ARGN})
+
+ ELSE(NOT WIN32)
+
+ # 1. get all possible libnames
+ SET(args ${ARGN})
+ SET(newargs "")
+ SET(libnames_release "")
+ SET(libnames_debug "")
+
+ LIST(LENGTH args listCount)
+
+ IF("${libname}" STREQUAL "NAMES")
+ SET(append_rest 0)
+ LIST(APPEND args " ")
+
+ FOREACH(i RANGE ${listCount})
+ LIST(GET args ${i} val)
+
+ IF(append_rest)
+ LIST(APPEND newargs ${val})
+ ELSE(append_rest)
+ IF("${val}" STREQUAL "PATHS")
+ LIST(APPEND newargs ${val})
+ SET(append_rest 1)
+ ELSE("${val}" STREQUAL "PATHS")
+ LIST(APPEND libnames_release "${val}")
+ LIST(APPEND libnames_debug "${val}${dgb_postfix}")
+ ENDIF("${val}" STREQUAL "PATHS")
+ ENDIF(append_rest)
+
+ ENDFOREACH(i)
+
+ ELSE("${libname}" STREQUAL "NAMES")
+
+ # just one name
+ LIST(APPEND libnames_release "${libname}")
+ LIST(APPEND libnames_debug "${libname}${dgb_postfix}")
+
+ SET(newargs ${args})
+
+ ENDIF("${libname}" STREQUAL "NAMES")
+
+ # search the release lib
+ FIND_LIBRARY(${var_name}_RELEASE
+ NAMES ${libnames_release}
+ ${newargs}
+ )
+
+ # search the debug lib
+ FIND_LIBRARY(${var_name}_DEBUG
+ NAMES ${libnames_debug}
+ ${newargs}
+ )
+
+ IF(${var_name}_RELEASE AND ${var_name}_DEBUG)
+
+ # both libs found
+ SET(${var_name} optimized ${${var_name}_RELEASE}
+ debug ${${var_name}_DEBUG})
+
+ ELSE(${var_name}_RELEASE AND ${var_name}_DEBUG)
+
+ IF(${var_name}_RELEASE)
+
+ # only release found
+ SET(${var_name} ${${var_name}_RELEASE})
+
+ ELSE(${var_name}_RELEASE)
+
+ # only debug (or nothing) found
+ SET(${var_name} ${${var_name}_DEBUG})
+
+ ENDIF(${var_name}_RELEASE)
+
+ ENDIF(${var_name}_RELEASE AND ${var_name}_DEBUG)
+
+ MARK_AS_ADVANCED(${var_name}_RELEASE)
+ MARK_AS_ADVANCED(${var_name}_DEBUG)
+
+ ENDIF(NOT WIN32)
+
+ ENDIF(NOT "${win32_dbg_postfix_name}" STREQUAL "WIN32_DEBUG_POSTFIX")
+
+ENDMACRO(FIND_LIBRARY_WITH_DEBUG)
diff --git a/kdecore/cmake/modules/FindLinuxWirelesstools.cmake b/kdecore/cmake/modules/FindLinuxWirelesstools.cmake
new file mode 100644
index 0000000..794bba7
--- /dev/null
+++ b/kdecore/cmake/modules/FindLinuxWirelesstools.cmake
@@ -0,0 +1,29 @@
+# - Try to find wireless extensions support libraries
+# Once done this will define
+#
+# IW_FOUND - system has IW
+# IW_INCLUDE_DIR - the IW include directory
+# IW_LIBRARIES - Link to these to use IW
+
+# Copyright (c) 2006, Thorsten Roeder, <thorsten.roeder@weihenstephan.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+IF (IW_INCLUDE_DIR)
+ # Already in cache, be silent
+ SET(LinuxWirelesstools_FIND_QUIETLY TRUE)
+ENDIF (IW_INCLUDE_DIR)
+
+FIND_PATH(IW_INCLUDE_DIR iwlib.h)
+
+FIND_LIBRARY(IW_LIBRARIES NAMES iw)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(IW "Could not find Linux Wirelesstools (libIW)" IW_INCLUDE_DIR IW_LIBRARIES )
+
+
+# show the IW_INCLUDE_DIR and IW_LIBRARIES variables only in the advanced view
+MARK_AS_ADVANCED(IW_INCLUDE_DIR IW_LIBRARIES )
+
diff --git a/kdecore/cmake/modules/FindMsgfmt.cmake b/kdecore/cmake/modules/FindMsgfmt.cmake
new file mode 100644
index 0000000..47c6121
--- /dev/null
+++ b/kdecore/cmake/modules/FindMsgfmt.cmake
@@ -0,0 +1,28 @@
+# - Try to find msgfmt
+# Once done this will define
+#
+# MSGFMT_FOUND - system has msgfmt
+
+# Copyright (c) 2007, Montel Laurent <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+### TODO: KDE4 needs msgfmt of version 0.15 or greater (cf. msgfmt --version )
+
+if(MSGFMT_EXECUTABLE)
+ set(MSGFMT_FOUND TRUE)
+else(MSGFMT_EXECUTABLE)
+
+ FIND_PROGRAM(MSGFMT_EXECUTABLE NAMES msgfmt)
+ if (MSGFMT_EXECUTABLE)
+ set(MSGFMT_FOUND TRUE)
+ else (MSGFMT_EXECUTABLE)
+ if (Msgfmt_FIND_REQUIRED)
+ message(SEND_ERROR "Could NOT find msgfmt program")
+ endif (Msgfmt_FIND_REQUIRED)
+ endif (MSGFMT_EXECUTABLE)
+ MARK_AS_ADVANCED(MSGFMT_EXECUTABLE)
+
+endif (MSGFMT_EXECUTABLE)
+
diff --git a/kdecore/cmake/modules/FindMusicBrainz.cmake b/kdecore/cmake/modules/FindMusicBrainz.cmake
new file mode 100644
index 0000000..c93b2dc
--- /dev/null
+++ b/kdecore/cmake/modules/FindMusicBrainz.cmake
@@ -0,0 +1,32 @@
+# Module to find the musicbrainz library
+#
+# It defines
+# MUSICBRAINZ_INCLUDE_DIR - the include dir
+# MUSICBRAINZ_LIBRARIES - the required libraries
+# MUSICBRAINZ_FOUND - true if both of the above have been found
+
+# Copyright (c) 2006,2007 Laurent Montel, <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if(MUSICBRAINZ_INCLUDE_DIR AND MUSICBRAINZ_LIBRARIES)
+ set(MUSICBRAINZ_FIND_QUIETLY TRUE)
+endif(MUSICBRAINZ_INCLUDE_DIR AND MUSICBRAINZ_LIBRARIES)
+
+FIND_PATH(MUSICBRAINZ_INCLUDE_DIR musicbrainz/musicbrainz.h)
+
+FIND_LIBRARY( MUSICBRAINZ_LIBRARIES NAMES musicbrainz)
+
+# We need version 2, version 3 is source-incompatible
+FIND_PATH(MUSICBRAINZ3_INCLUDE_DIR musicbrainz3/musicbrainz.h)
+if(MUSICBRAINZ3_INCLUDE_DIR AND NOT MUSICBRAINZ_INCLUDE_DIR)
+ message(STATUS "\nIncompatible version 3.x of the musicbrainz includes detected. Version 2.x is needed.\n")
+endif(MUSICBRAINZ3_INCLUDE_DIR AND NOT MUSICBRAINZ_INCLUDE_DIR)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args( MusicBrainz DEFAULT_MSG
+ MUSICBRAINZ_INCLUDE_DIR MUSICBRAINZ_LIBRARIES)
+
+MARK_AS_ADVANCED(MUSICBRAINZ_INCLUDE_DIR MUSICBRAINZ_LIBRARIES)
+
diff --git a/kdecore/cmake/modules/FindMySQL.cmake b/kdecore/cmake/modules/FindMySQL.cmake
new file mode 100644
index 0000000..3912866
--- /dev/null
+++ b/kdecore/cmake/modules/FindMySQL.cmake
@@ -0,0 +1,140 @@
+# - Try to find MySQL / MySQL Embedded library
+# Find the MySQL includes and client library
+# This module defines
+# MYSQL_INCLUDE_DIR, where to find mysql.h
+# MYSQL_LIBRARIES, the libraries needed to use MySQL.
+# MYSQL_LIB_DIR, path to the MYSQL_LIBRARIES
+# MYSQL_EMBEDDED_LIBRARIES, the libraries needed to use MySQL Embedded.
+# MYSQL_EMBEDDED_LIB_DIR, path to the MYSQL_EMBEDDED_LIBRARIES
+# MYSQL_FOUND, If false, do not try to use MySQL.
+# MYSQL_EMBEDDED_FOUND, If false, do not try to use MySQL Embedded.
+
+# Copyright (c) 2006-2008, Jarosław Staniek <staniek@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+include(CheckCXXSourceCompiles)
+include(MacroPushRequiredVars)
+
+if(WIN32)
+ find_path(MYSQL_INCLUDE_DIR mysql.h
+ PATHS
+ $ENV{MYSQL_INCLUDE_DIR}
+ $ENV{MYSQL_DIR}/include
+ $ENV{ProgramFiles}/MySQL/*/include
+ $ENV{SystemDrive}/MySQL/*/include
+ )
+else(WIN32)
+ find_path(MYSQL_INCLUDE_DIR mysql.h
+ PATHS
+ $ENV{MYSQL_INCLUDE_DIR}
+ $ENV{MYSQL_DIR}/include
+ /usr/local/mysql/include
+ /opt/mysql/mysql/include
+ PATH_SUFFIXES
+ mysql
+ )
+endif(WIN32)
+
+if(WIN32)
+ string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
+
+ # path suffix for debug/release mode
+ # binary_dist: mysql binary distribution
+ # build_dist: custom build
+ if(CMAKE_BUILD_TYPE_TOLOWER MATCHES "debug")
+ set(binary_dist debug)
+ set(build_dist Debug)
+ else(CMAKE_BUILD_TYPE_TOLOWER MATCHES "debug")
+ ADD_DEFINITIONS(-DDBUG_OFF)
+ set(binary_dist opt)
+ set(build_dist Release)
+ endif(CMAKE_BUILD_TYPE_TOLOWER MATCHES "debug")
+
+# find_library(MYSQL_LIBRARIES NAMES mysqlclient
+ find_library(MYSQL_LIBRARIES NAMES libmysql
+ PATHS
+ $ENV{MYSQL_DIR}/lib/${binary_dist}
+ $ENV{MYSQL_DIR}/libmysql/${build_dist}
+ $ENV{MYSQL_DIR}/client/${build_dist}
+ $ENV{ProgramFiles}/MySQL/*/lib/${binary_dist}
+ $ENV{SystemDrive}/MySQL/*/lib/${binary_dist}
+ )
+else(WIN32)
+# find_library(MYSQL_LIBRARIES NAMES mysqlclient
+ find_library(MYSQL_LIBRARIES NAMES libmysql
+ PATHS
+ $ENV{MYSQL_DIR}/libmysql_r/.libs
+ $ENV{MYSQL_DIR}/lib
+ $ENV{MYSQL_DIR}/lib/mysql
+ /usr/local/mysql/lib
+ /opt/mysql/mysql/lib
+ PATH_SUFFIXES
+ mysql
+ )
+endif(WIN32)
+
+if(WIN32)
+ set(MYSQL_LIB_PATHS
+ $ENV{MYSQL_DIR}/lib/opt
+ $ENV{MYSQL_DIR}/client/release
+ $ENV{ProgramFiles}/MySQL/*/lib/opt
+ $ENV{SystemDrive}/MySQL/*/lib/opt
+ )
+ find_library(MYSQL_LIBRARIES NAMES mysqlclient
+ PATHS
+ ${MYSQL_LIB_PATHS}
+ )
+else(WIN32)
+ set(MYSQL_LIB_PATHS
+ $ENV{MYSQL_DIR}/libmysql_r/.libs
+ $ENV{MYSQL_DIR}/lib
+ $ENV{MYSQL_DIR}/lib/mysql
+ /usr/local/mysql/lib
+ /opt/mysql/mysql/lib
+ PATH_SUFFIXES
+ mysql
+ )
+ find_library(MYSQL_LIBRARIES NAMES mysqlclient
+ PATHS
+ ${MYSQL_LIB_PATHS}
+ )
+endif(WIN32)
+
+find_library(MYSQL_EMBEDDED_LIBRARIES NAMES mysqld
+ PATHS
+ ${MYSQL_LIB_PATHS}
+)
+
+if(MYSQL_LIBRARIES)
+ get_filename_component(MYSQL_LIB_DIR ${MYSQL_LIBRARIES} PATH)
+endif(MYSQL_LIBRARIES)
+
+if(MYSQL_EMBEDDED_LIBRARIES)
+ get_filename_component(MYSQL_EMBEDDED_LIB_DIR ${MYSQL_EMBEDDED_LIBRARIES} PATH)
+endif(MYSQL_EMBEDDED_LIBRARIES)
+
+macro_push_required_vars()
+set( CMAKE_REQUIRED_INCLUDES ${MYSQL_INCLUDE_DIR} )
+set( CMAKE_REQUIRED_LIBRARIES ${MYSQL_EMBEDDED_LIBRARIES} )
+check_cxx_source_compiles( "#include <mysql.h>\nint main() { int i = MYSQL_OPT_USE_EMBEDDED_CONNECTION; }" HAVE_MYSQL_OPT_EMBEDDED_CONNECTION )
+macro_pop_required_vars()
+
+if(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
+ set(MYSQL_FOUND TRUE)
+ message(STATUS "Found MySQL: ${MYSQL_INCLUDE_DIR}, ${MYSQL_LIBRARIES}")
+else(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
+ set(MYSQL_FOUND FALSE)
+ message(STATUS "MySQL not found.")
+endif(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
+
+if(MYSQL_INCLUDE_DIR AND MYSQL_EMBEDDED_LIBRARIES AND HAVE_MYSQL_OPT_EMBEDDED_CONNECTION)
+ set(MYSQL_EMBEDDED_FOUND TRUE)
+ message(STATUS "Found MySQL Embedded: ${MYSQL_INCLUDE_DIR}, ${MYSQL_EMBEDDED_LIBRARIES}")
+else(MYSQL_INCLUDE_DIR AND MYSQL_EMBEDDED_LIBRARIES AND HAVE_MYSQL_OPT_EMBEDDED_CONNECTION)
+ set(MYSQL_EMBEDDED_FOUND FALSE)
+ message(STATUS "MySQL Embedded not found.")
+endif(MYSQL_INCLUDE_DIR AND MYSQL_EMBEDDED_LIBRARIES AND HAVE_MYSQL_OPT_EMBEDDED_CONNECTION)
+
+mark_as_advanced(MYSQL_INCLUDE_DIR MYSQL_LIBRARIES MYSQL_EMBEDDED_LIBRARIES)
diff --git a/kdecore/cmake/modules/FindNepomuk.cmake b/kdecore/cmake/modules/FindNepomuk.cmake
new file mode 100644
index 0000000..b822aee
--- /dev/null
+++ b/kdecore/cmake/modules/FindNepomuk.cmake
@@ -0,0 +1,96 @@
+# Once done this will define
+#
+# NEPOMUK_FOUND - system has Nepomuk
+# NEPOMUK_INCLUDE_DIRS - all include directories needed to compile Nepomuk
+# NEPOMUK_INCLUDE_DIR - the Nepomuk include directory (do not use. only for compatibility)
+# NEPOMUK_LIBRARIES - Link these to use Nepomuk
+# NEPOMUK_QUERY_LIBRARIES - Link these to use Nepomuk query
+# NEPOMUK_UTILS_LIBRARIES - Link these to use Nepomuk utils
+# NEPOMUK_DEFINITIONS - Compiler switches required for using Nepomuk
+#
+# Nepomuk requires Soprano, so this module checks for Soprano too.
+#
+
+
+# Copyright (c) 2008-2009, Sebastian Trueg, <sebastian@trueg.de>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if (NOT DEFINED Soprano_FOUND)
+ find_package(Soprano ${SOPRANO_MIN_VERSION})
+endif (NOT DEFINED Soprano_FOUND)
+
+if (NOT DEFINED SHAREDDESKTOPONTOLOGIES_FOUND)
+ find_package(SharedDesktopOntologies)
+endif (NOT DEFINED SHAREDDESKTOPONTOLOGIES_FOUND)
+
+# Check for the following stuff independent from whether soprano has been found
+# or not. This will give a better error message at the end.
+find_path(NEPOMUK_INCLUDE_DIR
+ NAMES
+ nepomuk/resource.h
+ HINTS
+ ${KDE4_INCLUDE_DIR}
+ ${INCLUDE_INSTALL_DIR}
+ )
+
+set(NEPOMUK_INCLUDE_DIRS ${NEPOMUK_INCLUDE_DIR} ${SOPRANO_INCLUDE_DIR})
+
+find_library(NEPOMUK_LIBRARIES
+ NAMES
+ nepomuk
+ HINTS
+ ${KDE4_LIB_DIR}
+ ${LIB_INSTALL_DIR}
+ )
+
+set(NEPOMUK_LIBRARIES ${NEPOMUK_LIBRARIES} ${SOPRANO_LIBRARIES})
+
+find_library(NEPOMUK_QUERY_LIBRARIES
+ NAMES
+ nepomukquery
+ HINTS
+ ${KDE4_LIB_DIR}
+ ${LIB_INSTALL_DIR}
+ )
+
+find_library(NEPOMUK_UTILS_LIBRARIES
+ NAMES
+ nepomukutils
+ HINTS
+ ${KDE4_LIB_DIR}
+ ${LIB_INSTALL_DIR}
+)
+
+find_file(NEPOMUK_ADDONTOLOGYCLASSES_FILE NepomukAddOntologyClasses.cmake
+ HINTS ${KDE4_DATA_INSTALL_DIR}/cmake/modules/
+ PATH_SUFFIXES share/apps/cmake/modules/
+ )
+
+include("${NEPOMUK_ADDONTOLOGYCLASSES_FILE}" OPTIONAL)
+
+mark_as_advanced(NEPOMUK_INCLUDE_DIR NEPOMUK_INCLUDE_DIRS NEPOMUK_LIBRARIES NEPOMUK_QUERY_LIBRARIES NEPOMUK_UTILS_LIBRARIES NEPOMUK_ADDONTOLOGIES_FILE)
+
+include(FindPackageHandleStandardArgs)
+# List all nepomuk and also all necessary soprano variables here, to make it
+# easier for the user to see what was missing:
+if(NOT WINCE)
+find_package_handle_standard_args(Nepomuk DEFAULT_MSG
+ NEPOMUK_LIBRARIES NEPOMUK_INCLUDE_DIR NEPOMUK_ADDONTOLOGYCLASSES_FILE
+ Soprano_FOUND
+ SHAREDDESKTOPONTOLOGIES_FOUND
+ )
+else(NOT WINCE)
+#FIXME: There are no backends at this time
+find_package_handle_standard_args(Nepomuk DEFAULT_MSG
+ NEPOMUK_LIBRARIES NEPOMUK_INCLUDE_DIR NEPOMUK_ADDONTOLOGYCLASSES_FILE
+ Soprano_FOUND
+ SHAREDDESKTOPONTOLOGIES_FOUND
+ )
+endif(NOT WINCE)
+
+#to retain backward compatibility
+set (Nepomuk_FOUND ${NEPOMUK_FOUND})
+
diff --git a/kdecore/cmake/modules/FindNetworkManager.cmake b/kdecore/cmake/modules/FindNetworkManager.cmake
new file mode 100644
index 0000000..ced2017
--- /dev/null
+++ b/kdecore/cmake/modules/FindNetworkManager.cmake
@@ -0,0 +1,42 @@
+# - Try to find NetworkManager
+# Once done this will define
+#
+# NETWORKMANAGER_FOUND - system has NetworkManager
+# NETWORKMANAGER_INCLUDE_DIRS - the NetworkManager include directories
+# NETWORKMANAGER_LIBRARIES - the libraries needed to use NetworkManager
+# NETWORKMANAGER_CFLAGS - Compiler switches required for using NetworkManager
+# NETWORKMANAGER_VERSION - version number of NetworkManager
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+# Copyright (c) 2007, Will Stephenson, <wstephenson@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+IF (NETWORKMANAGER_INCLUDE_DIRS AND NM-UTIL_INCLUDE_DIRS)
+ # in cache already
+ SET(NetworkManager_FIND_QUIETLY TRUE)
+ENDIF (NETWORKMANAGER_INCLUDE_DIRS AND NM-UTIL_INCLUDE_DIRS)
+
+IF (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ find_package(PkgConfig)
+ PKG_SEARCH_MODULE( NETWORKMANAGER NetworkManager )
+ PKG_SEARCH_MODULE( NM-UTIL libnm-util )
+ENDIF (NOT WIN32)
+
+IF (NETWORKMANAGER_FOUND AND NM-UTIL_FOUND)
+ IF (NOT NetworkManager_FIND_QUIETLY)
+ MESSAGE(STATUS "Found NetworkManager ${NETWORKMANAGER_VERSION}: ${NETWORKMANAGER_LIBRARY_DIRS}")
+ MESSAGE(STATUS "Found libnm-util: ${NM-UTIL_LIBRARY_DIRS}")
+ ENDIF (NOT NetworkManager_FIND_QUIETLY)
+ELSE (NETWORKMANAGER_FOUND AND NM-UTIL_FOUND)
+ IF (NetworkManager_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could NOT find NetworkManager or libnm-util, check FindPkgConfig output above!")
+ ENDIF (NetworkManager_FIND_REQUIRED)
+ENDIF (NETWORKMANAGER_FOUND AND NM-UTIL_FOUND)
+
+MARK_AS_ADVANCED(NETWORKMANAGER_INCLUDE_DIRS NM-UTIL_INCLUDE_DIRS)
+
diff --git a/kdecore/cmake/modules/FindOggVorbis.cmake b/kdecore/cmake/modules/FindOggVorbis.cmake
new file mode 100644
index 0000000..28575d3
--- /dev/null
+++ b/kdecore/cmake/modules/FindOggVorbis.cmake
@@ -0,0 +1,76 @@
+# - Try to find the OggVorbis libraries
+# Once done this will define
+#
+# OGGVORBIS_FOUND - system has OggVorbis
+# OGGVORBIS_VERSION - set either to 1 or 2
+# OGGVORBIS_INCLUDE_DIR - the OggVorbis include directory
+# OGGVORBIS_LIBRARIES - The libraries needed to use OggVorbis
+# OGG_LIBRARY - The Ogg library
+# VORBIS_LIBRARY - The Vorbis library
+# VORBISFILE_LIBRARY - The VorbisFile library
+# VORBISENC_LIBRARY - The VorbisEnc library
+
+# Copyright (c) 2006, Richard Laerkaeng, <richard@goteborg.utfors.se>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+include (CheckLibraryExists)
+
+find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h)
+find_path(OGG_INCLUDE_DIR ogg/ogg.h)
+
+find_library(OGG_LIBRARY NAMES ogg)
+find_library(VORBIS_LIBRARY NAMES vorbis)
+find_library(VORBISFILE_LIBRARY NAMES vorbisfile)
+find_library(VORBISENC_LIBRARY NAMES vorbisenc)
+
+mark_as_advanced(VORBIS_INCLUDE_DIR OGG_INCLUDE_DIR
+ OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY VORBISENC_LIBRARY)
+
+
+if (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
+
+ set(OGGVORBIS_LIBRARIES ${OGG_LIBRARY} ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBISENC_LIBRARY})
+
+ set(_CMAKE_REQUIRED_LIBRARIES_TMP ${CMAKE_REQUIRED_LIBRARIES})
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${OGGVORBIS_LIBRARIES})
+ check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2)
+ set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_TMP})
+
+ if (HAVE_LIBVORBISENC2)
+ set (OGGVORBIS_VERSION 2)
+ else (HAVE_LIBVORBISENC2)
+ set (OGGVORBIS_VERSION 1)
+ endif (HAVE_LIBVORBISENC2)
+
+endif (VORBIS_INCLUDE_DIR AND VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBISENC_LIBRARY)
+
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(OggVorbis REQUIRED_VARS VORBIS_LIBRARY OGG_LIBRARY VORBISFILE_LIBRARY VORBISENC_LIBRARY
+ VORBIS_INCLUDE_DIR OGG_INCLUDE_DIR)
+
+#check_include_files(vorbis/vorbisfile.h HAVE_VORBISFILE_H)
+#check_library_exists(ogg ogg_page_version "" HAVE_LIBOGG)
+#check_library_exists(vorbis vorbis_info_init "" HAVE_LIBVORBIS)
+#check_library_exists(vorbisfile ov_open "" HAVE_LIBVORBISFILE)
+#check_library_exists(vorbisenc vorbis_info_clear "" HAVE_LIBVORBISENC)
+#check_library_exists(vorbis vorbis_bitrate_addblock "" HAVE_LIBVORBISENC2)
+
+#if (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
+# message(STATUS "Ogg/Vorbis found")
+# set (VORBIS_LIBS "-lvorbis -logg")
+# set (VORBISFILE_LIBS "-lvorbisfile")
+# set (VORBISENC_LIBS "-lvorbisenc")
+# set (OGGVORBIS_FOUND TRUE)
+# if (HAVE_LIBVORBISENC2)
+# set (HAVE_VORBIS 2)
+# else (HAVE_LIBVORBISENC2)
+# set (HAVE_VORBIS 1)
+# endif (HAVE_LIBVORBISENC2)
+#else (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
+# message(STATUS "Ogg/Vorbis not found")
+#endif (HAVE_LIBOGG AND HAVE_VORBISFILE_H AND HAVE_LIBVORBIS AND HAVE_LIBVORBISFILE AND HAVE_LIBVORBISENC)
+
diff --git a/kdecore/cmake/modules/FindOpenEXR.cmake b/kdecore/cmake/modules/FindOpenEXR.cmake
new file mode 100644
index 0000000..405b892
--- /dev/null
+++ b/kdecore/cmake/modules/FindOpenEXR.cmake
@@ -0,0 +1,104 @@
+# Try to find the OpenEXR libraries
+# This check defines:
+#
+# OPENEXR_FOUND - system has OpenEXR
+# OPENEXR_INCLUDE_DIR - OpenEXR include directory
+# OPENEXR_LIBRARIES - Libraries needed to use OpenEXR
+# OPENEXR_DEFINITIONS - definitions required to use OpenEXR
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if (OPENEXR_INCLUDE_DIR AND OPENEXR_LIBRARIES)
+ # in cache already
+ set(OPENEXR_FOUND TRUE)
+
+else (OPENEXR_INCLUDE_DIR AND OPENEXR_LIBRARIES)
+
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ find_package(PkgConfig)
+ pkg_check_modules(PC_OPENEXR QUIET OpenEXR)
+
+ FIND_PATH(OPENEXR_INCLUDE_DIR ImfRgbaFile.h
+ HINTS
+ ${PC_OPENEXR_INCLUDEDIR}
+ ${PC_OPENEXR_INCLUDE_DIRS}
+ PATH_SUFFIXES OpenEXR
+ )
+
+ FIND_LIBRARY(OPENEXR_HALF_LIBRARY NAMES Half
+ HINTS
+ ${PC_OPENEXR_LIBDIR}
+ ${PC_OPENEXR_LIBRARY_DIRS}
+ )
+
+
+ FIND_LIBRARY(OPENEXR_IEX_LIBRARY NAMES Iex
+ PATHS
+ ${PC_OPENEXR_LIBDIR}
+ ${PC_OPENEXR_LIBRARY_DIRS}
+ )
+
+ FIND_LIBRARY(OPENEXR_IMATH_LIBRARY NAMES Imath
+ HINTS
+ ${PC_OPENEXR_LIBDIR}
+ ${PC_OPENEXR_LIBRARY_DIRS}
+ NO_DEFAULT_PATH
+ )
+
+ FIND_LIBRARY(OPENEXR_ILMIMF_LIBRARY NAMES IlmImf
+ HINTS
+ ${PC_OPENEXR_LIBDIR}
+ ${PC_OPENEXR_LIBRARY_DIRS}
+ )
+
+ FIND_LIBRARY(OPENEXR_ILMTHREAD_LIBRARY NAMES IlmThread
+ HINTS
+ ${PC_OPENEXR_LIBDIR}
+ ${PC_OPENEXR_LIBRARY_DIRS}
+ )
+
+ if (OPENEXR_INCLUDE_DIR AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY)
+ set(OPENEXR_FOUND TRUE)
+ if (OPENEXR_ILMTHREAD_LIBRARY)
+ set(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} )
+ else (OPENEXR_ILMTHREAD_LIBRARY)
+ set(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} )
+ endif (OPENEXR_ILMTHREAD_LIBRARY)
+
+ if (WIN32)
+ set(_OPENEXR_DEFINITIONS -DOPENEXR_DLL)
+ else (WIN32)
+ set(_OPENEXR_DEFINITIONS)
+ endif (WIN32)
+
+ set(OPENEXR_DEFINITIONS ${_OPENEXR_DEFINITIONS})
+
+ endif (OPENEXR_INCLUDE_DIR AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY)
+
+
+ if (OPENEXR_FOUND)
+ if (NOT OpenEXR_FIND_QUIETLY)
+ message(STATUS "Found OPENEXR: ${OPENEXR_LIBRARIES}")
+ endif (NOT OpenEXR_FIND_QUIETLY)
+ else (OPENEXR_FOUND)
+ if (OpenEXR_FIND_REQUIRED)
+ message(FATAL_ERROR "Could NOT find OPENEXR")
+ endif (OpenEXR_FIND_REQUIRED)
+ endif (OPENEXR_FOUND)
+
+ mark_as_advanced(
+ OPENEXR_INCLUDE_DIR
+ OPENEXR_LIBRARIES
+ OPENEXR_ILMIMF_LIBRARY
+ OPENEXR_ILMTHREAD_LIBRARY
+ OPENEXR_IMATH_LIBRARY
+ OPENEXR_IEX_LIBRARY
+ OPENEXR_HALF_LIBRARY
+ OPENEXR_DEFINITIONS )
+
+endif (OPENEXR_INCLUDE_DIR AND OPENEXR_LIBRARIES)
diff --git a/kdecore/cmake/modules/FindOpenSSL.cmake b/kdecore/cmake/modules/FindOpenSSL.cmake
new file mode 100644
index 0000000..4ce8321
--- /dev/null
+++ b/kdecore/cmake/modules/FindOpenSSL.cmake
@@ -0,0 +1,63 @@
+# - Try to find the OpenSSL encryption library
+# Once done this will define
+#
+# OPENSSL_FOUND - system has the OpenSSL library
+# OPENSSL_INCLUDE_DIR - the OpenSSL include directory
+# OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
+# OPENSSL_EAY_LIBRARIES - The additional libraries needed to use OpenSSL on windows
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+INCLUDE(FindLibraryWithDebug)
+
+# on win32 we additional need to link to libeay32.lib
+MACRO(OPENSSL_ADD_LIB_EAY_LIBS)
+ FIND_LIBRARY_WITH_DEBUG(OPENSSL_EAY_LIBRARIES
+ WIN32_DEBUG_POSTFIX d
+ NAMES eay libeay libeay32 libeay32MD)
+ENDMACRO(OPENSSL_ADD_LIB_EAY_LIBS)
+
+IF(OPENSSL_LIBRARIES)
+ SET(OpenSSL_FIND_QUIETLY TRUE)
+ENDIF(OPENSSL_LIBRARIES)
+
+IF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE)
+ SET(LIB_FOUND 1)
+ENDIF(SSL_EAY_DEBUG AND SSL_EAY_RELEASE)
+
+FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h )
+
+FIND_LIBRARY_WITH_DEBUG(OPENSSL_LIBRARIES
+ WIN32_DEBUG_POSTFIX d
+ NAMES ssl ssleay ssleay32 libssleay32 ssleay32MD)
+
+IF(WIN32)
+ OPENSSL_ADD_LIB_EAY_LIBS()
+ IF(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES AND OPENSSL_EAY_LIBRARIES)
+ SET(OPENSSL_FOUND TRUE)
+ ELSE(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES AND OPENSSL_EAY_LIBRARIES)
+ SET(OPENSSL_FOUND FALSE)
+ ENDIF (OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES AND OPENSSL_EAY_LIBRARIES)
+ELSE(WIN32)
+ IF(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES)
+ SET(OPENSSL_FOUND TRUE)
+ ELSE(OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES)
+ SET(OPENSSL_FOUND FALSE)
+ ENDIF (OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES)
+ENDIF(WIN32)
+
+IF (OPENSSL_FOUND)
+ IF (NOT OpenSSL_FIND_QUIETLY)
+ MESSAGE(STATUS "Found OpenSSL: ${OPENSSL_LIBRARIES}")
+ ENDIF (NOT OpenSSL_FIND_QUIETLY)
+ELSE (OPENSSL_FOUND)
+ IF (OpenSSL_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could NOT find OpenSSL")
+ ENDIF (OpenSSL_FIND_REQUIRED)
+ENDIF (OPENSSL_FOUND)
+
+MARK_AS_ADVANCED(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)
+
diff --git a/kdecore/cmake/modules/FindPCRE.cmake b/kdecore/cmake/modules/FindPCRE.cmake
new file mode 100644
index 0000000..0fe3210
--- /dev/null
+++ b/kdecore/cmake/modules/FindPCRE.cmake
@@ -0,0 +1,44 @@
+# - Try to find the PCRE regular expression library
+# Once done this will define
+#
+# PCRE_FOUND - system has the PCRE library
+# PCRE_INCLUDE_DIR - the PCRE include directory
+# PCRE_LIBRARIES - The libraries needed to use PCRE
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if (PCRE_INCLUDE_DIR AND PCRE_PCREPOSIX_LIBRARY AND PCRE_PCRE_LIBRARY)
+ # Already in cache, be silent
+ set(PCRE_FIND_QUIETLY TRUE)
+endif (PCRE_INCLUDE_DIR AND PCRE_PCREPOSIX_LIBRARY AND PCRE_PCRE_LIBRARY)
+
+
+if (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ find_package(PkgConfig)
+
+ pkg_check_modules(PC_PCRE QUIET libpcre)
+
+ set(PCRE_DEFINITIONS ${PC_PCRE_CFLAGS_OTHER})
+
+endif (NOT WIN32)
+
+find_path(PCRE_INCLUDE_DIR pcre.h
+ HINTS ${PC_PCRE_INCLUDEDIR} ${PC_PCRE_INCLUDE_DIRS}
+ PATH_SUFFIXES pcre)
+
+find_library(PCRE_PCRE_LIBRARY NAMES pcre pcred HINTS ${PC_PCRE_LIBDIR} ${PC_PCRE_LIBRARY_DIRS})
+
+find_library(PCRE_PCREPOSIX_LIBRARY NAMES pcreposix pcreposixd HINTS ${PC_PCRE_LIBDIR} ${PC_PCRE_LIBRARY_DIRS})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(PCRE DEFAULT_MSG PCRE_INCLUDE_DIR PCRE_PCRE_LIBRARY PCRE_PCREPOSIX_LIBRARY )
+
+set(PCRE_LIBRARIES ${PCRE_PCRE_LIBRARY} ${PCRE_PCREPOSIX_LIBRARY})
+
+mark_as_advanced(PCRE_INCLUDE_DIR PCRE_LIBRARIES PCRE_PCREPOSIX_LIBRARY PCRE_PCRE_LIBRARY)
diff --git a/kdecore/cmake/modules/FindPackageHandleStandardArgs.cmake b/kdecore/cmake/modules/FindPackageHandleStandardArgs.cmake
new file mode 100644
index 0000000..1152ce6
--- /dev/null
+++ b/kdecore/cmake/modules/FindPackageHandleStandardArgs.cmake
@@ -0,0 +1,210 @@
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ... )
+#
+# This function is intended to be used in FindXXX.cmake modules files.
+# It handles the REQUIRED, QUIET and version-related arguments to FIND_PACKAGE().
+# It also sets the <UPPERCASED_NAME>_FOUND variable.
+# The package is considered found if all variables <var1>... listed contain
+# valid results, e.g. valid filepaths.
+#
+# There are two modes of this function. The first argument in both modes is
+# the name of the Find-module where it is called (in original casing).
+#
+# The first simple mode looks like this:
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> (DEFAULT_MSG|"Custom failure message") <var1>...<varN> )
+# If the variables <var1> to <varN> are all valid, then <UPPERCASED_NAME>_FOUND
+# will be set to TRUE.
+# If DEFAULT_MSG is given as second argument, then the function will generate
+# itself useful success and error messages. You can also supply a custom error message
+# for the failure case. This is not recommended.
+#
+# The second mode is more powerful and also supports version checking:
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [REQUIRED_VARS <var1>...<varN>]
+# [VERSION_VAR <versionvar>
+# [FAIL_MESSAGE "Custom failure message"] )
+#
+# As above, if <var1> through <varN> are all valid, <UPPERCASED_NAME>_FOUND
+# will be set to TRUE.
+# Via FAIL_MESSAGE a custom failure message can be specified, if this is not
+# used, the default message will be displayed.
+# Following VERSION_VAR the name of the variable can be specified which holds
+# the version of the package which has been found. If this is done, this version
+# will be checked against the (potentially) specified required version used
+# in the find_package() call. The EXACT keyword is also handled. The default
+# messages include information about the required version and the version
+# which has been actually found, both if the version is ok or not.
+#
+# Example for mode 1:
+#
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
+#
+# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and
+# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
+# If it is not found and REQUIRED was used, it fails with FATAL_ERROR,
+# independent whether QUIET was used or not.
+# If it is found, success will be reported, including the content of <var1>.
+# On repeated Cmake runs, the same message won't be printed again.
+#
+# Example for mode 2:
+#
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS BISON_EXECUTABLE
+# VERSION_VAR BISON_VERSION)
+# In this case, BISON is considered to be found if the variable(s) listed
+# after REQUIRED_VAR are all valid, i.e. BISON_EXECUTABLE in this case.
+# Also the version of BISON will be checked by using the version contained
+# in BISON_VERSION.
+# Since no FAIL_MESSAGE is given, the default messages will be printed.
+
+#=============================================================================
+# Copyright 2007-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+INCLUDE(FindPackageMessage)
+INCLUDE(CMakeParseArguments)
+
+
+FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG _VAR1)
+
+# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in
+# new extended or in the "old" mode:
+ SET(options) # none
+ SET(oneValueArgs FAIL_MESSAGE VERSION_VAR)
+ SET(multiValueArgs REQUIRED_VARS)
+ SET(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} )
+ LIST(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
+
+ IF(${INDEX} EQUAL -1)
+ SET(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
+ SET(FPHSA_REQUIRED_VARS ${_VAR1} ${ARGN})
+ SET(FPHSA_VERSION_VAR)
+ ELSE(${INDEX} EQUAL -1)
+
+ CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${_VAR1} ${ARGN})
+
+ IF(FPHSA_UNPARSED_ARGUMENTS)
+ MESSAGE(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
+ ENDIF(FPHSA_UNPARSED_ARGUMENTS)
+
+ IF(NOT FPHSA_FAIL_MESSAGE)
+ SET(FPHSA_FAIL_MESSAGE "DEFAULT_MSG")
+ ENDIF(NOT FPHSA_FAIL_MESSAGE)
+ ENDIF(${INDEX} EQUAL -1)
+
+# now that we collected all arguments, process them
+
+ IF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
+ SET(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
+ ENDIF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
+
+ IF(NOT FPHSA_REQUIRED_VARS)
+ MESSAGE(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
+ ENDIF(NOT FPHSA_REQUIRED_VARS)
+
+ LIST(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
+
+ STRING(TOUPPER ${_NAME} _NAME_UPPER)
+
+ # collect all variables which were not found, so they can be printed, so the
+ # user knows better what went wrong (#6375)
+ SET(MISSING_VARS "")
+ SET(DETAILS "")
+ SET(${_NAME_UPPER}_FOUND TRUE)
+ # check if all passed variables are valid
+ FOREACH(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
+ IF(NOT ${_CURRENT_VAR})
+ SET(${_NAME_UPPER}_FOUND FALSE)
+ SET(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
+ ELSE(NOT ${_CURRENT_VAR})
+ SET(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]")
+ ENDIF(NOT ${_CURRENT_VAR})
+ ENDFOREACH(_CURRENT_VAR)
+
+
+ # version handling:
+ SET(VERSION_MSG "")
+ SET(VERSION_OK TRUE)
+ IF (${_NAME}_FIND_VERSION)
+
+ # if the package was found, check for the version using <NAME>_FIND_VERSION
+ IF (${_NAME_UPPER}_FOUND)
+ SET(VERSION ${${FPHSA_VERSION_VAR}} )
+
+ IF(VERSION)
+
+ IF(${_NAME}_FIND_VERSION_EXACT) # exact version required
+ IF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+ SET(VERSION_MSG " Found version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
+ SET(VERSION_OK FALSE)
+ ELSE (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+ SET(VERSION_MSG " (found exact version \"${VERSION}\")")
+ ENDIF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+
+ ELSE(${_NAME}_FIND_VERSION_EXACT) # minimum version specified:
+ IF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+ SET(VERSION_MSG " Found version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
+ SET(VERSION_OK FALSE)
+ ELSE ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+ SET(VERSION_MSG " (found version \"${VERSION}\", required is \"${${_NAME}_FIND_VERSION}\")")
+ ENDIF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+ ENDIF(${_NAME}_FIND_VERSION_EXACT)
+
+# Uncomment the following two lines to see to which Find-modules the VERSION_VAR keywords still need to be added:
+# ELSE(VERSION)
+# SET(VERSION_MSG " (WARNING: Required version is \"${${_NAME}_FIND_VERSION}\", but version of ${_NAME} is unknown)")
+ ENDIF(VERSION)
+
+ # if the package was not found, but a version was given, add that to the output:
+ ELSE (${_NAME_UPPER}_FOUND)
+ IF(${_NAME}_FIND_VERSION_EXACT)
+ SET(VERSION_MSG " (Required is exact version \"${${_NAME}_FIND_VERSION}\")")
+ ELSE(${_NAME}_FIND_VERSION_EXACT)
+ SET(VERSION_MSG " (Required is at least version \"${${_NAME}_FIND_VERSION}\")")
+ ENDIF(${_NAME}_FIND_VERSION_EXACT)
+ ENDIF (${_NAME_UPPER}_FOUND)
+ ENDIF (${_NAME}_FIND_VERSION)
+
+ IF(VERSION_OK)
+ SET(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]")
+ ELSE(VERSION_OK)
+ SET(${_NAME_UPPER}_FOUND FALSE)
+ ENDIF(VERSION_OK)
+
+
+ # print the result:
+ IF (${_NAME_UPPER}_FOUND)
+ FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG}" "${DETAILS}")
+ ELSE (${_NAME_UPPER}_FOUND)
+ IF(NOT VERSION_OK)
+
+ IF (${_NAME}_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
+ ELSE (${_NAME}_FIND_REQUIRED)
+ IF (NOT ${_NAME}_FIND_QUIETLY)
+ MESSAGE(STATUS "${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
+ ENDIF (NOT ${_NAME}_FIND_QUIETLY)
+ ENDIF (${_NAME}_FIND_REQUIRED)
+
+ ELSE(NOT VERSION_OK)
+
+ IF (${_NAME}_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
+ ELSE (${_NAME}_FIND_REQUIRED)
+ IF (NOT ${_NAME}_FIND_QUIETLY)
+ MESSAGE(STATUS "${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
+ ENDIF (NOT ${_NAME}_FIND_QUIETLY)
+ ENDIF (${_NAME}_FIND_REQUIRED)
+ ENDIF(NOT VERSION_OK)
+
+ ENDIF (${_NAME_UPPER}_FOUND)
+
+ SET(${_NAME_UPPER}_FOUND ${${_NAME_UPPER}_FOUND} PARENT_SCOPE)
+
+ENDFUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _FIRST_ARG)
diff --git a/kdecore/cmake/modules/FindPhonon.cmake b/kdecore/cmake/modules/FindPhonon.cmake
new file mode 100644
index 0000000..cd9e5cb
--- /dev/null
+++ b/kdecore/cmake/modules/FindPhonon.cmake
@@ -0,0 +1,37 @@
+# Find libphonon
+# Once done this will define
+#
+# PHONON_FOUND - system has Phonon Library
+# PHONON_INCLUDES - the Phonon include directory
+# PHONON_LIBS - link these to use Phonon
+# PHONON_VERSION - the version of the Phonon Library
+
+# Copyright (c) 2008, Matthias Kretz <kretz@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+macro(_phonon_find_version)
+ set(_phonon_namespace_header_file "${PHONON_INCLUDE_DIR}/phonon/phononnamespace.h")
+ if (APPLE AND EXISTS "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
+ set(_phonon_namespace_header_file "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
+ endif (APPLE AND EXISTS "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
+ file(READ ${_phonon_namespace_header_file} _phonon_header LIMIT 5000 OFFSET 1000)
+ string(REGEX MATCH "define PHONON_VERSION_STR \"(4\\.[0-9]+\\.[0-9a-z]+)\"" _phonon_version_match "${_phonon_header}")
+ set(PHONON_VERSION "${CMAKE_MATCH_1}")
+endmacro(_phonon_find_version)
+
+# the dirs listed with HINTS are searched before the default sets of dirs
+find_library(PHONON_LIBRARY NAMES phonon HINTS ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR})
+find_path(PHONON_INCLUDE_DIR NAMES phonon/phonon_export.h HINTS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} ${QT_LIBRARY_DIR})
+
+if(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
+ set(PHONON_LIBS ${phonon_LIB_DEPENDS} ${PHONON_LIBRARY})
+ set(PHONON_INCLUDES ${PHONON_INCLUDE_DIR}/KDE ${PHONON_INCLUDE_DIR})
+ _phonon_find_version()
+endif(PHONON_INCLUDE_DIR AND PHONON_LIBRARY)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Phonon DEFAULT_MSG PHONON_INCLUDE_DIR PHONON_LIBRARY)
+
+mark_as_advanced(PHONON_INCLUDE_DIR PHONON_LIBRARY)
diff --git a/kdecore/cmake/modules/FindPkgConfig.cmake b/kdecore/cmake/modules/FindPkgConfig.cmake
new file mode 100644
index 0000000..78c4a13
--- /dev/null
+++ b/kdecore/cmake/modules/FindPkgConfig.cmake
@@ -0,0 +1,377 @@
+# - a pkg-config module for CMake
+#
+# Usage:
+# pkg_check_modules(<PREFIX> [REQUIRED] [QUIET] <MODULE> [<MODULE>]*)
+# checks for all the given modules
+#
+# pkg_search_module(<PREFIX> [REQUIRED] [QUIET] <MODULE> [<MODULE>]*)
+# checks for given modules and uses the first working one
+#
+# When the 'REQUIRED' argument was set, macros will fail with an error
+# when module(s) could not be found
+#
+# When the 'QUIET' argument is set, no status messages will be printed.
+#
+# It sets the following variables:
+# PKG_CONFIG_FOUND ... true if pkg-config works on the system
+# PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program
+# <PREFIX>_FOUND ... set to 1 if module(s) exist
+#
+# For the following variables two sets of values exist; first one is the
+# common one and has the given PREFIX. The second set contains flags
+# which are given out when pkgconfig was called with the '--static'
+# option.
+# <XPREFIX>_LIBRARIES ... only the libraries (w/o the '-l')
+# <XPREFIX>_LIBRARY_DIRS ... the paths of the libraries (w/o the '-L')
+# <XPREFIX>_LDFLAGS ... all required linker flags
+# <XPREFIX>_LDFLAGS_OTHER ... all other linker flags
+# <XPREFIX>_INCLUDE_DIRS ... the '-I' preprocessor flags (w/o the '-I')
+# <XPREFIX>_CFLAGS ... all required cflags
+# <XPREFIX>_CFLAGS_OTHER ... the other compiler flags
+#
+# <XPREFIX> = <PREFIX> for common case
+# <XPREFIX> = <PREFIX>_STATIC for static linking
+#
+# There are some special variables whose prefix depends on the count
+# of given modules. When there is only one module, <PREFIX> stays
+# unchanged. When there are multiple modules, the prefix will be
+# changed to <PREFIX>_<MODNAME>:
+# <XPREFIX>_VERSION ... version of the module
+# <XPREFIX>_PREFIX ... prefix-directory of the module
+# <XPREFIX>_INCLUDEDIR ... include-dir of the module
+# <XPREFIX>_LIBDIR ... lib-dir of the module
+#
+# <XPREFIX> = <PREFIX> when |MODULES| == 1, else
+# <XPREFIX> = <PREFIX>_<MODNAME>
+#
+# A <MODULE> parameter can have the following formats:
+# {MODNAME} ... matches any version
+# {MODNAME}>={VERSION} ... at least version <VERSION> is required
+# {MODNAME}={VERSION} ... exactly version <VERSION> is required
+# {MODNAME}<={VERSION} ... modules must not be newer than <VERSION>
+#
+# Examples
+# pkg_check_modules (GLIB2 glib-2.0)
+#
+# pkg_check_modules (GLIB2 glib-2.0>=2.10)
+# requires at least version 2.10 of glib2 and defines e.g.
+# GLIB2_VERSION=2.10.3
+#
+# pkg_check_modules (FOO glib-2.0>=2.10 gtk+-2.0)
+# requires both glib2 and gtk2, and defines e.g.
+# FOO_glib-2.0_VERSION=2.10.3
+# FOO_gtk+-2.0_VERSION=2.8.20
+#
+# pkg_check_modules (XRENDER REQUIRED xrender)
+# defines e.g.:
+# XRENDER_LIBRARIES=Xrender;X11
+# XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp
+#
+# pkg_search_module (BAR libxml-2.0 libxml2 libxml>=2)
+
+
+# Copyright (C) 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+#
+# Redistribution and use, with or without modification, are permitted
+# provided that the following conditions are met:
+#
+# 1. Redistributions must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+# 2. The name of the author may not be used to endorse or promote
+# products derived from this software without specific prior
+# written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Modified for KDE use from cmake 2.6.2 version, to add QUIET option to
+# pkg_check_modules().
+# Copyright (c) 2009, David Jarvie <djarvie@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+### Common stuff ####
+set(PKG_CONFIG_VERSION 1)
+set(PKG_CONFIG_FOUND 0)
+
+find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC "pkg-config executable")
+mark_as_advanced(PKG_CONFIG_EXECUTABLE)
+
+if(PKG_CONFIG_EXECUTABLE)
+ set(PKG_CONFIG_FOUND 1)
+endif(PKG_CONFIG_EXECUTABLE)
+
+
+# Unsets the given variables
+macro(_pkgconfig_unset var)
+ set(${var} "" CACHE INTERNAL "")
+endmacro(_pkgconfig_unset)
+
+macro(_pkgconfig_set var value)
+ set(${var} ${value} CACHE INTERNAL "")
+endmacro(_pkgconfig_set)
+
+# Invokes pkgconfig, cleans up the result and sets variables
+macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp)
+ set(_pkgconfig_invoke_result)
+
+ execute_process(
+ COMMAND ${PKG_CONFIG_EXECUTABLE} ${ARGN} ${_pkglist}
+ OUTPUT_VARIABLE _pkgconfig_invoke_result
+ RESULT_VARIABLE _pkgconfig_failed)
+
+ if (_pkgconfig_failed)
+ set(_pkgconfig_${_varname} "")
+ _pkgconfig_unset(${_prefix}_${_varname})
+ else(_pkgconfig_failed)
+ string(REGEX REPLACE "[\r\n]" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
+ string(REGEX REPLACE " +$" "" _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
+
+ if (NOT ${_regexp} STREQUAL "")
+ string(REGEX REPLACE "${_regexp}" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}")
+ endif(NOT ${_regexp} STREQUAL "")
+
+ separate_arguments(_pkgconfig_invoke_result)
+
+ #message(STATUS " ${_varname} ... ${_pkgconfig_invoke_result}")
+ set(_pkgconfig_${_varname} ${_pkgconfig_invoke_result})
+ _pkgconfig_set(${_prefix}_${_varname} "${_pkgconfig_invoke_result}")
+ endif(_pkgconfig_failed)
+endmacro(_pkgconfig_invoke)
+
+# Invokes pkgconfig two times; once without '--static' and once with
+# '--static'
+macro(_pkgconfig_invoke_dyn _pkglist _prefix _varname cleanup_regexp)
+ _pkgconfig_invoke("${_pkglist}" ${_prefix} ${_varname} "${cleanup_regexp}" ${ARGN})
+ _pkgconfig_invoke("${_pkglist}" ${_prefix} STATIC_${_varname} "${cleanup_regexp}" --static ${ARGN})
+endmacro(_pkgconfig_invoke_dyn)
+
+# Splits given arguments into options and a package list
+macro(_pkgconfig_parse_options _result _is_req _is_silent)
+ set(${_is_req} 0)
+ set(${_is_silent} 0)
+
+ foreach(_pkg ${ARGN})
+ if (_pkg STREQUAL "REQUIRED")
+ set(${_is_req} 1)
+ endif (_pkg STREQUAL "REQUIRED")
+ if (_pkg STREQUAL "QUIET")
+ set(${_is_silent} 1)
+ endif (_pkg STREQUAL "QUIET")
+ endforeach(_pkg ${ARGN})
+
+ set(${_result} ${ARGN})
+ list(REMOVE_ITEM ${_result} "REQUIRED")
+ list(REMOVE_ITEM ${_result} "QUIET")
+endmacro(_pkgconfig_parse_options)
+
+###
+macro(_pkg_check_modules_internal _is_required _is_silent _prefix)
+ _pkgconfig_unset(${_prefix}_FOUND)
+ _pkgconfig_unset(${_prefix}_VERSION)
+ _pkgconfig_unset(${_prefix}_PREFIX)
+ _pkgconfig_unset(${_prefix}_INCLUDEDIR)
+ _pkgconfig_unset(${_prefix}_LIBDIR)
+ _pkgconfig_unset(${_prefix}_LIBS)
+ _pkgconfig_unset(${_prefix}_LIBS_L)
+ _pkgconfig_unset(${_prefix}_LIBS_PATHS)
+ _pkgconfig_unset(${_prefix}_LIBS_OTHER)
+ _pkgconfig_unset(${_prefix}_CFLAGS)
+ _pkgconfig_unset(${_prefix}_CFLAGS_I)
+ _pkgconfig_unset(${_prefix}_CFLAGS_OTHER)
+ _pkgconfig_unset(${_prefix}_STATIC_LIBDIR)
+ _pkgconfig_unset(${_prefix}_STATIC_LIBS)
+ _pkgconfig_unset(${_prefix}_STATIC_LIBS_L)
+ _pkgconfig_unset(${_prefix}_STATIC_LIBS_PATHS)
+ _pkgconfig_unset(${_prefix}_STATIC_LIBS_OTHER)
+ _pkgconfig_unset(${_prefix}_STATIC_CFLAGS)
+ _pkgconfig_unset(${_prefix}_STATIC_CFLAGS_I)
+ _pkgconfig_unset(${_prefix}_STATIC_CFLAGS_OTHER)
+
+ # create a better addressable variable of the modules and calculate its size
+ set(_pkg_check_modules_list ${ARGN})
+ list(LENGTH _pkg_check_modules_list _pkg_check_modules_cnt)
+
+ if(PKG_CONFIG_EXECUTABLE)
+ # give out status message telling checked module
+ if (NOT ${_is_silent})
+ if (_pkg_check_modules_cnt EQUAL 1)
+ message(STATUS "checking for module '${_pkg_check_modules_list}'")
+ else(_pkg_check_modules_cnt EQUAL 1)
+ message(STATUS "checking for modules '${_pkg_check_modules_list}'")
+ endif(_pkg_check_modules_cnt EQUAL 1)
+ endif(NOT ${_is_silent})
+
+ set(_pkg_check_modules_packages)
+ set(_pkg_check_modules_failed)
+
+ # iterate through module list and check whether they exist and match the required version
+ foreach (_pkg_check_modules_pkg ${_pkg_check_modules_list})
+ set(_pkg_check_modules_exist_query)
+
+ # check whether version is given
+ if (_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*")
+ string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\1" _pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}")
+ string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\2" _pkg_check_modules_pkg_op "${_pkg_check_modules_pkg}")
+ string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\3" _pkg_check_modules_pkg_ver "${_pkg_check_modules_pkg}")
+ else(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*")
+ set(_pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}")
+ set(_pkg_check_modules_pkg_op)
+ set(_pkg_check_modules_pkg_ver)
+ endif(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*")
+
+ # handle the operands
+ if (_pkg_check_modules_pkg_op STREQUAL ">=")
+ list(APPEND _pkg_check_modules_exist_query --atleast-version)
+ endif(_pkg_check_modules_pkg_op STREQUAL ">=")
+
+ if (_pkg_check_modules_pkg_op STREQUAL "=")
+ list(APPEND _pkg_check_modules_exist_query --exact-version)
+ endif(_pkg_check_modules_pkg_op STREQUAL "=")
+
+ if (_pkg_check_modules_pkg_op STREQUAL "<=")
+ list(APPEND _pkg_check_modules_exist_query --max-version)
+ endif(_pkg_check_modules_pkg_op STREQUAL "<=")
+
+ # create the final query which is of the format:
+ # * --atleast-version <version> <pkg-name>
+ # * --exact-version <version> <pkg-name>
+ # * --max-version <version> <pkg-name>
+ # * --exists <pkg-name>
+ if (_pkg_check_modules_pkg_op)
+ list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_ver}")
+ else(_pkg_check_modules_pkg_op)
+ list(APPEND _pkg_check_modules_exist_query --exists)
+ endif(_pkg_check_modules_pkg_op)
+
+ _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_VERSION)
+ _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_PREFIX)
+ _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_INCLUDEDIR)
+ _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_LIBDIR)
+
+ list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_name}")
+ list(APPEND _pkg_check_modules_packages "${_pkg_check_modules_pkg_name}")
+
+ # execute the query
+ execute_process(
+ COMMAND ${PKG_CONFIG_EXECUTABLE} ${_pkg_check_modules_exist_query}
+ RESULT_VARIABLE _pkgconfig_retval)
+
+ # evaluate result and tell failures
+ if (_pkgconfig_retval)
+ if(NOT ${_is_silent})
+ message(STATUS " package '${_pkg_check_modules_pkg}' not found")
+ endif(NOT ${_is_silent})
+
+ set(_pkg_check_modules_failed 1)
+ endif(_pkgconfig_retval)
+ endforeach(_pkg_check_modules_pkg)
+
+ if(_pkg_check_modules_failed)
+ # fail when requested
+ if (${_is_required})
+ message(SEND_ERROR "A required package was not found")
+ endif (${_is_required})
+ else(_pkg_check_modules_failed)
+ # when we are here, we checked whether requested modules
+ # exist. Now, go through them and set variables
+
+ _pkgconfig_set(${_prefix}_FOUND 1)
+ list(LENGTH _pkg_check_modules_packages pkg_count)
+
+ # iterate through all modules again and set individual variables
+ foreach (_pkg_check_modules_pkg ${_pkg_check_modules_packages})
+ # handle case when there is only one package required
+ if (pkg_count EQUAL 1)
+ set(_pkg_check_prefix "${_prefix}")
+ else(pkg_count EQUAL 1)
+ set(_pkg_check_prefix "${_prefix}_${_pkg_check_modules_pkg}")
+ endif(pkg_count EQUAL 1)
+
+ _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" VERSION "" --modversion )
+ _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" PREFIX "" --variable=prefix )
+ _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" INCLUDEDIR "" --variable=includedir )
+ _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" LIBDIR "" --variable=libdir )
+
+ if (NOT ${_is_silent})
+ message(STATUS " found ${_pkg_check_modules_pkg}, version ${_pkgconfig_VERSION}")
+ endif (NOT ${_is_silent})
+ endforeach(_pkg_check_modules_pkg)
+
+ # set variables which are combined for multiple modules
+ _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARIES "(^| )-l" --libs-only-l )
+ _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARY_DIRS "(^| )-L" --libs-only-L )
+ _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LDFLAGS "" --libs )
+ _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LDFLAGS_OTHER "" --libs-only-other )
+
+ _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" INCLUDE_DIRS "(^| )-I" --cflags-only-I )
+ _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS "" --cflags )
+ _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS_OTHER "" --cflags-only-other )
+ endif(_pkg_check_modules_failed)
+ else(PKG_CONFIG_EXECUTABLE)
+ if (${_is_required})
+ message(SEND_ERROR "pkg-config tool not found")
+ endif (${_is_required})
+ endif(PKG_CONFIG_EXECUTABLE)
+endmacro(_pkg_check_modules_internal)
+
+###
+### User visible macros start here
+###
+
+###
+macro(pkg_check_modules _prefix _module0)
+ # check cached value
+ if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
+ _pkgconfig_parse_options (_pkg_modules _pkg_is_required _pkg_is_silent "${_module0}" ${ARGN})
+ _pkg_check_modules_internal("${_pkg_is_required}" "${_pkg_is_silent}" "${_prefix}" ${_pkg_modules})
+
+ _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
+ endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
+endmacro(pkg_check_modules)
+
+###
+macro(pkg_search_module _prefix _module0)
+ # check cached value
+ if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
+ set(_pkg_modules_found 0)
+ _pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required _pkg_is_silent "${_module0}" ${ARGN})
+
+ if (NOT ${_pkg_is_silent})
+ message(STATUS "checking for one of the modules '${_pkg_modules_alt}'")
+ endif (NOT ${_pkg_is_silent})
+
+ # iterate through all modules and stop at the first working one.
+ foreach(_pkg_alt ${_pkg_modules_alt})
+ if(NOT _pkg_modules_found)
+ _pkg_check_modules_internal(0 1 "${_prefix}" "${_pkg_alt}")
+ endif(NOT _pkg_modules_found)
+
+ if (${_prefix}_FOUND)
+ set(_pkg_modules_found 1)
+ endif(${_prefix}_FOUND)
+ endforeach(_pkg_alt)
+
+ if (NOT ${_prefix}_FOUND)
+ if(${_pkg_is_required})
+ message(SEND_ERROR "None of the required '${_pkg_modules_alt}' found")
+ endif(${_pkg_is_required})
+ endif(NOT ${_prefix}_FOUND)
+
+ _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION})
+ endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION} OR NOT ${_prefix}_FOUND)
+endmacro(pkg_search_module)
+
+### Local Variables:
+### mode: cmake
+### End:
diff --git a/kdecore/cmake/modules/FindPlasma.cmake b/kdecore/cmake/modules/FindPlasma.cmake
new file mode 100644
index 0000000..72d07c7
--- /dev/null
+++ b/kdecore/cmake/modules/FindPlasma.cmake
@@ -0,0 +1,20 @@
+
+# FindPlasma.cmake was part of KDE 4.1, but Plasma itself didn't guarantee compatibility before 4.2,
+# so anything which relied on Plasma < 4.2 is broken anyway with KDE 4.2.
+# So since the package itself didn't keep compatibility, it doesn't make sense to provide
+# this file just to keep compatibility for the cmake part, this doesn't help anybody.
+# Especially now that plasma is part of kdelibs and as such the variables required
+# for using plasma are set by FindKDE4Internal.cmake.
+# This file is not used anywhere in trunk/KDE/ anymore, 3rd party projects get a
+# error message which tells them what to do, so we should be fine.
+# Alex
+#
+
+message(FATAL_ERROR "FindPlasma.cmake is deprecated. Now with KDE 4.2 Plasma is part of kdelibs and automatically found using find_package(KDE4) instead.
+Replace the variables previously coming from FindPlasma.cmake as follows:
+PLASMA_OPENGL_FOUND -> KDE4_PLASMA_OPENGL_FOUND
+PLASMA_LIBS -> KDE4_PLASMA_LIBS
+PLASMA_INCLUDE_DIR -> KDE4_INCLUDE_DIR or KDE4_INCLUDES, should be already set anyway
+PLASMA_FOUND -> nothing, it's always there if KDE4, version 4.2 or newer has been found.
+If you see this error message in a module within KDE/, update it from svn, it has been fixed already.
+")
diff --git a/kdecore/cmake/modules/FindPolkitQt-1.cmake b/kdecore/cmake/modules/FindPolkitQt-1.cmake
new file mode 100644
index 0000000..4e90537
--- /dev/null
+++ b/kdecore/cmake/modules/FindPolkitQt-1.cmake
@@ -0,0 +1,37 @@
+# - Try to find PolkitQt-1
+# Once done this will define
+#
+# POLKITQT-1_FOUND - system has Polkit-qt
+# POLKITQT-1_INCLUDE_DIR - the Polkit-qt include directory
+# POLKITQT-1_LIBRARIES - Link these to use all Polkit-qt libs
+# POLKITQT-1_CORE_LIBRARY - Link this to use the polkit-qt-core library only
+# POLKITQT-1_GUI_LIBRARY - Link this to use GUI elements in polkit-qt (polkit-qt-gui)
+# POLKITQT-1_AGENT_LIBRARY - Link this to use the agent wrapper in polkit-qt
+# POLKITQT-1_DEFINITIONS - Compiler switches required for using Polkit-qt
+#
+# The minimum required version of PolkitQt-1 can be specified using the
+# standard syntax, e.g. find_package(PolkitQt-1 1.0)
+
+# Copyright (c) 2009, Dario Freddi, <drf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+# Support POLKITQT-1_MIN_VERSION for compatibility:
+if ( NOT PolkitQt-1_FIND_VERSION AND POLKITQT-1_MIN_VERSION )
+ set ( PolkitQt-1_FIND_VERSION ${POLKITQT-1_MIN_VERSION} )
+endif ( NOT PolkitQt-1_FIND_VERSION AND POLKITQT-1_MIN_VERSION )
+
+set( _PolkitQt-1_FIND_QUIETLY ${PolkitQt-1_FIND_QUIETLY} )
+find_package( PolkitQt-1 ${PolkitQt-1_FIND_VERSION} QUIET NO_MODULE PATHS ${LIB_INSTALL_DIR}/PolkitQt-1/cmake )
+set( PolkitQt-1_FIND_QUIETLY ${_PolkitQt-1_FIND_QUIETLY} )
+
+include( FindPackageHandleStandardArgs )
+find_package_handle_standard_args( PolkitQt-1 DEFAULT_MSG PolkitQt-1_CONFIG )
+
+if (POLKITQT-1_FOUND)
+ if (NOT POLKITQT-1_INSTALL_DIR STREQUAL CMAKE_INSTALL_PREFIX)
+ message("WARNING: Installation prefix does not match PolicyKit install prefixes. You probably will need to move files installed "
+ "in POLICY_FILES_INSTALL_DIR and by dbus_add_activation_system_service to the ${PC_POLKITQT-1_PREFIX} prefix")
+ endif (NOT POLKITQT-1_INSTALL_DIR STREQUAL CMAKE_INSTALL_PREFIX)
+endif (POLKITQT-1_FOUND)
diff --git a/kdecore/cmake/modules/FindPolkitQt.cmake b/kdecore/cmake/modules/FindPolkitQt.cmake
new file mode 100644
index 0000000..3f9db5a
--- /dev/null
+++ b/kdecore/cmake/modules/FindPolkitQt.cmake
@@ -0,0 +1,94 @@
+# - Try to find Polkit-qt
+# Once done this will define
+#
+# POLKITQT_FOUND - system has Polkit-qt
+# POLKITQT_INCLUDE_DIR - the Polkit-qt include directory
+# POLKITQT_LIBRARIES - Link these to use all Polkit-qt libs
+# POLKITQT_CORE_LIBRARY - Link this to use the polkit-qt-core library only
+# POLKITQT_GUI_LIBRARY - Link this to use GUI elements in polkit-qt (polkit-qt-gui)
+# POLKITQT_DEFINITIONS - Compiler switches required for using Polkit-qt
+# POLKITQT_POLICY_FILES_INSTALL_DIR - The directory where policy files should be installed to.
+#
+# The minimum required version of PolkitQt can be specified using the
+# standard syntax, e.g. find_package(PolkitQt 1.0)
+# For compatiblity, this can also be done by setting the POLKITQT_MIN_VERSION variable.
+
+# Copyright (c) 2009, Daniel Nicoletti, <dantti85-pk@yahoo.com.br>
+# Copyright (c) 2009, Dario Freddi, <drf54321@gmail.com>
+# Copyright (c) 2009, Michal Malek, <michalm@jabster.pl>
+# Copyright (c) 2009, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+# Support POLKITQT_MIN_VERSION for compatibility:
+if(NOT PolkitQt_FIND_VERSION)
+ set(PolkitQt_FIND_VERSION "${POLKITQT_MIN_VERSION}")
+endif(NOT PolkitQt_FIND_VERSION)
+
+# the minimum version of PolkitQt we require
+if(NOT PolkitQt_FIND_VERSION)
+ set(PolkitQt_FIND_VERSION "0.9.3")
+endif(NOT PolkitQt_FIND_VERSION)
+
+if (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ find_package(PkgConfig)
+ pkg_check_modules(PC_POLKITQT QUIET polkit-qt)
+ set(POLKITQT_DEFINITIONS ${PC_POLKITQT_CFLAGS_OTHER})
+endif (NOT WIN32)
+
+find_path( POLKITQT_INCLUDE_DIR
+ NAMES polkit-qt/auth.h
+ PATH_SUFFIXES PolicyKit
+)
+
+find_file( POLKITQT_VERSION_FILE
+ polkit-qt/polkitqtversion.h
+ HINTS ${POLKITQT_INCLUDE_DIR}
+)
+
+if(POLKITQT_VERSION_FILE AND NOT POLKITQT_VERSION)
+ file(READ ${POLKITQT_VERSION_FILE} POLKITQT_VERSION_CONTENT)
+ string (REGEX MATCH "POLKITQT_VERSION_STRING \".*\"\n" POLKITQT_VERSION_MATCH "${POLKITQT_VERSION_CONTENT}")
+
+ if(POLKITQT_VERSION_MATCH)
+ string(REGEX REPLACE "POLKITQT_VERSION_STRING \"(.*)\"\n" "\\1" _POLKITQT_VERSION ${POLKITQT_VERSION_MATCH})
+ endif(POLKITQT_VERSION_MATCH)
+ set(POLKITQT_VERSION "${_POLKITQT_VERSION}" CACHE STRING "Version number of PolkitQt" FORCE)
+endif(POLKITQT_VERSION_FILE AND NOT POLKITQT_VERSION)
+
+find_library( POLKITQT_CORE_LIBRARY
+ NAMES polkit-qt-core
+ HINTS ${PC_POLKITQT_LIBDIR}
+)
+find_library( POLKITQT_GUI_LIBRARY
+ NAMES polkit-qt-gui
+ HINTS ${PC_POLKITQT_LIBDIR}
+)
+set(POLKITQT_LIBRARIES ${POLKITQT_GUI_LIBRARY} ${POLKITQT_CORE_LIBRARY})
+
+include(FindPackageHandleStandardArgs)
+# Use the extended (new) syntax for FPHSA():
+find_package_handle_standard_args(PolkitQt REQUIRED_VARS POLKITQT_GUI_LIBRARY POLKITQT_CORE_LIBRARY POLKITQT_INCLUDE_DIR
+ VERSION_VAR POLKITQT_VERSION)
+
+mark_as_advanced(POLKITQT_INCLUDE_DIR
+ POLKITQT_CORE_LIBRARY
+ POLKITQT_GUI_LIBRARY
+ POLKITQT_VERSION_FILE
+ )
+
+set(POLKITQT_POLICY_FILES_INSTALL_DIR share/PolicyKit/policy/)
+
+if(POLKITQT_FOUND)
+ get_filename_component(_POLKITQT_INSTALL_PREFIX "${POLKITQT_CORE_LIBRARY}" PATH)
+ get_filename_component(_POLKITQT_INSTALL_PREFIX "${_POLKITQT_INSTALL_PREFIX}" PATH)
+ if ( NOT _POLKITQT_INSTALL_PREFIX STREQUAL CMAKE_INSTALL_PREFIX )
+ message("WARNING: Installation prefix does not match PolicyKit install prefixes. You probably will need to move files installed "
+ "in ${CMAKE_INSTALL_PREFIX}/${POLKITQT_POLICY_FILES_INSTALL_DIR} and by dbus_add_activation_system_service to the ${_POLKITQT_INSTALL_PREFIX}/${POLKITQT_POLICY_FILES_INSTALL_DIR} prefix")
+ endif (NOT _POLKITQT_INSTALL_PREFIX STREQUAL CMAKE_INSTALL_PREFIX)
+endif(POLKITQT_FOUND)
+
diff --git a/kdecore/cmake/modules/FindPopplerQt4.cmake b/kdecore/cmake/modules/FindPopplerQt4.cmake
new file mode 100644
index 0000000..f2a59b8
--- /dev/null
+++ b/kdecore/cmake/modules/FindPopplerQt4.cmake
@@ -0,0 +1,53 @@
+# - Try to find the Qt4 binding of the Poppler library
+# Once done this will define
+#
+# POPPLER_QT4_FOUND - system has poppler-qt4
+# POPPLER_QT4_INCLUDE_DIR - the poppler-qt4 include directory
+# POPPLER_QT4_LIBRARIES - Link these to use poppler-qt4
+# POPPLER_QT4_DEFINITIONS - Compiler switches required for using poppler-qt4
+#
+
+# use pkg-config to get the directories and then use these values
+# in the FIND_PATH() and FIND_LIBRARY() calls
+
+# Copyright (c) 2006, Wilfried Huss, <wilfried.huss@gmx.at>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+find_package(PkgConfig)
+pkg_check_modules(PC_POPPLERQT4 QUIET poppler-qt4)
+
+set(POPPLER_QT4_DEFINITIONS ${PC_POPPLERQT4_CFLAGS_OTHER})
+
+find_path(POPPLER_QT4_INCLUDE_DIR
+ NAMES poppler-qt4.h
+ HINTS ${PC_POPPLERQT4_INCLUDEDIR}
+ PATH_SUFFIXES poppler/qt4 poppler
+)
+
+find_library(POPPLER_QT4_LIBRARY
+ NAMES poppler-qt4
+ HINTS ${PC_POPPLERQT4_LIBDIR}
+)
+
+set(POPPLER_QT4_LIBRARIES ${POPPLER_QT4_LIBRARY})
+
+if (POPPLER_QT4_INCLUDE_DIR AND POPPLER_QT4_LIBRARIES)
+ set(POPPLER_QT4_FOUND TRUE)
+else (POPPLER_QT4_INCLUDE_DIR AND POPPLER_QT4_LIBRARIES)
+ set(POPPLER_QT4_FOUND FALSE)
+endif (POPPLER_QT4_INCLUDE_DIR AND POPPLER_QT4_LIBRARIES)
+
+if (POPPLER_QT4_FOUND)
+ if (NOT PopplerQt4_FIND_QUIETLY)
+ message(STATUS "Found poppler-qt4: library: ${POPPLER_QT4_LIBRARIES}, include path: ${POPPLER_QT4_INCLUDE_DIR}")
+ endif (NOT PopplerQt4_FIND_QUIETLY)
+else (POPPLER_QT4_FOUND)
+ if (PopplerQt4_FIND_REQUIRED)
+ message(FATAL_ERROR "Could NOT find poppler-qt4")
+ endif (PopplerQt4_FIND_REQUIRED)
+endif (POPPLER_QT4_FOUND)
+
+mark_as_advanced(POPPLER_QT4_INCLUDE_DIR POPPLER_QT4_LIBRARIES)
diff --git a/kdecore/cmake/modules/FindPostgreSQL.cmake b/kdecore/cmake/modules/FindPostgreSQL.cmake
new file mode 100644
index 0000000..7955612
--- /dev/null
+++ b/kdecore/cmake/modules/FindPostgreSQL.cmake
@@ -0,0 +1,33 @@
+# - Find PostgreSQL
+# Find the PostgreSQL includes and client library
+# This module defines
+# POSTGRESQL_INCLUDE_DIR, where to find POSTGRESQL.h
+# POSTGRESQL_LIBRARIES, the libraries needed to use POSTGRESQL.
+# POSTGRESQL_FOUND, If false, do not try to use PostgreSQL.
+
+# Copyright (c) 2006 Jarosław Staniek <staniek at kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if (POSTGRESQL_INCLUDE_DIR AND POSTGRESQL_LIBRARIES)
+ # Already in cache, be silent
+ set(PostgreSQL_FIND_QUIETLY TRUE)
+endif (POSTGRESQL_INCLUDE_DIR AND POSTGRESQL_LIBRARIES)
+
+
+find_path(POSTGRESQL_INCLUDE_DIR libpq-fe.h
+ /usr/include/pgsql/
+ /usr/local/include/pgsql/
+ /usr/include/postgresql/
+)
+
+find_library(POSTGRESQL_LIBRARIES NAMES pq)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(PostgreSQL DEFAULT_MSG
+ POSTGRESQL_INCLUDE_DIR POSTGRESQL_LIBRARIES )
+
+mark_as_advanced(POSTGRESQL_INCLUDE_DIR POSTGRESQL_LIBRARIES)
+
diff --git a/kdecore/cmake/modules/FindPulseAudio.cmake b/kdecore/cmake/modules/FindPulseAudio.cmake
new file mode 100644
index 0000000..35bcbc2
--- /dev/null
+++ b/kdecore/cmake/modules/FindPulseAudio.cmake
@@ -0,0 +1,71 @@
+# Try to find the PulseAudio library
+#
+# Once done this will define:
+#
+# PULSEAUDIO_FOUND - system has the PulseAudio library
+# PULSEAUDIO_INCLUDE_DIR - the PulseAudio include directory
+# PULSEAUDIO_LIBRARY - the libraries needed to use PulseAudio
+# PULSEAUDIO_MAINLOOP_LIBRARY - the libraries needed to use PulsAudio Mainloop
+#
+# The minimum required version of PulseAudio can be specified using the
+# standard syntax, e.g. find_package(PulseAudio 1.0)
+
+# Copyright (c) 2008, Matthias Kretz, <kretz@kde.org>
+# Copyright (c) 2009, Marcus Hufgard, <Marcus.Hufgard@hufgard.de>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+# Support PULSEAUDIO_MINIMUM_VERSION for compatibility:
+if(NOT PulseAudio_FIND_VERSION)
+ set(PulseAudio_FIND_VERSION "${PULSEAUDIO_MINIMUM_VERSION}")
+endif(NOT PulseAudio_FIND_VERSION)
+
+# the minimum version of PulseAudio we require
+if(NOT PulseAudio_FIND_VERSION)
+ set(PulseAudio_FIND_VERSION "0.9.9")
+endif(NOT PulseAudio_FIND_VERSION)
+
+if (NOT WIN32)
+ include(FindPkgConfig)
+ pkg_check_modules(PC_PULSEAUDIO QUIET libpulse>=${PulseAudio_FIND_VERSION})
+ pkg_check_modules(PC_PULSEAUDIO_MAINLOOP QUIET libpulse-mainloop-glib)
+endif (NOT WIN32)
+
+find_path(PULSEAUDIO_INCLUDE_DIR pulse/pulseaudio.h
+ HINTS
+ ${PC_PULSEAUDIO_INCLUDEDIR}
+ ${PC_PULSEAUDIO_INCLUDE_DIRS}
+ )
+
+find_library(PULSEAUDIO_LIBRARY NAMES pulse libpulse
+ HINTS
+ ${PC_PULSEAUDIO_LIBDIR}
+ ${PC_PULSEAUDIO_LIBRARY_DIRS}
+ )
+
+find_library(PULSEAUDIO_MAINLOOP_LIBRARY NAMES pulse-mainloop pulse-mainloop-glib libpulse-mainloop-glib
+ HINTS
+ ${PC_PULSEAUDIO_LIBDIR}
+ ${PC_PULSEAUDIO_LIBRARY_DIRS}
+ )
+
+# Store the version number in the cache, so we don't have to search every time again:
+if (PULSEAUDIO_INCLUDE_DIR AND NOT PULSEAUDIO_VERSION)
+
+ # get PulseAudio's version from its version.h, and compare it with our minimum version
+ file(STRINGS "${PULSEAUDIO_INCLUDE_DIR}/pulse/version.h" pulse_version_h
+ REGEX ".*pa_get_headers_version\\(\\).*"
+ )
+ string(REGEX REPLACE ".*pa_get_headers_version\\(\\)\ \\(\"([0-9]+\\.[0-9]+\\.[0-9]+)[^\"]*\"\\).*" "\\1"
+ _PULSEAUDIO_VERSION "${pulse_version_h}")
+
+ set(PULSEAUDIO_VERSION "${_PULSEAUDIO_VERSION}" CACHE STRING "Version number of PulseAudio" FORCE)
+endif (PULSEAUDIO_INCLUDE_DIR AND NOT PULSEAUDIO_VERSION)
+
+# Use the new extended syntax of find_package_handle_standard_args(), which also handles version checking:
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(PulseAudio REQUIRED_VARS PULSEAUDIO_LIBRARY PULSEAUDIO_INCLUDE_DIR
+ VERSION_VAR PULSEAUDIO_VERSION )
+
+mark_as_advanced(PULSEAUDIO_INCLUDE_DIR PULSEAUDIO_LIBRARY PULSEAUDIO_MAINLOOP_LIBRARY)
diff --git a/kdecore/cmake/modules/FindPyKDE4.cmake b/kdecore/cmake/modules/FindPyKDE4.cmake
new file mode 100644
index 0000000..98f7c37
--- /dev/null
+++ b/kdecore/cmake/modules/FindPyKDE4.cmake
@@ -0,0 +1,185 @@
+# FindPyKDE4
+#
+# Checks that Python and PyKDE4 are installed and defines a couple macros:
+# * PYKDE4_INSTALL_PYTHON_FILES
+# * PYKDE4_ADD_UI_FILES
+# * PYKDE4_ADD_EXECUTABLE
+
+# By Simon Edwards <simon@simonzone.com>
+# This file is in the public domain.
+
+INCLUDE(FindPythonInterp)
+
+SET(PYKDE4_FOUND FALSE)
+
+get_filename_component( current_module_dir ${CMAKE_CURRENT_LIST_FILE} PATH)
+
+IF(PYTHONINTERP_FOUND)
+ EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${current_module_dir}/FindPyKDE4.py OUTPUT_VARIABLE pykde_config)
+ IF(NOT pykde_config)
+ # Failure to run
+ SET(PYKDE4_FOUND FALSE)
+ ELSE(NOT pykde_config)
+
+ STRING(REGEX REPLACE ".*\npykde_version:([^\n]+).*$" "\\1" PYKDE4_VERSION ${pykde_config})
+ STRING(REGEX REPLACE ".*\npykde_version_str:([^\n]+).*$" "\\1" PYKDE4_VERSION_STR ${pykde_config})
+ STRING(REGEX REPLACE ".*\npykde_kde_sip_flags:([^\n]+).*$" "\\1" PYKDE4_SIP_FLAGS ${pykde_config})
+ STRING(REGEX REPLACE ".*\npykde_sip_dir:([^\n]+).*$" "\\1" PYKDE4_SIP_DIR ${pykde_config})
+ STRING(REGEX REPLACE ".*\npykde_version_tag:([^\n]+).*$" "\\1" PYKDE4_VERSION_TAG ${pykde_config})
+ MESSAGE(STATUS "Found PyKDE4 version ${PYKDE4_VERSION_STR} ${PYKDE4_SIP_DIR}")
+
+ SET(PYKDE4_FOUND TRUE)
+
+ # PyKDE4 doesn't install pykdeuic4 when installing via CMake.
+ # Fortunately pykdeuic4 isn't needed by pate.
+ #
+ ## FIND_PROGRAM(PYKDE4_PYKDEUIC_EXE pykdeuic4 PATHS)# ${PYKDE4_BIN_DIR})
+ ## IF(NOT PYKDE4_PYKDEUIC_EXE)
+ ## MESSAGE(FATAL_ERROR "ERROR: Could not find pykdeuic4 (part of PyKDE4)")
+ ## ENDIF(NOT PYKDE4_PYKDEUIC_EXE)
+
+ ###########################################################################
+ # This comes mostly from KDE's FindKDE4Internal.cmake
+
+ macro(_SET_FANCY _var _value _comment)
+ set(predefinedvalue "${_value}")
+ if ("${CMAKE_INSTALL_PREFIX}" STREQUAL "${KDE4_INSTALL_DIR}" AND DEFINED KDE4_${_var})
+ set(predefinedvalue "${KDE4_${_var}}")
+ endif ("${CMAKE_INSTALL_PREFIX}" STREQUAL "${KDE4_INSTALL_DIR}" AND DEFINED KDE4_${_var})
+
+ if (NOT DEFINED ${_var})
+ set(${_var} ${predefinedvalue})
+ else (NOT DEFINED ${_var})
+ set(${_var} "${${_var}}" CACHE PATH "${_comment}")
+ endif (NOT DEFINED ${_var})
+ endmacro(_SET_FANCY)
+
+ if (WIN32)
+ # use relative install prefix to avoid hardcoded install pathes in cmake_install.cmake files
+ _set_fancy(EXEC_INSTALL_PREFIX "" "Base directory for executables and libraries")
+ _set_fancy(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share" "Base directory for files which go to share/")
+ _set_fancy(BIN_INSTALL_DIR "bin" "The install dir for executables (default ${EXEC_INSTALL_PREFIX}/bin)")
+ _set_fancy(SBIN_INSTALL_DIR "sbin" "The install dir for system executables (default ${EXEC_INSTALL_PREFIX}/sbin)")
+ else (WIN32)
+ _set_fancy(EXEC_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" "Base directory for executables and libraries")
+ _set_fancy(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share" "Base directory for files which go to share/")
+ _set_fancy(BIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/bin" "The install dir for executables (default ${EXEC_INSTALL_PREFIX}/bin)")
+ _set_fancy(SBIN_INSTALL_DIR "${EXEC_INSTALL_PREFIX}/sbin" "The install dir for system executables (default ${EXEC_INSTALL_PREFIX}/sbin)")
+ endif (WIN32)
+
+ _set_fancy(PLUGIN_INSTALL_DIR "${LIB_INSTALL_DIR}/kde4" "The subdirectory relative to the install prefix where plugins will be installed (default is ${LIB_INSTALL_DIR}/kde4)")
+ _set_fancy(CONFIG_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/config" "The config file install dir")
+ _set_fancy(DATA_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/apps" "The parent directory where applications can install their data")
+ _set_fancy(HTML_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/doc/HTML" "The HTML install dir for documentation")
+ _set_fancy(ICON_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/icons" "The icon install dir (default ${SHARE_INSTALL_PREFIX}/share/icons/)")
+ _set_fancy(KCFG_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/config.kcfg" "The install dir for kconfig files")
+ _set_fancy(LOCALE_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/locale" "The install dir for translations")
+ _set_fancy(MIME_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/mimelnk" "The install dir for the mimetype desktop files")
+ _set_fancy(SERVICES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/kde4/services" "The install dir for service (desktop, protocol, ...) files")
+ _set_fancy(SERVICETYPES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/kde4/servicetypes" "The install dir for servicestypes desktop files")
+ _set_fancy(SOUND_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/sounds" "The install dir for sound files")
+ _set_fancy(TEMPLATES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/templates" "The install dir for templates (Create new file...)")
+ _set_fancy(WALLPAPER_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/wallpapers" "The install dir for wallpapers")
+ _set_fancy(KCONF_UPDATE_INSTALL_DIR "${DATA_INSTALL_DIR}/kconf_update" "The kconf_update install dir")
+ # this one shouldn't be used anymore
+ _set_fancy(APPLNK_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/applnk" "Is this still used ?")
+ _set_fancy(AUTOSTART_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/autostart" "The install dir for autostart files")
+
+ _set_fancy(XDG_APPS_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/applications/kde4" "The XDG apps dir")
+ _set_fancy(XDG_DIRECTORY_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/desktop-directories" "The XDG directory")
+ _set_fancy(XDG_MIME_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/mime/packages" "The install dir for the xdg mimetypes")
+
+ _set_fancy(SYSCONF_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/etc" "The kde sysconfig install dir (default /etc)")
+ _set_fancy(MAN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/man" "The kde man install dir (default ${CMAKE_INSTALL_PREFIX}/man/)")
+ _set_fancy(INFO_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/info" "The kde info install dir (default ${CMAKE_INSTALL_PREFIX}/info)")
+ _set_fancy(DBUS_INTERFACES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/dbus-1/interfaces" "The kde dbus interfaces install dir (default ${SHARE_INSTALL_PREFIX}/dbus-1/interfaces)")
+ _set_fancy(DBUS_SERVICES_INSTALL_DIR "${SHARE_INSTALL_PREFIX}/dbus-1/services" "The kde dbus services install dir (default ${SHARE_INSTALL_PREFIX}/dbus-1/services)")
+
+ ENDIF(NOT pykde_config)
+ENDIF(PYTHONINTERP_FOUND)
+
+###########################################################################
+# PYKDE4_INSTALL_PYTHON_FILES(file_name...)
+#
+# Installs and bytes compiles Python files into the data directory for this
+# project..
+#
+MACRO(PYKDE4_INSTALL_PYTHON_FILES)
+
+ ADD_CUSTOM_TARGET(pysupport ALL)
+ FOREACH (_current_file ${ARGN})
+
+ # Install the source file.
+ INSTALL(FILES ${_current_file} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
+
+ # Byte compile and install the .pyc file.
+ GET_FILENAME_COMPONENT(_absfilename ${_current_file} ABSOLUTE)
+ GET_FILENAME_COMPONENT(_filename ${_current_file} NAME)
+ GET_FILENAME_COMPONENT(_filenamebase ${_current_file} NAME_WE)
+ GET_FILENAME_COMPONENT(_basepath ${_current_file} PATH)
+ SET(_bin_py ${CMAKE_BINARY_DIR}/${_basepath}/${_filename})
+ SET(_bin_pyc ${CMAKE_BINARY_DIR}/${_basepath}/${_filenamebase}.pyc)
+
+ FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_basepath})
+
+ SET(_message "-DMESSAGE=Byte-compiling ${_bin_py}")
+
+ GET_FILENAME_COMPONENT(_abs_bin_py ${_bin_py} ABSOLUTE)
+ IF(_abs_bin_py STREQUAL ${_absfilename}) # Don't copy the file onto itself.
+ ADD_CUSTOM_COMMAND(
+ TARGET pysupport
+ COMMAND ${CMAKE_COMMAND} -E echo ${message}
+ COMMAND ${PYTHON_EXECUTABLE} ${current_module_dir}/PythonCompile.py ${_bin_py}
+ DEPENDS ${_absfilename}
+ )
+ ELSE(_abs_bin_py STREQUAL ${_absfilename})
+ ADD_CUSTOM_COMMAND(
+ TARGET pysupport
+ COMMAND ${CMAKE_COMMAND} -E echo ${message}
+ COMMAND ${CMAKE_COMMAND} -E copy ${_absfilename} ${_bin_py}
+ COMMAND ${PYTHON_EXECUTABLE} ${current_module_dir}/PythonCompile.py ${_bin_py}
+ DEPENDS ${_absfilename}
+ )
+ ENDIF(_abs_bin_py STREQUAL ${_absfilename})
+
+ INSTALL(FILES ${_bin_pyc} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
+
+ ENDFOREACH (_current_file)
+ENDMACRO(PYKDE4_INSTALL_PYTHON_FILES)
+
+
+###########################################################################
+# PYKDE4_ADD_EXECUTABLE(py_name exe_name)
+#
+# Creates a smybolic link with name exe_name at install time from the
+# install bin directory to the Python file. The Python file is also make
+# executable.
+#
+MACRO(PYKDE4_ADD_EXECUTABLE _pyname _exename)
+ if(NOT PROJECT_NAME)
+ MESSAGE(STATUS "Project name is necessary to create symlink against python program!!! It will fail.")
+ endif(NOT PROJECT_NAME)
+ if(WIN32)
+ # we generate a batch file instead of a symlink. A windows link would only
+ # work if the file extension .py is associated with python - but that is
+ # not guaranteed.
+ # What if python.exe is not in PATH or points to a wrong python version?
+ # The python app should check for compatible versions at startup.
+ # TODO: we cannot attach an icon to a bat file. So we might have to write a
+ # C program which then calls python
+ FILE(TO_CMAKE_PATH "${BIN_INSTALL_DIR}/${_exename}.bat" LINK_NAME)
+ FILE(TO_CMAKE_PATH "${DATA_INSTALL_DIR}/${PROJECT_NAME}/${_pyname}" TARGET)
+ GET_FILENAME_COMPONENT(abs_link_name $ENV{DESTDIR}/${LINK_NAME} ABSOLUTE)
+ GET_FILENAME_COMPONENT(link_path $ENV{DESTDIR}/${LINK_NAME} PATH)
+ GET_FILENAME_COMPONENT(abs_link_path ${link_path} ABSOLUTE)
+ FILE(MAKE_DIRECTORY ${abs_link_path})
+
+ FILE(TO_NATIVE_PATH "../${TARGET}" rel_target)
+ FILE(WRITE ${abs_link_name} "rem this file has been generated by PYKDE4_ADD_EXECUTABLE\n")
+ FILE(APPEND ${abs_link_name} "python ${rel_target}\n")
+ INSTALL(PROGRAMS ${LINK_NAME} DESTINATION $ENV{DESTDIR}/${BIN_INSTALL_DIR})
+ else(WIN32)
+ INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -DTARGET=${DATA_INSTALL_DIR}/${PROJECT_NAME}/${_pyname} -DLINK_NAME=${BIN_INSTALL_DIR}/${_exename} -P ${current_module_dir}/create_exe_symlink.cmake)" )
+ endif(WIN32)
+ENDMACRO(PYKDE4_ADD_EXECUTABLE)
+
diff --git a/kdecore/cmake/modules/FindPyKDE4.py b/kdecore/cmake/modules/FindPyKDE4.py
new file mode 100644
index 0000000..e436c2a
--- /dev/null
+++ b/kdecore/cmake/modules/FindPyKDE4.py
@@ -0,0 +1,46 @@
+# By Simon Edwards <simon@simonzone.com>
+# modified by Paul Giannaros <paul@giannaros.org> to add better PyKDE4
+# sip directory finding
+# This file is in the public domain.
+
+import sys
+import os
+import PyKDE4.pykdeconfig
+import PyQt4.pyqtconfig
+
+if "_pkg_config" in dir(PyKDE4.pykdeconfig):
+ _pkg_config = PyKDE4.pykdeconfig._pkg_config
+
+ for varname in [
+ 'kde_version',
+ 'kde_version_extra',
+ 'kdebasedir',
+ 'kdeincdir',
+ 'kdelibdir',
+ 'libdir',
+ 'pykde_kde_sip_flags',
+ 'pykde_mod_dir',
+ 'pykde_modules',
+ 'pykde_sip_dir',
+ 'pykde_version',
+ 'pykde_version_str']:
+ varvalue = _pkg_config[varname]
+ if varname == 'pykde_sip_dir':
+ d = os.path.join(_pkg_config[varname], 'PyKDE4')
+ if os.path.exists(d):
+ varvalue = d
+ print("%s:%s\n" % (varname, varvalue))
+ pykde_version_tag = ''
+ in_t = False
+ for item in _pkg_config['pykde_kde_sip_flags'].split():
+ if item == "-t":
+ in_t = True
+ elif in_t:
+ if item.startswith("KDE_"):
+ pykde_version_tag = item
+ else:
+ in_t = False
+ print("pykde_version_tag:%s" % pykde_version_tag)
+
+else:
+ sys.exit(1)
diff --git a/kdecore/cmake/modules/FindPyQt.py b/kdecore/cmake/modules/FindPyQt.py
new file mode 100644
index 0000000..5d2f951
--- /dev/null
+++ b/kdecore/cmake/modules/FindPyQt.py
@@ -0,0 +1,24 @@
+# Copyright (c) 2007, Simon Edwards <simon@simonzone.com>
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+import PyQt4.pyqtconfig
+
+pyqtcfg = PyQt4.pyqtconfig.Configuration()
+print("pyqt_version:%06.0x" % pyqtcfg.pyqt_version)
+print("pyqt_version_str:%s" % pyqtcfg.pyqt_version_str)
+
+pyqt_version_tag = ""
+in_t = False
+for item in pyqtcfg.pyqt_sip_flags.split(' '):
+ if item=="-t":
+ in_t = True
+ elif in_t:
+ if item.startswith("Qt_4"):
+ pyqt_version_tag = item
+ else:
+ in_t = False
+print("pyqt_version_tag:%s" % pyqt_version_tag)
+
+print("pyqt_sip_dir:%s" % pyqtcfg.pyqt_sip_dir)
+print("pyqt_sip_flags:%s" % pyqtcfg.pyqt_sip_flags)
diff --git a/kdecore/cmake/modules/FindPyQt4.cmake b/kdecore/cmake/modules/FindPyQt4.cmake
new file mode 100644
index 0000000..37f645e
--- /dev/null
+++ b/kdecore/cmake/modules/FindPyQt4.cmake
@@ -0,0 +1,53 @@
+# Find PyQt4
+# ~~~~~~~~~~
+# Copyright (c) 2007-2008, Simon Edwards <simon@simonzone.com>
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+# PyQt4 website: http://www.riverbankcomputing.co.uk/pyqt/index.php
+#
+# Find the installed version of PyQt4. FindPyQt4 should only be called after
+# Python has been found.
+#
+# This file defines the following variables:
+#
+# PYQT4_VERSION - The version of PyQt4 found expressed as a 6 digit hex number
+# suitable for comparision as a string
+#
+# PYQT4_VERSION_STR - The version of PyQt4 as a human readable string.
+#
+# PYQT4_VERSION_TAG - The PyQt version tag using by PyQt's sip files.
+#
+# PYQT4_SIP_DIR - The directory holding the PyQt4 .sip files.
+#
+# PYQT4_SIP_FLAGS - The SIP flags used to build PyQt.
+
+IF(EXISTS PYQT4_VERSION)
+ # Already in cache, be silent
+ SET(PYQT4_FOUND TRUE)
+ELSE(EXISTS PYQT4_VERSION)
+
+ FIND_FILE(_find_pyqt_py FindPyQt.py PATHS ${CMAKE_MODULE_PATH})
+
+ EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_pyqt_py} OUTPUT_VARIABLE pyqt_config)
+ IF(pyqt_config)
+ STRING(REGEX REPLACE "^pyqt_version:([^\n]+).*$" "\\1" PYQT4_VERSION ${pyqt_config})
+ STRING(REGEX REPLACE ".*\npyqt_version_str:([^\n]+).*$" "\\1" PYQT4_VERSION_STR ${pyqt_config})
+ STRING(REGEX REPLACE ".*\npyqt_version_tag:([^\n]+).*$" "\\1" PYQT4_VERSION_TAG ${pyqt_config})
+ STRING(REGEX REPLACE ".*\npyqt_sip_dir:([^\n]+).*$" "\\1" PYQT4_SIP_DIR ${pyqt_config})
+ STRING(REGEX REPLACE ".*\npyqt_sip_flags:([^\n]+).*$" "\\1" PYQT4_SIP_FLAGS ${pyqt_config})
+
+ SET(PYQT4_FOUND TRUE)
+ ENDIF(pyqt_config)
+
+ IF(PYQT4_FOUND)
+ IF(NOT PYQT4_FIND_QUIETLY)
+ MESSAGE(STATUS "Found PyQt4 version: ${PYQT4_VERSION_STR}")
+ ENDIF(NOT PYQT4_FIND_QUIETLY)
+ ELSE(PYQT4_FOUND)
+ IF(PYQT4_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find Python")
+ ENDIF(PYQT4_FIND_REQUIRED)
+ ENDIF(PYQT4_FOUND)
+
+ENDIF(EXISTS PYQT4_VERSION)
diff --git a/kdecore/cmake/modules/FindPythonLibrary.cmake b/kdecore/cmake/modules/FindPythonLibrary.cmake
new file mode 100644
index 0000000..60567e2
--- /dev/null
+++ b/kdecore/cmake/modules/FindPythonLibrary.cmake
@@ -0,0 +1,106 @@
+# Find Python
+# ~~~~~~~~~~~
+# Find the Python interpreter and related Python directories.
+#
+# This file defines the following variables:
+#
+# PYTHON_EXECUTABLE - The path and filename of the Python interpreter.
+#
+# PYTHON_SHORT_VERSION - The version of the Python interpreter found,
+# excluding the patch version number. (e.g. 2.5 and not 2.5.1))
+#
+# PYTHON_LONG_VERSION - The version of the Python interpreter found as a human
+# readable string.
+#
+# PYTHON_SITE_PACKAGES_INSTALL_DIR - this cache variable can be used for installing
+# own python modules. You may want to adjust this to be the
+# same as ${PYTHON_SITE_PACKAGES_DIR}, but then admin
+# privileges may be required for installation.
+#
+# PYTHON_SITE_PACKAGES_DIR - Location of the Python site-packages directory.
+#
+# PYTHON_INCLUDE_PATH - Directory holding the python.h include file.
+#
+# PYTHON_LIBRARY, PYTHON_LIBRARIES- Location of the Python library.
+
+# Copyright (c) 2007, Simon Edwards <simon@simonzone.com>
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+
+include(CMakeFindFrameworks)
+
+if(EXISTS PYTHON_LIBRARY)
+ # Already in cache, be silent
+ set(PYTHONLIBRARY_FOUND TRUE)
+else(EXISTS PYTHON_LIBRARY)
+
+ find_package(PythonInterp)
+
+ if(PYTHONINTERP_FOUND)
+
+ # get the directory of the current file, used later on in the file
+ get_filename_component( _py_cmake_module_dir ${CMAKE_CURRENT_LIST_FILE} PATH)
+ if(NOT EXISTS "${_py_cmake_module_dir}/FindLibPython.py")
+ message(FATAL_ERROR "The file FindLibPython.py does not exist in ${_py_cmake_module_dir} (the directory where FindPythonLibrary.cmake is located). Check your installation.")
+ endif(NOT EXISTS "${_py_cmake_module_dir}/FindLibPython.py")
+
+ execute_process(COMMAND ${PYTHON_EXECUTABLE} "${_py_cmake_module_dir}/FindLibPython.py" OUTPUT_VARIABLE python_config)
+ if(python_config)
+ string(REGEX REPLACE ".*exec_prefix:([^\n]+).*$" "\\1" PYTHON_PREFIX ${python_config})
+ string(REGEX REPLACE ".*\nshort_version:([^\n]+).*$" "\\1" PYTHON_SHORT_VERSION ${python_config})
+ string(REGEX REPLACE ".*\nlong_version:([^\n]+).*$" "\\1" PYTHON_LONG_VERSION ${python_config})
+
+ string(REGEX REPLACE ".*\npy_inc_dir:([^\n]+).*$" "\\1" _TMP_PYTHON_INCLUDE_PATH ${python_config})
+ string(REGEX REPLACE ".*\nsite_packages_dir:([^\n]+).*$" "\\1" _TMP_PYTHON_SITE_PACKAGES_DIR ${python_config})
+
+ # Put these two variables in the cache so they are visible for the user, but read-only:
+ set(PYTHON_INCLUDE_PATH "${_TMP_PYTHON_INCLUDE_PATH}" CACHE PATH "The python include directory" FORCE)
+ set(PYTHON_SITE_PACKAGES_DIR "${_TMP_PYTHON_SITE_PACKAGES_DIR}" CACHE PATH "The python site packages dir" FORCE)
+
+ # This one is intended to be used and changed by the user for installing own modules:
+ set(PYTHON_SITE_PACKAGES_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/python${PYTHON_SHORT_VERSION}/site-packages CACHE PATH "The directory where python modules will be installed to.")
+
+ string(REGEX REPLACE "([0-9]+).([0-9]+)" "\\1\\2" PYTHON_SHORT_VERSION_NO_DOT ${PYTHON_SHORT_VERSION})
+ set(PYTHON_LIBRARY_NAMES python${PYTHON_SHORT_VERSION} python${PYTHON_SHORT_VERSION_NO_DOT})
+ if(WIN32)
+ string(REPLACE "\\" "/" PYTHON_SITE_PACKAGES_DIR ${PYTHON_SITE_PACKAGES_DIR})
+ endif(WIN32)
+ find_library(PYTHON_LIBRARY NAMES ${PYTHON_LIBRARY_NAMES} PATHS ${PYTHON_PREFIX}/lib ${PYTHON_PREFIX}/libs NO_DEFAULT_PATH)
+ set(PYTHONLIBRARY_FOUND TRUE)
+ endif(python_config)
+
+ # adapted from cmake's builtin FindPythonLibs
+ if(APPLE)
+ cmake_find_frameworks(Python)
+ set(PYTHON_FRAMEWORK_INCLUDES)
+ if(Python_FRAMEWORKS)
+ # If a framework has been selected for the include path,
+ # make sure "-framework" is used to link it.
+ if("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework")
+ set(PYTHON_LIBRARY "")
+ set(PYTHON_DEBUG_LIBRARY "")
+ endif("${PYTHON_INCLUDE_PATH}" MATCHES "Python\\.framework")
+ if(NOT PYTHON_LIBRARY)
+ set (PYTHON_LIBRARY "-framework Python" CACHE FILEPATH "Python Framework" FORCE)
+ endif(NOT PYTHON_LIBRARY)
+ set(PYTHONLIBRARY_FOUND TRUE)
+ endif(Python_FRAMEWORKS)
+ endif(APPLE)
+ endif(PYTHONINTERP_FOUND)
+
+ if(PYTHONLIBRARY_FOUND)
+ set(PYTHON_LIBRARIES ${PYTHON_LIBRARY})
+ if(NOT PYTHONLIBRARY_FIND_QUIETLY)
+ message(STATUS "Found Python executable: ${PYTHON_EXECUTABLE}")
+ message(STATUS "Found Python version: ${PYTHON_LONG_VERSION}")
+ message(STATUS "Found Python library: ${PYTHON_LIBRARY}")
+ endif(NOT PYTHONLIBRARY_FIND_QUIETLY)
+ else(PYTHONLIBRARY_FOUND)
+ if(PYTHONLIBRARY_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find Python")
+ endif(PYTHONLIBRARY_FIND_REQUIRED)
+ endif(PYTHONLIBRARY_FOUND)
+
+endif (EXISTS PYTHON_LIBRARY)
diff --git a/kdecore/cmake/modules/FindQCA2.cmake b/kdecore/cmake/modules/FindQCA2.cmake
new file mode 100644
index 0000000..e2d8f2a
--- /dev/null
+++ b/kdecore/cmake/modules/FindQCA2.cmake
@@ -0,0 +1,48 @@
+# - Try to find QCA2 (Qt Cryptography Architecture 2)
+# Once done this will define
+#
+# QCA2_FOUND - system has QCA2
+# QCA2_INCLUDE_DIR - the QCA2 include directory
+# QCA2_LIBRARIES - the libraries needed to use QCA2
+# QCA2_DEFINITIONS - Compiler switches required for using QCA2
+#
+# use pkg-config to get the directories and then use these values
+# in the FIND_PATH() and FIND_LIBRARY() calls
+
+# Copyright (c) 2006, Michael Larouche, <michael.larouche@kdemail.net>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+include(FindLibraryWithDebug)
+
+if (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
+
+ # in cache already
+ set(QCA2_FOUND TRUE)
+
+else (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
+
+
+ if (NOT WIN32)
+ find_package(PkgConfig)
+ pkg_check_modules(PC_QCA2 QUIET qca2)
+ set(QCA2_DEFINITIONS ${PC_QCA2_CFLAGS_OTHER})
+ endif (NOT WIN32)
+
+ find_library_with_debug(QCA2_LIBRARIES
+ WIN32_DEBUG_POSTFIX d
+ NAMES qca
+ HINTS ${PC_QCA2_LIBDIR} ${PC_QCA2_LIBRARY_DIRS}
+ )
+
+ find_path(QCA2_INCLUDE_DIR QtCrypto
+ HINTS ${PC_QCA2_INCLUDEDIR} ${PC_QCA2_INCLUDE_DIRS}
+ PATH_SUFFIXES QtCrypto)
+
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(QCA2 DEFAULT_MSG QCA2_LIBRARIES QCA2_INCLUDE_DIR)
+
+ mark_as_advanced(QCA2_INCLUDE_DIR QCA2_LIBRARIES)
+
+endif (QCA2_INCLUDE_DIR AND QCA2_LIBRARIES)
diff --git a/kdecore/cmake/modules/FindQImageBlitz.cmake b/kdecore/cmake/modules/FindQImageBlitz.cmake
new file mode 100644
index 0000000..1b34741
--- /dev/null
+++ b/kdecore/cmake/modules/FindQImageBlitz.cmake
@@ -0,0 +1,51 @@
+# - Try to find the qimageblitz lib
+# Once done this will define
+#
+# QIMAGEBLITZ_FOUND - system has qimageblitz lib
+# QIMAGEBLITZ_INCLUDES - the qimageblitz include directory
+# QIMAGEBLITZ_LIBRARIES - The libraries needed to use qimageblitz
+
+# Copyright (c) 2006, Montel Laurent, <montel@kde.org>
+# Copyright (c) 2007, Allen Winter, <winter@kde.org>
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+include(FindLibraryWithDebug)
+
+if (QIMAGEBLITZ_INCLUDES AND QIMAGEBLITZ_LIBRARIES)
+ set(QImageBlitz_FIND_QUIETLY TRUE)
+endif (QIMAGEBLITZ_INCLUDES AND QIMAGEBLITZ_LIBRARIES)
+
+if (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ find_package(PkgConfig)
+ pkg_check_modules(PC_QIMAGEBLITZ QUIET qimageblitz)
+endif (NOT WIN32)
+
+find_path(QIMAGEBLITZ_INCLUDES
+ NAMES
+ qimageblitz.h
+ PATH_SUFFIXES qimageblitz
+ HINTS
+ $ENV{QIMAGEBLITZDIR}/include
+ ${PC_QIMAGEBLITZ_INCLUDEDIR}
+ ${KDE4_INCLUDE_DIR}
+ ${INCLUDE_INSTALL_DIR}
+)
+
+find_library_with_debug(QIMAGEBLITZ_LIBRARIES
+ WIN32_DEBUG_POSTFIX d
+ qimageblitz
+ HINTS
+ $ENV{QIMAGEBLITZDIR}/lib
+ ${PC_QIMAGEBLITZ_LIBDIR}
+ ${KDE4_LIB_DIR}
+ ${LIB_INSTALL_DIR}
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(QImageBlitz DEFAULT_MSG
+ QIMAGEBLITZ_INCLUDES QIMAGEBLITZ_LIBRARIES)
+
+mark_as_advanced(QIMAGEBLITZ_INCLUDES QIMAGEBLITZ_LIBRARIES)
diff --git a/kdecore/cmake/modules/FindQt4.cmake b/kdecore/cmake/modules/FindQt4.cmake
new file mode 100644
index 0000000..f482d3c
--- /dev/null
+++ b/kdecore/cmake/modules/FindQt4.cmake
@@ -0,0 +1,1272 @@
+# - Find QT 4
+# This module can be used to find Qt4.
+# The most important issue is that the Qt4 qmake is available via the system path.
+# This qmake is then used to detect basically everything else.
+# This module defines a number of key variables and macros.
+# The variable QT_USE_FILE is set which is the path to a CMake file that can be included
+# to compile Qt 4 applications and libraries. It sets up the compilation
+# environment for include directories, preprocessor defines and populates a
+# QT_LIBRARIES variable.
+#
+# Typical usage could be something like:
+# find_package(Qt4 4.4.3 COMPONENTS QtCore QtGui QtXml REQUIRED )
+# include(${QT_USE_FILE})
+# add_executable(myexe main.cpp)
+# target_link_libraries(myexe ${QT_LIBRARIES})
+#
+# The minimum required version can be specified using the standard find_package()-syntax
+# (see example above).
+# For compatibility with older versions of FindQt4.cmake it is also possible to
+# set the variable QT_MIN_VERSION to the minimum required version of Qt4 before the
+# find_package(Qt4) command.
+# If both are used, the version used in the find_package() command overrides the
+# one from QT_MIN_VERSION.
+#
+# When using the components argument, QT_USE_QT* variables are automatically set
+# for the QT_USE_FILE to pick up. If one wishes to manually set them, the
+# available ones to set include:
+# QT_DONT_USE_QTCORE
+# QT_DONT_USE_QTGUI
+# QT_USE_QT3SUPPORT
+# QT_USE_QTASSISTANT
+# QT_USE_QAXCONTAINER
+# QT_USE_QAXSERVER
+# QT_USE_QTDESIGNER
+# QT_USE_QTMOTIF
+# QT_USE_QTMAIN
+# QT_USE_QTMULTIMEDIA
+# QT_USE_QTNETWORK
+# QT_USE_QTNSPLUGIN
+# QT_USE_QTOPENGL
+# QT_USE_QTSQL
+# QT_USE_QTXML
+# QT_USE_QTSVG
+# QT_USE_QTTEST
+# QT_USE_QTUITOOLS
+# QT_USE_QTDBUS
+# QT_USE_QTSCRIPT
+# QT_USE_QTASSISTANTCLIENT
+# QT_USE_QTHELP
+# QT_USE_QTWEBKIT
+# QT_USE_QTXMLPATTERNS
+# QT_USE_PHONON
+# QT_USE_QTSCRIPTTOOLS
+# QT_USE_QTDECLARATIVE
+#
+# QT_USE_IMPORTED_TARGETS
+# If this variable is set to TRUE, FindQt4.cmake will create imported
+# library targets for the various Qt libraries and set the
+# library variables like QT_QTCORE_LIBRARY to point at these imported
+# targets instead of the library file on disk. This provides much better
+# handling of the release and debug versions of the Qt libraries and is
+# also always backwards compatible, except for the case that dependencies
+# of libraries are exported, these will then also list the names of the
+# imported targets as dependency and not the file location on disk. This
+# is much more flexible, but requires that FindQt4.cmake is executed before
+# such an exported dependency file is processed.
+#
+# There are also some files that need processing by some Qt tools such as moc
+# and uic. Listed below are macros that may be used to process those files.
+#
+# macro QT4_WRAP_CPP(outfiles inputfile ... OPTIONS ...)
+# create moc code from a list of files containing Qt class with
+# the Q_OBJECT declaration. Per-direcotry preprocessor definitions
+# are also added. Options may be given to moc, such as those found
+# when executing "moc -help".
+#
+# macro QT4_WRAP_UI(outfiles inputfile ... OPTIONS ...)
+# create code from a list of Qt designer ui files.
+# Options may be given to uic, such as those found
+# when executing "uic -help"
+#
+# macro QT4_ADD_RESOURCES(outfiles inputfile ... OPTIONS ...)
+# create code from a list of Qt resource files.
+# Options may be given to rcc, such as those found
+# when executing "rcc -help"
+#
+# macro QT4_GENERATE_MOC(inputfile outputfile )
+# creates a rule to run moc on infile and create outfile.
+# Use this if for some reason QT4_WRAP_CPP() isn't appropriate, e.g.
+# because you need a custom filename for the moc file or something similar.
+#
+# macro QT4_AUTOMOC(sourcefile1 sourcefile2 ... )
+# This macro is still experimental.
+# It can be used to have moc automatically handled.
+# So if you have the files foo.h and foo.cpp, and in foo.h a
+# a class uses the Q_OBJECT macro, moc has to run on it. If you don't
+# want to use QT4_WRAP_CPP() (which is reliable and mature), you can insert
+# #include "foo.moc"
+# in foo.cpp and then give foo.cpp as argument to QT4_AUTOMOC(). This will the
+# scan all listed files at cmake-time for such included moc files and if it finds
+# them cause a rule to be generated to run moc at build time on the
+# accompanying header file foo.h.
+# If a source file has the SKIP_AUTOMOC property set it will be ignored by this macro.
+#
+# macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename)
+# create a the interface header and implementation files with the
+# given basename from the given interface xml file and add it to
+# the list of sources.
+# To disable generating a namespace header, set the source file property
+# NO_NAMESPACE to TRUE on the interface file.
+# To include a header in the interface header, set the source file property
+# INCLUDE to the name of the header.
+# To specify a class name to use, set the source file property CLASSNAME
+# to the name of the class.
+#
+# macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... )
+# create the interface header and implementation files
+# for all listed interface xml files
+# the name will be automatically determined from the name of the xml file
+# To disable generating namespace headers, set the source file property
+# NO_NAMESPACE to TRUE for these inputfiles.
+# To include a header in the interface header, set the source file property
+# INCLUDE to the name of the header.
+# To specify a class name to use, set the source file property CLASSNAME
+# to the name of the class.
+#
+# macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname [basename] [classname])
+# create a dbus adaptor (header and implementation file) from the xml file
+# describing the interface, and add it to the list of sources. The adaptor
+# forwards the calls to a parent class, defined in parentheader and named
+# parentclassname. The name of the generated files will be
+# <basename>adaptor.{cpp,h} where basename defaults to the basename of the xml file.
+# If <classname> is provided, then it will be used as the classname of the
+# adaptor itself.
+#
+# macro QT4_GENERATE_DBUS_INTERFACE( header [interfacename] OPTIONS ...)
+# generate the xml interface file from the given header.
+# If the optional argument interfacename is omitted, the name of the
+# interface file is constructed from the basename of the header with
+# the suffix .xml appended.
+# Options may be given to qdbuscpp2xml, such as those found when executing "qdbuscpp2xml --help"
+#
+# macro QT4_CREATE_TRANSLATION( qm_files directories ... sources ...
+# ts_files ... OPTIONS ...)
+# out: qm_files
+# in: directories sources ts_files
+# options: flags to pass to lupdate, such as -extensions to specify
+# extensions for a directory scan.
+# generates commands to create .ts (vie lupdate) and .qm
+# (via lrelease) - files from directories and/or sources. The ts files are
+# created and/or updated in the source tree (unless given with full paths).
+# The qm files are generated in the build tree.
+# Updating the translations can be done by adding the qm_files
+# to the source list of your library/executable, so they are
+# always updated, or by adding a custom target to control when
+# they get updated/generated.
+#
+# macro QT4_ADD_TRANSLATION( qm_files ts_files ... )
+# out: qm_files
+# in: ts_files
+# generates commands to create .qm from .ts - files. The generated
+# filenames can be found in qm_files. The ts_files
+# must exists and are not updated in any way.
+#
+#
+# Below is a detailed list of variables that FindQt4.cmake sets.
+# QT_FOUND If false, don't try to use Qt.
+# QT4_FOUND If false, don't try to use Qt 4.
+#
+# QT_VERSION_MAJOR The major version of Qt found.
+# QT_VERSION_MINOR The minor version of Qt found.
+# QT_VERSION_PATCH The patch version of Qt found.
+#
+# QT_EDITION Set to the edition of Qt (i.e. DesktopLight)
+# QT_EDITION_DESKTOPLIGHT True if QT_EDITION == DesktopLight
+# QT_QTCORE_FOUND True if QtCore was found.
+# QT_QTGUI_FOUND True if QtGui was found.
+# QT_QT3SUPPORT_FOUND True if Qt3Support was found.
+# QT_QTASSISTANT_FOUND True if QtAssistant was found.
+# QT_QTASSISTANTCLIENT_FOUND True if QtAssistantClient was found.
+# QT_QAXCONTAINER_FOUND True if QAxContainer was found (Windows only).
+# QT_QAXSERVER_FOUND True if QAxServer was found (Windows only).
+# QT_QTDBUS_FOUND True if QtDBus was found.
+# QT_QTDESIGNER_FOUND True if QtDesigner was found.
+# QT_QTDESIGNERCOMPONENTS True if QtDesignerComponents was found.
+# QT_QTHELP_FOUND True if QtHelp was found.
+# QT_QTMOTIF_FOUND True if QtMotif was found.
+# QT_QTMULTIMEDIA_FOUND True if QtMultimedia was found (since Qt 4.6.0).
+# QT_QTNETWORK_FOUND True if QtNetwork was found.
+# QT_QTNSPLUGIN_FOUND True if QtNsPlugin was found.
+# QT_QTOPENGL_FOUND True if QtOpenGL was found.
+# QT_QTSQL_FOUND True if QtSql was found.
+# QT_QTSVG_FOUND True if QtSvg was found.
+# QT_QTSCRIPT_FOUND True if QtScript was found.
+# QT_QTSCRIPTTOOLS_FOUND True if QtScriptTools was found.
+# QT_QTTEST_FOUND True if QtTest was found.
+# QT_QTUITOOLS_FOUND True if QtUiTools was found.
+# QT_QTWEBKIT_FOUND True if QtWebKit was found.
+# QT_QTXML_FOUND True if QtXml was found.
+# QT_QTXMLPATTERNS_FOUND True if QtXmlPatterns was found.
+# QT_PHONON_FOUND True if phonon was found.
+# QT_QTDECLARATIVE_FOUND True if QtDeclarative was found.
+#
+# QT_MAC_USE_COCOA For Mac OS X, its whether Cocoa or Carbon is used.
+# In general, this should not be used, but its useful
+# when having platform specific code.
+#
+# QT_DEFINITIONS Definitions to use when compiling code that uses Qt.
+# You do not need to use this if you include QT_USE_FILE.
+# The QT_USE_FILE will also define QT_DEBUG and QT_NO_DEBUG
+# to fit your current build type. Those are not contained
+# in QT_DEFINITIONS.
+#
+# QT_INCLUDES List of paths to all include directories of
+# Qt4 QT_INCLUDE_DIR and QT_QTCORE_INCLUDE_DIR are
+# always in this variable even if NOTFOUND,
+# all other INCLUDE_DIRS are
+# only added if they are found.
+# You do not need to use this if you include QT_USE_FILE.
+#
+#
+# Include directories for the Qt modules are listed here.
+# You do not need to use these variables if you include QT_USE_FILE.
+#
+# QT_INCLUDE_DIR Path to "include" of Qt4
+# QT_QT_INCLUDE_DIR Path to "include/Qt"
+# QT_QT3SUPPORT_INCLUDE_DIR Path to "include/Qt3Support"
+# QT_QTASSISTANT_INCLUDE_DIR Path to "include/QtAssistant"
+# QT_QTASSISTANTCLIENT_INCLUDE_DIR Path to "include/QtAssistant"
+# QT_QAXCONTAINER_INCLUDE_DIR Path to "include/ActiveQt" (Windows only)
+# QT_QAXSERVER_INCLUDE_DIR Path to "include/ActiveQt" (Windows only)
+# QT_QTCORE_INCLUDE_DIR Path to "include/QtCore"
+# QT_QTDBUS_INCLUDE_DIR Path to "include/QtDBus"
+# QT_QTDESIGNER_INCLUDE_DIR Path to "include/QtDesigner"
+# QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR Path to "include/QtDesigner"
+# QT_QTGUI_INCLUDE_DIR Path to "include/QtGui"
+# QT_QTHELP_INCLUDE_DIR Path to "include/QtHelp"
+# QT_QTMOTIF_INCLUDE_DIR Path to "include/QtMotif"
+# QT_QTMULTIMEDIA_INCLUDE_DIR Path to "include/QtMultimedia"
+# QT_QTNETWORK_INCLUDE_DIR Path to "include/QtNetwork"
+# QT_QTNSPLUGIN_INCLUDE_DIR Path to "include/QtNsPlugin"
+# QT_QTOPENGL_INCLUDE_DIR Path to "include/QtOpenGL"
+# QT_QTSCRIPT_INCLUDE_DIR Path to "include/QtScript"
+# QT_QTSQL_INCLUDE_DIR Path to "include/QtSql"
+# QT_QTSVG_INCLUDE_DIR Path to "include/QtSvg"
+# QT_QTTEST_INCLUDE_DIR Path to "include/QtTest"
+# QT_QTWEBKIT_INCLUDE_DIR Path to "include/QtWebKit"
+# QT_QTXML_INCLUDE_DIR Path to "include/QtXml"
+# QT_QTXMLPATTERNS_INCLUDE_DIR Path to "include/QtXmlPatterns"
+# QT_PHONON_INCLUDE_DIR Path to "include/phonon"
+# QT_QTSCRIPTTOOLS_INCLUDE_DIR Path to "include/QtScriptTools"
+# QT_QTDECLARATIVE_INCLUDE_DIR Path to "include/QtDeclarative"
+#
+# QT_BINARY_DIR Path to "bin" of Qt4
+# QT_LIBRARY_DIR Path to "lib" of Qt4
+# QT_PLUGINS_DIR Path to "plugins" for Qt4
+# QT_TRANSLATIONS_DIR Path to "translations" of Qt4
+# QT_IMPORTS_DIR Path to "imports" of Qt4
+# QT_DOC_DIR Path to "doc" of Qt4
+# QT_MKSPECS_DIR Path to "mkspecs" of Qt4
+#
+#
+# For every library of Qt, a QT_QTFOO_LIBRARY variable is defined, with the full path to the library.
+#
+# So there are the following variables:
+# The Qt3Support library: QT_QT3SUPPORT_LIBRARY
+#
+# The QtAssistant library: QT_QTASSISTANT_LIBRARY
+#
+# The QtAssistantClient library: QT_QTASSISTANTCLIENT_LIBRARY
+#
+# The QAxServer library: QT_QAXSERVER_LIBRARY
+#
+# The QAxContainer library: QT_QAXCONTAINER_LIBRARY
+#
+# The QtCore library: QT_QTCORE_LIBRARY
+#
+# The QtDBus library: QT_QTDBUS_LIBRARY
+#
+# The QtDesigner library: QT_QTDESIGNER_LIBRARY
+#
+# The QtDesignerComponents library: QT_QTDESIGNERCOMPONENTS_LIBRARY
+#
+# The QtGui library: QT_QTGUI_LIBRARY
+#
+# The QtHelp library: QT_QTHELP_LIBRARY
+#
+# The QtMotif library: QT_QTMOTIF_LIBRARY
+#
+# The QtMultimedia library: QT_QTMULTIMEDIA_LIBRARY
+#
+# The QtNetwork library: QT_QTNETWORK_LIBRARY
+#
+# The QtNsPLugin library: QT_QTNSPLUGIN_LIBRARY
+#
+# The QtOpenGL library: QT_QTOPENGL_LIBRARY
+#
+# The QtScript library: QT_QTSCRIPT_LIBRARY
+#
+# The QtScriptTools library: QT_QTSCRIPTTOOLS_LIBRARY
+#
+# The QtSql library: QT_QTSQL_LIBRARY
+#
+# The QtSvg library: QT_QTSVG_LIBRARY
+#
+# The QtTest library: QT_QTTEST_LIBRARY
+#
+# The QtUiTools library: QT_QTUITOOLS_LIBRARY
+#
+# The QtWebKit library: QT_QTWEBKIT_LIBRARY
+#
+# The QtXml library: QT_QTXML_LIBRARY
+#
+# The QtXmlPatterns library: QT_QTXMLPATTERNS_LIBRARY
+#
+# The qtmain library for Windows QT_QTMAIN_LIBRARY
+#
+# The Phonon library: QT_PHONON_LIBRARY
+#
+# The QtDeclarative library: QT_QTDECLARATIVE_LIBRARY
+#
+# also defined, but NOT for general use are
+# QT_MOC_EXECUTABLE Where to find the moc tool.
+# QT_UIC_EXECUTABLE Where to find the uic tool.
+# QT_UIC3_EXECUTABLE Where to find the uic3 tool.
+# QT_RCC_EXECUTABLE Where to find the rcc tool
+# QT_DBUSCPP2XML_EXECUTABLE Where to find the qdbuscpp2xml tool.
+# QT_DBUSXML2CPP_EXECUTABLE Where to find the qdbusxml2cpp tool.
+# QT_LUPDATE_EXECUTABLE Where to find the lupdate tool.
+# QT_LRELEASE_EXECUTABLE Where to find the lrelease tool.
+# QT_QCOLLECTIONGENERATOR_EXECUTABLE Where to find the qcollectiongenerator tool.
+# QT_DESIGNER_EXECUTABLE Where to find the Qt designer tool.
+# QT_LINGUIST_EXECUTABLE Where to find the Qt linguist tool.
+#
+#
+# These are around for backwards compatibility
+# they will be set
+# QT_WRAP_CPP Set true if QT_MOC_EXECUTABLE is found
+# QT_WRAP_UI Set true if QT_UIC_EXECUTABLE is found
+#
+# These variables do _NOT_ have any effect anymore (compared to FindQt.cmake)
+# QT_MT_REQUIRED Qt4 is now always multithreaded
+#
+# These variables are set to "" Because Qt structure changed
+# (They make no sense in Qt4)
+# QT_QT_LIBRARY Qt-Library is now split
+
+# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
+# See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
+
+# Use FIND_PACKAGE( Qt4 COMPONENTS ... ) to enable modules
+IF( Qt4_FIND_COMPONENTS )
+ FOREACH( component ${Qt4_FIND_COMPONENTS} )
+ STRING( TOUPPER ${component} _COMPONENT )
+ SET( QT_USE_${_COMPONENT} 1 )
+ ENDFOREACH( component )
+
+ # To make sure we don't use QtCore or QtGui when not in COMPONENTS
+ IF(NOT QT_USE_QTCORE)
+ SET( QT_DONT_USE_QTCORE 1 )
+ ENDIF(NOT QT_USE_QTCORE)
+
+ IF(NOT QT_USE_QTGUI)
+ SET( QT_DONT_USE_QTGUI 1 )
+ ENDIF(NOT QT_USE_QTGUI)
+
+ENDIF( Qt4_FIND_COMPONENTS )
+
+# If Qt3 has already been found, fail.
+IF(QT_QT_LIBRARY)
+ IF(Qt4_FIND_REQUIRED)
+ MESSAGE( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project. If switching to Qt4, the CMakeCache.txt needs to be cleaned.")
+ ELSE(Qt4_FIND_REQUIRED)
+ IF(NOT Qt4_FIND_QUIETLY)
+ MESSAGE( STATUS "Qt3 and Qt4 cannot be used together in one project. If switching to Qt4, the CMakeCache.txt needs to be cleaned.")
+ ENDIF(NOT Qt4_FIND_QUIETLY)
+ RETURN()
+ ENDIF(Qt4_FIND_REQUIRED)
+ENDIF(QT_QT_LIBRARY)
+
+function(_QT4_QUERY_QMAKE VAR RESULT)
+ exec_program(${QT_QMAKE_EXECUTABLE} ARGS "-query ${VAR}" RETURN_VALUE return_code OUTPUT_VARIABLE output )
+ if(NOT return_code)
+ file(TO_CMAKE_PATH "${output}" output)
+ set(${RESULT} ${output} PARENT_SCOPE)
+ endif(NOT return_code)
+endfunction(_QT4_QUERY_QMAKE)
+
+
+IF (QT4_QMAKE_FOUND AND Qt4::QtCore)
+ # Check already done in this cmake run, nothing more to do
+ RETURN()
+ENDIF (QT4_QMAKE_FOUND AND Qt4::QtCore)
+
+# check that QT_NO_DEBUG is defined for release configurations
+MACRO(QT_CHECK_FLAG_EXISTS FLAG VAR DOC)
+ IF(NOT ${VAR} MATCHES "${FLAG}")
+ SET(${VAR} "${${VAR}} ${FLAG}"
+ CACHE STRING "Flags used by the compiler during ${DOC} builds." FORCE)
+ ENDIF(NOT ${VAR} MATCHES "${FLAG}")
+ENDMACRO(QT_CHECK_FLAG_EXISTS FLAG VAR)
+
+QT_CHECK_FLAG_EXISTS(-DQT_NO_DEBUG CMAKE_CXX_FLAGS_RELWITHDEBINFO "Release with Debug Info")
+QT_CHECK_FLAG_EXISTS(-DQT_NO_DEBUG CMAKE_CXX_FLAGS_RELEASE "release")
+QT_CHECK_FLAG_EXISTS(-DQT_NO_DEBUG CMAKE_CXX_FLAGS_MINSIZEREL "release minsize")
+
+INCLUDE(MacroPushRequiredVars)
+INCLUDE(CheckSymbolExists)
+INCLUDE(MacroAddFileDependencies)
+
+SET(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
+
+SET( QT_DEFINITIONS "")
+
+SET(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
+
+# macro for asking qmake to process pro files
+MACRO(QT_QUERY_QMAKE outvar invar)
+ IF(QT_QMAKE_EXECUTABLE)
+ FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake/tmp.pro
+ "message(CMAKE_MESSAGE<$$${invar}>)")
+
+ # Invoke qmake with the tmp.pro program to get the desired
+ # information. Use the same variable for both stdout and stderr
+ # to make sure we get the output on all platforms.
+ EXECUTE_PROCESS(COMMAND ${QT_QMAKE_EXECUTABLE}
+ WORKING_DIRECTORY
+ ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake
+ OUTPUT_VARIABLE _qmake_query_output
+ RESULT_VARIABLE _qmake_result
+ ERROR_VARIABLE _qmake_query_output )
+
+ FILE(REMOVE_RECURSE
+ "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmpQmake")
+
+ IF(_qmake_result)
+ MESSAGE(WARNING " querying qmake for ${invar}. qmake reported:\n${_qmake_query_output}")
+ ELSE(_qmake_result)
+ STRING(REGEX REPLACE ".*CMAKE_MESSAGE<([^>]*).*" "\\1" ${outvar} "${_qmake_query_output}")
+ ENDIF(_qmake_result)
+
+ ENDIF(QT_QMAKE_EXECUTABLE)
+ENDMACRO(QT_QUERY_QMAKE)
+
+GET_FILENAME_COMPONENT(qt_install_version "[HKEY_CURRENT_USER\\Software\\trolltech\\Versions;DefaultQtVersion]" NAME)
+# check for qmake
+# Debian uses qmake-qt4
+# macports' Qt uses qmake-mac
+FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac PATHS
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]/bin"
+ $ENV{QTDIR}/bin
+ DOC "The qmake executable for the Qt installation to use"
+)
+
+IF (QT_QMAKE_EXECUTABLE)
+
+ IF(QT_QMAKE_EXECUTABLE_LAST)
+ STRING(COMPARE NOTEQUAL "${QT_QMAKE_EXECUTABLE_LAST}" "${QT_QMAKE_EXECUTABLE}" QT_QMAKE_CHANGED)
+ ENDIF(QT_QMAKE_EXECUTABLE_LAST)
+
+ SET(QT_QMAKE_EXECUTABLE_LAST "${QT_QMAKE_EXECUTABLE}" CACHE INTERNAL "" FORCE)
+
+ SET(QT4_QMAKE_FOUND FALSE)
+
+ _qt4_query_qmake(QT_VERSION QTVERSION)
+
+ # check for qt3 qmake and then try and find qmake4 or qmake-qt4 in the path
+ IF(NOT QTVERSION)
+ SET(QT_QMAKE_EXECUTABLE NOTFOUND CACHE FILEPATH "" FORCE)
+ FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake4 qmake-qt4 PATHS
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
+ $ENV{QTDIR}/bin
+ DOC "The qmake executable for the Qt installation to use"
+ )
+ IF(QT_QMAKE_EXECUTABLE)
+ _qt4_query_qmake(QT_VERSION QTVERSION)
+ ENDIF(QT_QMAKE_EXECUTABLE)
+ ENDIF(NOT QTVERSION)
+
+ # check that we found the Qt4 qmake, Qt3 qmake output won't match here
+ STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" qt_version_tmp "${QTVERSION}")
+ IF (qt_version_tmp)
+
+ # we need at least version 4.0.0
+ IF (NOT QT_MIN_VERSION)
+ SET(QT_MIN_VERSION "4.0.0")
+ ENDIF (NOT QT_MIN_VERSION)
+
+ #now parse the parts of the user given version string into variables
+ STRING(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" req_qt_major_vers "${QT_MIN_VERSION}")
+ IF (NOT req_qt_major_vers)
+ MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", expected e.g. \"4.0.1\"")
+ ENDIF (NOT req_qt_major_vers)
+
+ # now parse the parts of the user given version string into variables
+ STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" req_qt_major_vers "${QT_MIN_VERSION}")
+ STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" req_qt_minor_vers "${QT_MIN_VERSION}")
+ STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" req_qt_patch_vers "${QT_MIN_VERSION}")
+
+ # Suppport finding at least a particular version, for instance FIND_PACKAGE( Qt4 4.4.3 )
+ # This implementation is a hack to avoid duplicating code and make sure we stay
+ # source-compatible with CMake 2.6.x
+ IF( Qt4_FIND_VERSION )
+ SET( QT_MIN_VERSION ${Qt4_FIND_VERSION} )
+ SET( req_qt_major_vers ${Qt4_FIND_VERSION_MAJOR} )
+ SET( req_qt_minor_vers ${Qt4_FIND_VERSION_MINOR} )
+ SET( req_qt_patch_vers ${Qt4_FIND_VERSION_PATCH} )
+ ENDIF( Qt4_FIND_VERSION )
+
+ IF (NOT req_qt_major_vers EQUAL 4)
+ MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", major version 4 is required, e.g. \"4.0.1\"")
+ ENDIF (NOT req_qt_major_vers EQUAL 4)
+
+ # and now the version string given by qmake
+ STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${QTVERSION}")
+ STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}")
+ STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${QTVERSION}")
+
+ # compute an overall version number which can be compared at once
+ MATH(EXPR req_vers "${req_qt_major_vers}*10000 + ${req_qt_minor_vers}*100 + ${req_qt_patch_vers}")
+ MATH(EXPR found_vers "${QT_VERSION_MAJOR}*10000 + ${QT_VERSION_MINOR}*100 + ${QT_VERSION_PATCH}")
+
+ # Support finding *exactly* a particular version, for instance FIND_PACKAGE( Qt4 4.4.3 EXACT )
+ IF( Qt4_FIND_VERSION_EXACT )
+ IF(found_vers EQUAL req_vers)
+ SET( QT4_QMAKE_FOUND TRUE )
+ ELSE(found_vers EQUAL req_vers)
+ SET( QT4_QMAKE_FOUND FALSE )
+ IF (found_vers LESS req_vers)
+ SET(QT4_INSTALLED_VERSION_TOO_OLD TRUE)
+ ELSE (found_vers LESS req_vers)
+ SET(QT4_INSTALLED_VERSION_TOO_NEW TRUE)
+ ENDIF (found_vers LESS req_vers)
+ ENDIF(found_vers EQUAL req_vers)
+ ELSE( Qt4_FIND_VERSION_EXACT )
+ IF (found_vers LESS req_vers)
+ SET(QT4_QMAKE_FOUND FALSE)
+ SET(QT4_INSTALLED_VERSION_TOO_OLD TRUE)
+ ELSE (found_vers LESS req_vers)
+ SET(QT4_QMAKE_FOUND TRUE)
+ ENDIF (found_vers LESS req_vers)
+ ENDIF( Qt4_FIND_VERSION_EXACT )
+ ENDIF (qt_version_tmp)
+
+ENDIF (QT_QMAKE_EXECUTABLE)
+
+IF (QT4_QMAKE_FOUND)
+
+ if (WIN32)
+ # get qt install dir
+ get_filename_component(_DIR ${QT_QMAKE_EXECUTABLE} PATH )
+ get_filename_component(QT_INSTALL_DIR ${_DIR} PATH )
+ endif (WIN32)
+
+ # ask qmake for the library dir
+ # Set QT_LIBRARY_DIR
+ IF (NOT QT_LIBRARY_DIR OR QT_QMAKE_CHANGED)
+ _qt4_query_qmake(QT_INSTALL_LIBS QT_LIBRARY_DIR_TMP)
+ IF(EXISTS "${QT_LIBRARY_DIR_TMP}")
+ SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE PATH "Qt library dir" FORCE)
+ ELSE(EXISTS "${QT_LIBRARY_DIR_TMP}")
+ MESSAGE("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as ${QT_LIBRARY_DIR_TMP}")
+ MESSAGE("Warning: ${QT_LIBRARY_DIR_TMP} does NOT exist, Qt must NOT be installed correctly.")
+ ENDIF(EXISTS "${QT_LIBRARY_DIR_TMP}")
+ ENDIF(NOT QT_LIBRARY_DIR OR QT_QMAKE_CHANGED)
+
+ IF (APPLE)
+ IF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
+ SET(QT_USE_FRAMEWORKS ON
+ CACHE BOOL "Set to ON if Qt build uses frameworks." FORCE)
+ ELSE (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
+ SET(QT_USE_FRAMEWORKS OFF
+ CACHE BOOL "Set to ON if Qt build uses frameworks." FORCE)
+ ENDIF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework)
+
+ MARK_AS_ADVANCED(QT_USE_FRAMEWORKS)
+ ENDIF (APPLE)
+
+ # ask qmake for the binary dir
+ IF (QT_LIBRARY_DIR AND NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED)
+ _qt4_query_qmake(QT_INSTALL_BINS qt_bins)
+ SET(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "" FORCE)
+ ENDIF (QT_LIBRARY_DIR AND NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED)
+
+ # ask qmake for the include dir
+ IF (QT_LIBRARY_DIR AND NOT QT_HEADERS_DIR OR QT_QMAKE_CHANGED)
+ _qt4_query_qmake(QT_INSTALL_HEADERS qt_headers)
+ SET(QT_HEADERS_DIR ${qt_headers} CACHE INTERNAL "" FORCE)
+ ENDIF (QT_LIBRARY_DIR AND NOT QT_HEADERS_DIR OR QT_QMAKE_CHANGED)
+
+
+ # ask qmake for the documentation directory
+ IF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED)
+ _qt4_query_qmake(QT_INSTALL_DOCS qt_doc_dir)
+ SET(QT_DOC_DIR ${qt_doc_dir} CACHE PATH "The location of the Qt docs" FORCE)
+ ENDIF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED)
+
+ # ask qmake for the mkspecs directory
+ IF (QT_LIBRARY_DIR AND NOT QT_MKSPECS_DIR OR QT_QMAKE_CHANGED)
+ _qt4_query_qmake(QMAKE_MKSPECS qt_mkspecs_dirs)
+ # do not replace : on windows as it might be a drive letter
+ # and windows should already use ; as a separator
+ IF(UNIX)
+ STRING(REPLACE ":" ";" qt_mkspecs_dirs "${qt_mkspecs_dirs}")
+ ENDIF(UNIX)
+ SET(QT_MKSPECS_DIR NOTFOUND)
+ FIND_PATH(QT_MKSPECS_DIR qconfig.pri PATHS ${qt_mkspecs_dirs}
+ DOC "The location of the Qt mkspecs containing qconfig.pri"
+ NO_DEFAULT_PATH )
+ ENDIF (QT_LIBRARY_DIR AND NOT QT_MKSPECS_DIR OR QT_QMAKE_CHANGED)
+
+ # ask qmake for the plugins directory
+ IF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED)
+ _qt4_query_qmake(QT_INSTALL_PLUGINS qt_plugins_dir)
+ SET(QT_PLUGINS_DIR ${qt_plugins_dir} CACHE PATH "The location of the Qt plugins" FORCE)
+ ENDIF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED)
+
+ # ask qmake for the translations directory
+ IF (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR OR QT_QMAKE_CHANGED)
+ _qt4_query_qmake(QT_INSTALL_TRANSLATIONS qt_translations_dir)
+ SET(QT_TRANSLATIONS_DIR ${qt_translations_dir} CACHE PATH "The location of the Qt translations" FORCE)
+ ENDIF (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR OR QT_QMAKE_CHANGED)
+
+ # ask qmake for the imports directory
+ IF (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED)
+ _qt4_query_qmake(QT_INSTALL_IMPORTS qt_imports_dir)
+ if(qt_imports_dir)
+ SET(QT_IMPORTS_DIR NOTFOUND)
+ foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
+ set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/imports")
+ endforeach(qt_cross_path)
+ FIND_PATH(QT_IMPORTS_DIR NAMES Qt
+ HINTS ${qt_cross_paths} ${qt_imports_dir}
+ DOC "The location of the Qt imports"
+ NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH
+ NO_CMAKE_SYSTEM_PATH)
+ mark_as_advanced(QT_IMPORTS_DIR)
+ endif(qt_imports_dir)
+ ENDIF (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED)
+
+ # Make variables changeble to the advanced user
+ MARK_AS_ADVANCED( QT_LIBRARY_DIR QT_DOC_DIR QT_MKSPECS_DIR
+ QT_PLUGINS_DIR QT_TRANSLATIONS_DIR)
+
+
+ #############################################
+ #
+ # Find out what window system we're using
+ #
+ #############################################
+ # Save required includes and required_flags variables
+ MACRO_PUSH_REQUIRED_VARS()
+ # Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES
+ SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_HEADERS_DIR}")
+ # On Mac OS X when Qt has framework support, also add the framework path
+ IF( QT_USE_FRAMEWORKS )
+ SET(CMAKE_REQUIRED_FLAGS "-F${QT_LIBRARY_DIR} ")
+ ENDIF( QT_USE_FRAMEWORKS )
+ # Check for Window system symbols (note: only one should end up being set)
+ CHECK_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11)
+ CHECK_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN)
+ CHECK_SYMBOL_EXISTS(Q_WS_QWS "QtCore/qglobal.h" Q_WS_QWS)
+ CHECK_SYMBOL_EXISTS(Q_WS_MAC "QtCore/qglobal.h" Q_WS_MAC)
+ IF(Q_WS_MAC)
+ IF(QT_QMAKE_CHANGED)
+ UNSET(QT_MAC_USE_COCOA CACHE)
+ ENDIF(QT_QMAKE_CHANGED)
+ CHECK_SYMBOL_EXISTS(QT_MAC_USE_COCOA "QtCore/qconfig.h" QT_MAC_USE_COCOA)
+ ENDIF(Q_WS_MAC)
+
+ IF (QT_QTCOPY_REQUIRED)
+ CHECK_SYMBOL_EXISTS(QT_IS_QTCOPY "QtCore/qglobal.h" QT_KDE_QT_COPY)
+ IF (NOT QT_IS_QTCOPY)
+ MESSAGE(FATAL_ERROR "qt-copy is required, but hasn't been found")
+ ENDIF (NOT QT_IS_QTCOPY)
+ ENDIF (QT_QTCOPY_REQUIRED)
+
+ # Restore CMAKE_REQUIRED_INCLUDES+CMAKE_REQUIRED_FLAGS variables
+ MACRO_POP_REQUIRED_VARS()
+ #
+ #############################################
+
+
+
+ ########################################
+ #
+ # Setting the INCLUDE-Variables
+ #
+ ########################################
+
+ SET(QT_MODULES QtCore QtGui Qt3Support QtSvg QtScript QtTest QtUiTools
+ QtHelp QtWebKit QtXmlPatterns QtNetwork QtMultimedia
+ QtNsPlugin QtOpenGL QtSql QtXml QtDesigner QtDBus QtScriptTools
+ QtDeclarative)
+
+ IF(Q_WS_X11)
+ SET(QT_MODULES ${QT_MODULES} QtMotif)
+ ENDIF(Q_WS_X11)
+
+ IF(QT_QMAKE_CHANGED)
+ FOREACH(QT_MODULE ${QT_MODULES})
+ STRING(TOUPPER ${QT_MODULE} _upper_qt_module)
+ SET(QT_${_upper_qt_module}_INCLUDE_DIR NOTFOUND)
+ SET(QT_${_upper_qt_module}_LIBRARY_RELEASE NOTFOUND)
+ SET(QT_${_upper_qt_module}_LIBRARY_DEBUG NOTFOUND)
+ ENDFOREACH(QT_MODULE)
+ SET(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR NOTFOUND)
+ SET(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NOTFOUND)
+ SET(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NOTFOUND)
+ SET(QT_QTASSISTANTCLIENT_INCLUDE_DIR NOTFOUND)
+ SET(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NOTFOUND)
+ SET(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NOTFOUND)
+ SET(QT_QTASSISTANT_INCLUDE_DIR NOTFOUND)
+ SET(QT_QTASSISTANT_LIBRARY_RELEASE NOTFOUND)
+ SET(QT_QTASSISTANT_LIBRARY_DEBUG NOTFOUND)
+ SET(QT_QTCLUCENE_LIBRARY_RELEASE NOTFOUND)
+ SET(QT_QTCLUCENE_LIBRARY_DEBUG NOTFOUND)
+ SET(QT_QAXCONTAINER_INCLUDE_DIR NOTFOUND)
+ SET(QT_QAXCONTAINER_LIBRARY_RELEASE NOTFOUND)
+ SET(QT_QAXCONTAINER_LIBRARY_DEBUG NOTFOUND)
+ SET(QT_QAXSERVER_INCLUDE_DIR NOTFOUND)
+ SET(QT_QAXSERVER_LIBRARY_RELEASE NOTFOUND)
+ SET(QT_QAXSERVER_LIBRARY_DEBUG NOTFOUND)
+ IF(WIN32)
+ SET(QT_QTMAIN_LIBRARY_DEBUG NOTFOUND)
+ SET(QT_QTMAIN_LIBRARY_RELEASE NOTFOUND)
+ ENDIF(WIN32)
+ SET(QT_PHONON_INCLUDE_DIR NOTFOUND)
+ ENDIF(QT_QMAKE_CHANGED)
+
+ FOREACH(QT_MODULE ${QT_MODULES})
+ STRING(TOUPPER ${QT_MODULE} _upper_qt_module)
+ FIND_PATH(QT_${_upper_qt_module}_INCLUDE_DIR ${QT_MODULE}
+ PATHS
+ ${QT_HEADERS_DIR}/${QT_MODULE}
+ ${QT_LIBRARY_DIR}/${QT_MODULE}.framework/Headers
+ NO_DEFAULT_PATH
+ )
+ ENDFOREACH(QT_MODULE)
+
+ IF(WIN32)
+ SET(QT_MODULES ${QT_MODULES} QAxContainer QAxServer)
+ # Set QT_AXCONTAINER_INCLUDE_DIR and QT_AXSERVER_INCLUDE_DIR
+ FIND_PATH(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt
+ PATHS
+ ${QT_HEADERS_DIR}/ActiveQt
+ NO_DEFAULT_PATH
+ )
+ FIND_PATH(QT_QAXSERVER_INCLUDE_DIR ActiveQt
+ PATHS
+ ${QT_HEADERS_DIR}/ActiveQt
+ NO_DEFAULT_PATH
+ )
+ ENDIF(WIN32)
+
+ # Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR
+ FIND_PATH(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR QDesignerComponents
+ PATHS
+ ${QT_HEADERS_DIR}/QtDesigner
+ ${QT_LIBRARY_DIR}/QtDesigner.framework/Headers
+ NO_DEFAULT_PATH
+ )
+
+ # Set QT_QTASSISTANT_INCLUDE_DIR
+ FIND_PATH(QT_QTASSISTANT_INCLUDE_DIR QtAssistant
+ PATHS
+ ${QT_HEADERS_DIR}/QtAssistant
+ ${QT_LIBRARY_DIR}/QtAssistant.framework/Headers
+ NO_DEFAULT_PATH
+ )
+
+ # Set QT_QTASSISTANTCLIENT_INCLUDE_DIR
+ FIND_PATH(QT_QTASSISTANTCLIENT_INCLUDE_DIR QAssistantClient
+ PATHS
+ ${QT_HEADERS_DIR}/QtAssistant
+ ${QT_LIBRARY_DIR}/QtAssistant.framework/Headers
+ NO_DEFAULT_PATH
+ )
+
+ # Set QT_QT_INCLUDE_DIR
+ FIND_PATH(QT_QT_INCLUDE_DIR qglobal.h
+ PATHS
+ ${QT_HEADERS_DIR}/Qt
+ ${QT_LIBRARY_DIR}/QtCore.framework/Headers
+ NO_DEFAULT_PATH
+ )
+
+ # Set QT_PHONON_INCLUDE_DIR
+ # Qt >= 4.5.3 (or kde-qt-4.5.2 which has the fix too) : Phonon/ClassName is inside include/phonon
+ # With previous versions of Qt, this could not work; upgrade Qt or use a standalone phonon
+ FIND_PATH(QT_PHONON_INCLUDE_DIR Phonon
+ PATHS
+ ${QT_HEADERS_DIR}/phonon
+ NO_DEFAULT_PATH
+ )
+ SET(QT_MODULES ${QT_MODULES} phonon)
+
+ # Set QT_INCLUDE_DIR by removine "/QtCore" in the string ${QT_QTCORE_INCLUDE_DIR}
+ IF( QT_QTCORE_INCLUDE_DIR AND NOT QT_INCLUDE_DIR)
+ IF (QT_USE_FRAMEWORKS)
+ SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR})
+ ELSE (QT_USE_FRAMEWORKS)
+ STRING( REGEX REPLACE "/QtCore$" "" qt4_include_dir ${QT_QTCORE_INCLUDE_DIR})
+ SET( QT_INCLUDE_DIR ${qt4_include_dir} CACHE PATH "")
+ ENDIF (QT_USE_FRAMEWORKS)
+ ENDIF( QT_QTCORE_INCLUDE_DIR AND NOT QT_INCLUDE_DIR)
+
+ IF( NOT QT_INCLUDE_DIR)
+ IF(Qt4_FIND_REQUIRED)
+ MESSAGE( FATAL_ERROR "Could NOT find QtCore header")
+ ENDIF(Qt4_FIND_REQUIRED)
+ ENDIF( NOT QT_INCLUDE_DIR)
+
+ # Make variables changeble to the advanced user
+ MARK_AS_ADVANCED( QT_INCLUDE_DIR QT_QT_INCLUDE_DIR)
+
+ # Set QT_INCLUDES
+ SET( QT_INCLUDES ${QT_QT_INCLUDE_DIR} ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} )
+
+
+ #######################################
+ #
+ # Qt configuration
+ #
+ #######################################
+ IF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
+ FILE(READ ${QT_MKSPECS_DIR}/qconfig.pri _qconfig_FILE_contents)
+ STRING(REGEX MATCH "QT_CONFIG[^\n]+" QT_QCONFIG "${_qconfig_FILE_contents}")
+ STRING(REGEX MATCH "CONFIG[^\n]+" QT_CONFIG "${_qconfig_FILE_contents}")
+ STRING(REGEX MATCH "EDITION[^\n]+" QT_EDITION "${_qconfig_FILE_contents}")
+ STRING(REGEX MATCH "QT_LIBINFIX[^\n]+" _qconfig_qt_libinfix "${_qconfig_FILE_contents}")
+ STRING(REGEX REPLACE "QT_LIBINFIX *= *([^\n]*)" "\\1" QT_LIBINFIX "${_qconfig_qt_libinfix}")
+ ENDIF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri")
+ IF("${QT_EDITION}" MATCHES "DesktopLight")
+ SET(QT_EDITION_DESKTOPLIGHT 1)
+ ENDIF("${QT_EDITION}" MATCHES "DesktopLight")
+
+ ########################################
+ #
+ # Setting the LIBRARY-Variables
+ #
+ ########################################
+
+ # find the libraries
+ FOREACH(QT_MODULE ${QT_MODULES})
+ STRING(TOUPPER ${QT_MODULE} _upper_qt_module)
+ FIND_LIBRARY(QT_${_upper_qt_module}_LIBRARY_RELEASE
+ NAMES ${QT_MODULE}${QT_LIBINFIX} ${QT_MODULE}${QT_LIBINFIX}4
+ PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH
+ )
+ FIND_LIBRARY(QT_${_upper_qt_module}_LIBRARY_DEBUG
+ NAMES ${QT_MODULE}${QT_LIBINFIX}_debug ${QT_MODULE}${QT_LIBINFIX}d ${QT_MODULE}${QT_LIBINFIX}d4
+ PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH
+ )
+ ENDFOREACH(QT_MODULE)
+
+ # QtUiTools not with other frameworks with binary installation (in /usr/lib)
+ IF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE)
+ FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_RELEASE NAMES QtUiTools${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR})
+ ENDIF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE)
+
+ IF( NOT QT_QTCORE_LIBRARY_DEBUG AND NOT QT_QTCORE_LIBRARY_RELEASE )
+
+ # try dropping a hint if trying to use Visual Studio with Qt built by mingw
+ IF(QT_LIBRARY_DIR AND MSVC)
+ IF(EXISTS ${QT_LIBRARY_DIR}/libqtmain.a)
+ MESSAGE( FATAL_ERROR "It appears you're trying to use Visual Studio with Qt built by mingw")
+ ENDIF(EXISTS ${QT_LIBRARY_DIR}/libqtmain.a)
+ ENDIF(QT_LIBRARY_DIR AND MSVC)
+
+ IF(Qt4_FIND_REQUIRED)
+ MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
+ ENDIF(Qt4_FIND_REQUIRED)
+ ENDIF( NOT QT_QTCORE_LIBRARY_DEBUG AND NOT QT_QTCORE_LIBRARY_RELEASE )
+
+ # Set QT_QTDESIGNERCOMPONENTS_LIBRARY
+ FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents${QT_LIBINFIX} QtDesignerComponents${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NAMES QtDesignerComponents${QT_LIBINFIX}_debug QtDesignerComponents${QT_LIBINFIX}d QtDesignerComponents${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTMAIN_LIBRARY
+ IF(WIN32)
+ FIND_LIBRARY(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR}
+ NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmain${QT_LIBINFIX}d PATHS ${QT_LIBRARY_DIR}
+ NO_DEFAULT_PATH)
+ ENDIF(WIN32)
+
+ # Set QT_QTASSISTANTCLIENT_LIBRARY
+ FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTASSISTANT_LIBRARY
+ FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 QtAssistant${QT_LIBINFIX} QtAssistant${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 QtAssistant${QT_LIBINFIX}_debug QtAssistant${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTHELP_LIBRARY
+ FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} QtCLucene${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_DEBUG NAMES QtCLucene${QT_LIBINFIX}_debug QtCLucene${QT_LIBINFIX}d QtCLucene${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ # QtCLucene not with other frameworks with binary installation (in /usr/lib)
+ IF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE)
+ FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR})
+ ENDIF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE)
+
+ ############################################
+ #
+ # Check the existence of the libraries.
+ #
+ ############################################
+
+ # On OSX when Qt is found as framework, never use the imported targets for now, since
+ # in this case the handling of the framework directory currently does not work correctly.
+ IF(QT_USE_FRAMEWORKS)
+ SET(QT_USE_IMPORTED_TARGETS FALSE)
+ ENDIF(QT_USE_FRAMEWORKS)
+
+
+ MACRO (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
+
+ STRING(TOUPPER "${_camelCaseBasename}" basename)
+
+ # The name of the imported targets, i.e. the prefix "Qt4::" must not change,
+ # since it is stored in EXPORT-files as name of a required library. If the name would change
+ # here, this would lead to the imported Qt4-library targets not being resolved by cmake anymore.
+ IF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
+
+ IF(NOT TARGET Qt4::${_camelCaseBasename})
+ ADD_LIBRARY(Qt4::${_camelCaseBasename} UNKNOWN IMPORTED )
+
+ IF (QT_${basename}_LIBRARY_RELEASE)
+ SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
+ SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}" )
+ ENDIF (QT_${basename}_LIBRARY_RELEASE)
+
+ IF (QT_${basename}_LIBRARY_DEBUG)
+ SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
+ SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}" )
+ ENDIF (QT_${basename}_LIBRARY_DEBUG)
+ ENDIF(NOT TARGET Qt4::${_camelCaseBasename})
+
+ # If QT_USE_IMPORTED_TARGETS is enabled, the QT_QTFOO_LIBRARY variables are set to point at these
+ # imported targets. This works better in general, and is also in almost all cases fully
+ # backward compatible. The only issue is when a project A which had this enabled then exports its
+ # libraries via export or EXPORT_LIBRARY_DEPENDENCIES(). In this case the libraries from project
+ # A will depend on the imported Qt targets, and the names of these imported targets will be stored
+ # in the dependency files on disk. This means when a project B then uses project A, these imported
+ # targets must be created again, otherwise e.g. "Qt4__QtCore" will be interpreted as name of a
+ # library file on disk, and not as a target, and linking will fail:
+ IF(QT_USE_IMPORTED_TARGETS)
+ SET(QT_${basename}_LIBRARY Qt4::${_camelCaseBasename} )
+ SET(QT_${basename}_LIBRARIES Qt4::${_camelCaseBasename} )
+ ELSE(QT_USE_IMPORTED_TARGETS)
+
+ # if the release- as well as the debug-version of the library have been found:
+ IF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
+ # if the generator supports configuration types then set
+ # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
+ IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_${basename}_LIBRARY optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
+ ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ # if there are no configuration types and CMAKE_BUILD_TYPE has no value
+ # then just use the release libraries
+ SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE} )
+ ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
+ ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
+
+ # if only the release version was found, set the debug variable also to the release version
+ IF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
+ SET(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE})
+ SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE})
+ SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_RELEASE})
+ ENDIF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
+
+ # if only the debug version was found, set the release variable also to the debug version
+ IF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
+ SET(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG})
+ SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG})
+ SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_DEBUG})
+ ENDIF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
+
+ # put the value in the cache:
+ SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library" FORCE)
+
+ ENDIF(QT_USE_IMPORTED_TARGETS)
+
+# message(STATUS "QT_${basename}_LIBRARY: ${QT_${basename}_LIBRARY}")
+
+ SET(QT_${basename}_FOUND 1)
+
+ ENDIF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
+
+ IF (QT_${basename}_INCLUDE_DIR)
+ #add the include directory to QT_INCLUDES
+ SET(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES})
+ ENDIF (QT_${basename}_INCLUDE_DIR)
+
+ # Make variables changeble to the advanced user
+ MARK_AS_ADVANCED(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR)
+ ENDMACRO (_QT4_ADJUST_LIB_VARS)
+
+
+ # Set QT_xyz_LIBRARY variable and add
+ # library include path to QT_INCLUDES
+ _QT4_ADJUST_LIB_VARS(QtCore)
+ _QT4_ADJUST_LIB_VARS(QtGui)
+ _QT4_ADJUST_LIB_VARS(Qt3Support)
+ _QT4_ADJUST_LIB_VARS(QtAssistant)
+ _QT4_ADJUST_LIB_VARS(QtAssistantClient)
+ _QT4_ADJUST_LIB_VARS(QtCLucene)
+ _QT4_ADJUST_LIB_VARS(QtDBus)
+ _QT4_ADJUST_LIB_VARS(QtDeclarative)
+ _QT4_ADJUST_LIB_VARS(QtDesigner)
+ _QT4_ADJUST_LIB_VARS(QtDesignerComponents)
+ _QT4_ADJUST_LIB_VARS(QtHelp)
+ _QT4_ADJUST_LIB_VARS(QtMultimedia)
+ _QT4_ADJUST_LIB_VARS(QtNetwork)
+ _QT4_ADJUST_LIB_VARS(QtNsPlugin)
+ _QT4_ADJUST_LIB_VARS(QtOpenGL)
+ _QT4_ADJUST_LIB_VARS(QtScript)
+ _QT4_ADJUST_LIB_VARS(QtScriptTools)
+ _QT4_ADJUST_LIB_VARS(QtSql)
+ _QT4_ADJUST_LIB_VARS(QtSvg)
+ _QT4_ADJUST_LIB_VARS(QtTest)
+ _QT4_ADJUST_LIB_VARS(QtUiTools)
+ _QT4_ADJUST_LIB_VARS(QtWebKit)
+ _QT4_ADJUST_LIB_VARS(QtXml)
+ _QT4_ADJUST_LIB_VARS(QtXmlPatterns)
+ _QT4_ADJUST_LIB_VARS(phonon)
+
+ # platform dependent libraries
+ IF(Q_WS_X11)
+ _QT4_ADJUST_LIB_VARS(QtMotif)
+ ENDIF(Q_WS_X11)
+ IF(WIN32)
+ _QT4_ADJUST_LIB_VARS(qtmain)
+ _QT4_ADJUST_LIB_VARS(QAxServer)
+ _QT4_ADJUST_LIB_VARS(QAxContainer)
+ ENDIF(WIN32)
+
+ # If Qt is installed as a framework, we need to add QT_QTCORE_LIBRARY here (which
+ # is the framework directory in that case), since this will make the cmake include_directories()
+ # command recognize that we need the framework flag with the respective directory (-F)
+ IF(QT_USE_FRAMEWORKS)
+ SET(QT_INCLUDES ${QT_INCLUDES} ${QT_QTCORE_LIBRARY} )
+ SET(QT_INCLUDE_DIR ${QT_INCLUDE_DIR} ${QT_QTCORE_LIBRARY} )
+ ENDIF(QT_USE_FRAMEWORKS)
+
+
+
+ #######################################
+ #
+ # Check the executables of Qt
+ # ( moc, uic, rcc )
+ #
+ #######################################
+
+
+ IF(QT_QMAKE_CHANGED)
+ SET(QT_UIC_EXECUTABLE NOTFOUND)
+ SET(QT_MOC_EXECUTABLE NOTFOUND)
+ SET(QT_UIC3_EXECUTABLE NOTFOUND)
+ SET(QT_RCC_EXECUTABLE NOTFOUND)
+ SET(QT_DBUSCPP2XML_EXECUTABLE NOTFOUND)
+ SET(QT_DBUSXML2CPP_EXECUTABLE NOTFOUND)
+ SET(QT_LUPDATE_EXECUTABLE NOTFOUND)
+ SET(QT_LRELEASE_EXECUTABLE NOTFOUND)
+ SET(QT_QCOLLECTIONGENERATOR_EXECUTABLE NOTFOUND)
+ SET(QT_DESIGNER_EXECUTABLE NOTFOUND)
+ SET(QT_LINGUIST_EXECUTABLE NOTFOUND)
+ ENDIF(QT_QMAKE_CHANGED)
+
+ FIND_PROGRAM(QT_MOC_EXECUTABLE
+ NAMES moc-qt4 moc
+ PATHS ${QT_BINARY_DIR}
+ NO_DEFAULT_PATH
+ )
+
+ FIND_PROGRAM(QT_UIC_EXECUTABLE
+ NAMES uic-qt4 uic
+ PATHS ${QT_BINARY_DIR}
+ NO_DEFAULT_PATH
+ )
+
+ FIND_PROGRAM(QT_UIC3_EXECUTABLE
+ NAMES uic3
+ PATHS ${QT_BINARY_DIR}
+ NO_DEFAULT_PATH
+ )
+
+ FIND_PROGRAM(QT_RCC_EXECUTABLE
+ NAMES rcc
+ PATHS ${QT_BINARY_DIR}
+ NO_DEFAULT_PATH
+ )
+
+if(NOT WINCE)
+ FIND_PROGRAM(QT_DBUSCPP2XML_EXECUTABLE
+ NAMES qdbuscpp2xml
+ PATHS ${QT_BINARY_DIR}
+ NO_DEFAULT_PATH
+ )
+
+ FIND_PROGRAM(QT_DBUSXML2CPP_EXECUTABLE
+ NAMES qdbusxml2cpp
+ PATHS ${QT_BINARY_DIR}
+ NO_DEFAULT_PATH
+ )
+else(NOT WINCE)
+ FIND_PROGRAM(QT_DBUSCPP2XML_EXECUTABLE
+ NAMES qdbuscpp2xml
+ PATHS ${HOST_BINDIR}
+ NO_DEFAULT_PATH
+ )
+
+ FIND_PROGRAM(QT_DBUSXML2CPP_EXECUTABLE
+ NAMES qdbusxml2cpp
+ PATHS ${HOST_BINDIR}
+ NO_DEFAULT_PATH
+ )
+endif(NOT WINCE)
+
+ FIND_PROGRAM(QT_LUPDATE_EXECUTABLE
+ NAMES lupdate-qt4 lupdate
+ PATHS ${QT_BINARY_DIR}
+ NO_DEFAULT_PATH
+ )
+
+ FIND_PROGRAM(QT_LRELEASE_EXECUTABLE
+ NAMES lrelease-qt4 lrelease
+ PATHS ${QT_BINARY_DIR}
+ NO_DEFAULT_PATH
+ )
+
+ FIND_PROGRAM(QT_QCOLLECTIONGENERATOR_EXECUTABLE
+ NAMES qcollectiongenerator-qt4 qcollectiongenerator
+ PATHS ${QT_BINARY_DIR}
+ NO_DEFAULT_PATH
+ )
+
+ FIND_PROGRAM(QT_DESIGNER_EXECUTABLE
+ NAMES designer-qt4 designer
+ PATHS ${QT_BINARY_DIR}
+ NO_DEFAULT_PATH
+ )
+
+ FIND_PROGRAM(QT_LINGUIST_EXECUTABLE
+ NAMES linguist-qt4 linguist
+ PATHS ${QT_BINARY_DIR}
+ NO_DEFAULT_PATH
+ )
+
+ IF (QT_MOC_EXECUTABLE)
+ SET(QT_WRAP_CPP "YES")
+ ENDIF (QT_MOC_EXECUTABLE)
+
+ IF (QT_UIC_EXECUTABLE)
+ SET(QT_WRAP_UI "YES")
+ ENDIF (QT_UIC_EXECUTABLE)
+
+
+
+ MARK_AS_ADVANCED( QT_UIC_EXECUTABLE QT_UIC3_EXECUTABLE QT_MOC_EXECUTABLE
+ QT_RCC_EXECUTABLE QT_DBUSXML2CPP_EXECUTABLE QT_DBUSCPP2XML_EXECUTABLE
+ QT_LUPDATE_EXECUTABLE QT_LRELEASE_EXECUTABLE QT_QCOLLECTIONGENERATOR_EXECUTABLE
+ QT_DESIGNER_EXECUTABLE QT_LINGUIST_EXECUTABLE)
+
+
+ # get the directory of the current file, used later on in the file
+ GET_FILENAME_COMPONENT( _qt4_current_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
+
+ ######################################
+ #
+ # Macros for building Qt files
+ #
+ ######################################
+
+ INCLUDE("${_qt4_current_dir}/Qt4Macros.cmake")
+
+
+ ######################################
+ #
+ # decide if Qt got found
+ #
+ ######################################
+
+ # if the includes,libraries,moc,uic and rcc are found then we have it
+ IF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND
+ QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE AND QT_QTCORE_LIBRARY)
+ SET( QT4_FOUND "YES" )
+ IF( NOT Qt4_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Qt-Version ${QTVERSION} (using ${QT_QMAKE_EXECUTABLE})")
+ ENDIF( NOT Qt4_FIND_QUIETLY)
+ ELSE( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND
+ QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE AND QT_QTCORE_LIBRARY)
+ SET( QT4_FOUND "NO")
+ SET(QT_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}-NOTFOUND" CACHE FILEPATH "Invalid qmake found" FORCE)
+ IF( Qt4_FIND_REQUIRED)
+ IF ( NOT QT_LIBRARY_DIR )
+ MESSAGE(STATUS "Qt libraries NOT found!")
+ ENDIF(NOT QT_LIBRARY_DIR )
+ IF ( NOT QT_INCLUDE_DIR )
+ MESSAGE(STATUS "Qt includes NOT found!")
+ ENDIF( NOT QT_INCLUDE_DIR )
+ IF ( NOT QT_MOC_EXECUTABLE )
+ MESSAGE(STATUS "Qt's moc NOT found!")
+ ENDIF( NOT QT_MOC_EXECUTABLE )
+ IF ( NOT QT_UIC_EXECUTABLE )
+ MESSAGE(STATUS "Qt's uic NOT found!")
+ ENDIF( NOT QT_UIC_EXECUTABLE )
+ IF ( NOT QT_RCC_EXECUTABLE )
+ MESSAGE(STATUS "Qt's rcc NOT found!")
+ ENDIF( NOT QT_RCC_EXECUTABLE )
+ MESSAGE( FATAL_ERROR "Qt libraries, includes, moc, uic or/and rcc NOT found!")
+ ENDIF( Qt4_FIND_REQUIRED)
+ ENDIF( QT_LIBRARY_DIR AND QT_INCLUDE_DIR AND QT_MOC_EXECUTABLE AND
+ QT_UIC_EXECUTABLE AND QT_RCC_EXECUTABLE AND QT_QTCORE_LIBRARY)
+
+ SET(QT_FOUND ${QT4_FOUND})
+
+
+ ###############################################
+ #
+ # configuration/system dependent settings
+ #
+ ###############################################
+
+ INCLUDE("${_qt4_current_dir}/Qt4ConfigDependentSettings.cmake")
+
+
+ #######################################
+ #
+ # compatibility settings
+ #
+ #######################################
+ # Backwards compatibility for CMake1.4 and 1.2
+ SET (QT_MOC_EXE ${QT_MOC_EXECUTABLE} )
+ SET (QT_UIC_EXE ${QT_UIC_EXECUTABLE} )
+
+ SET( QT_QT_LIBRARY "")
+
+ELSE(QT4_QMAKE_FOUND)
+
+ SET(QT_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}-NOTFOUND" CACHE FILEPATH "Invalid qmake found" FORCE)
+
+ # The code below is overly complex to make sure we do not break compatibility with CMake 2.6.x
+ # For CMake 2.8, it should be simplified by getting rid of QT4_INSTALLED_VERSION_TOO_OLD and
+ # QT4_INSTALLED_VERSION_TOO_NEW
+ IF(Qt4_FIND_REQUIRED)
+ IF(QT4_INSTALLED_VERSION_TOO_OLD)
+ IF( Qt4_FIND_VERSION_EXACT )
+ MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too old, version ${QT_MIN_VERSION} is required")
+ ELSE( Qt4_FIND_VERSION_EXACT )
+ MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too old, at least version ${QT_MIN_VERSION} is required")
+ ENDIF( Qt4_FIND_VERSION_EXACT )
+ ELSE(QT4_INSTALLED_VERSION_TOO_OLD)
+ IF( Qt4_FIND_VERSION_EXACT AND QT4_INSTALLED_VERSION_TOO_NEW )
+ MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too new, version ${QT_MIN_VERSION} is required")
+ ELSE( Qt4_FIND_VERSION_EXACT AND QT4_INSTALLED_VERSION_TOO_NEW )
+ MESSAGE( FATAL_ERROR "Qt qmake not found!")
+ ENDIF( Qt4_FIND_VERSION_EXACT AND QT4_INSTALLED_VERSION_TOO_NEW )
+ ENDIF(QT4_INSTALLED_VERSION_TOO_OLD)
+ ELSE(Qt4_FIND_REQUIRED)
+ IF(QT4_INSTALLED_VERSION_TOO_OLD AND NOT Qt4_FIND_QUIETLY)
+ MESSAGE(STATUS "The installed Qt version ${QTVERSION} is too old, at least version ${QT_MIN_VERSION} is required")
+ ENDIF(QT4_INSTALLED_VERSION_TOO_OLD AND NOT Qt4_FIND_QUIETLY)
+ ENDIF(Qt4_FIND_REQUIRED)
+
+ENDIF (QT4_QMAKE_FOUND)
+
diff --git a/kdecore/cmake/modules/FindRUBY.cmake b/kdecore/cmake/modules/FindRUBY.cmake
new file mode 100644
index 0000000..b5d3c0f
--- /dev/null
+++ b/kdecore/cmake/modules/FindRUBY.cmake
@@ -0,0 +1,89 @@
+# - Find Ruby
+# This module finds if Ruby is installed and determines where the include files
+# and libraries are. It also determines what the name of the library is. This
+# code sets the following variables:
+#
+# RUBY_LIBRARY = full path+file to the ruby library
+# RUBY_INCLUDE_PATH = path to where ruby.h can be found
+# RUBY_EXECUTABLE = full path+file to the ruby binary
+# RUBY_FOUND = Ruby was found under system.
+
+# Copyright (c) 2006,2007 Laurent Montel, <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if(RUBY_LIBRARY AND RUBY_INCLUDE_PATH)
+ # Already in cache, be silent
+ SET(RUBY_FOUND TRUE)
+endif (RUBY_LIBRARY AND RUBY_INCLUDE_PATH)
+
+# RUBY_ARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"archdir"@:>@)'`
+# RUBY_SITEARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitearchdir"@:>@)'`
+# RUBY_SITEDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitelibdir"@:>@)'`
+# RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"libdir"@:>@)'`
+# RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`
+
+FIND_PROGRAM(RUBY_EXECUTABLE NAMES ruby ruby1.8 ruby18 ruby1.9 ruby19)
+
+IF(RUBY_EXECUTABLE)
+ EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts Config::CONFIG['archdir'] || Config::CONFIG['rubyincludedir']"
+ OUTPUT_VARIABLE RUBY_ARCH_DIR)
+
+ EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts Config::CONFIG['libdir']"
+ OUTPUT_VARIABLE RUBY_POSSIBLE_LIB_PATH)
+
+ EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts Config::CONFIG['rubylibdir']"
+ OUTPUT_VARIABLE RUBY_RUBY_LIB_PATH)
+
+ EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts Config::CONFIG['ruby_version']"
+ OUTPUT_VARIABLE RUBY_VERSION)
+
+ EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts Config::CONFIG['sitelibdir']"
+ OUTPUT_VARIABLE RUBY_SITE_LIB_DIR)
+
+ EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts Config::CONFIG['sitearchdir']"
+ OUTPUT_VARIABLE RUBY_SITE_ARCH_DIR)
+
+ # remove the new lines from the output by replacing them with empty strings
+ STRING(REPLACE "\n" "" RUBY_ARCH_DIR "${RUBY_ARCH_DIR}")
+ STRING(REPLACE "\n" "" RUBY_POSSIBLE_LIB_PATH "${RUBY_POSSIBLE_LIB_PATH}")
+ STRING(REPLACE "\n" "" RUBY_RUBY_LIB_PATH "${RUBY_RUBY_LIB_PATH}")
+ STRING(REPLACE "\n" "" RUBY_VERSION "${RUBY_VERSION}")
+ STRING(REPLACE "." "" RUBY_VERSION_NODOT "${RUBY_VERSION}")
+ STRING(REPLACE "\n" "" RUBY_SITE_LIB_DIR "${RUBY_SITE_LIB_DIR}")
+ STRING(REPLACE "\n" "" RUBY_SITE_ARCH_DIR "${RUBY_SITE_ARCH_DIR}")
+
+ FIND_PATH(RUBY_INCLUDE_PATH
+ NAMES ruby.h
+ PATHS ${RUBY_ARCH_DIR} /usr/include/ruby-${RUBY_VERSION}
+ )
+
+ FIND_LIBRARY(RUBY_LIBRARY
+ NAMES ruby${RUBY_VERSION} ruby msvcrt-ruby${RUBY_VERSION_NODOT}
+ PATHS ${RUBY_POSSIBLE_LIB_PATH} ${RUBY_RUBY_LIB_PATH}
+ )
+
+ if(RUBY_LIBRARY AND RUBY_INCLUDE_PATH)
+ SET(RUBY_FOUND TRUE)
+ endif (RUBY_LIBRARY AND RUBY_INCLUDE_PATH)
+
+ MARK_AS_ADVANCED(
+ RUBY_EXECUTABLE
+ RUBY_LIBRARY
+ RUBY_INCLUDE_PATH
+ )
+ENDIF(RUBY_EXECUTABLE)
+
+IF(RUBY_FOUND)
+ IF(NOT RUBY_FIND_QUIETLY)
+ MESSAGE(STATUS "Ruby found: ${RUBY_LIBRARY}")
+ ENDIF(NOT RUBY_FIND_QUIETLY)
+ELSE(RUBY_FOUND)
+ IF(RUBY_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find Ruby")
+ ENDIF(RUBY_FIND_REQUIRED)
+ENDIF(RUBY_FOUND)
+
+
diff --git a/kdecore/cmake/modules/FindSIP.cmake b/kdecore/cmake/modules/FindSIP.cmake
new file mode 100644
index 0000000..61eaa65
--- /dev/null
+++ b/kdecore/cmake/modules/FindSIP.cmake
@@ -0,0 +1,60 @@
+# Find SIP
+# ~~~~~~~~
+#
+# SIP website: http://www.riverbankcomputing.co.uk/sip/index.php
+#
+# Find the installed version of SIP. FindSIP should be called after Python
+# has been found.
+#
+# This file defines the following variables:
+#
+# SIP_VERSION - The version of SIP found expressed as a 6 digit hex number
+# suitable for comparision as a string.
+#
+# SIP_VERSION_STR - The version of SIP found as a human readable string.
+#
+# SIP_EXECUTABLE - Path and filename of the SIP command line executable.
+#
+# SIP_INCLUDE_DIR - Directory holding the SIP C++ header file.
+#
+# SIP_DEFAULT_SIP_DIR - Default directory where .sip files should be installed
+# into.
+
+# Copyright (c) 2007, Simon Edwards <simon@simonzone.com>
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+
+IF(SIP_VERSION)
+ # Already in cache, be silent
+ SET(SIP_FOUND TRUE)
+ELSE(SIP_VERSION)
+
+ FIND_FILE(_find_sip_py FindSIP.py PATHS ${CMAKE_MODULE_PATH})
+
+ EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_sip_py} OUTPUT_VARIABLE sip_config)
+ IF(sip_config)
+ STRING(REGEX REPLACE "^sip_version:([^\n]+).*$" "\\1" SIP_VERSION ${sip_config})
+ STRING(REGEX REPLACE ".*\nsip_version_str:([^\n]+).*$" "\\1" SIP_VERSION_STR ${sip_config})
+ STRING(REGEX REPLACE ".*\nsip_bin:([^\n]+).*$" "\\1" SIP_EXECUTABLE ${sip_config})
+ IF(NOT SIP_DEFAULT_SIP_DIR)
+ STRING(REGEX REPLACE ".*\ndefault_sip_dir:([^\n]+).*$" "\\1" SIP_DEFAULT_SIP_DIR ${sip_config})
+ ENDIF(NOT SIP_DEFAULT_SIP_DIR)
+ STRING(REGEX REPLACE ".*\nsip_inc_dir:([^\n]+).*$" "\\1" SIP_INCLUDE_DIR ${sip_config})
+ FILE(TO_CMAKE_PATH ${SIP_DEFAULT_SIP_DIR} SIP_DEFAULT_SIP_DIR)
+ FILE(TO_CMAKE_PATH ${SIP_INCLUDE_DIR} SIP_INCLUDE_DIR)
+ SET(SIP_FOUND TRUE)
+ ENDIF(sip_config)
+
+ IF(SIP_FOUND)
+ IF(NOT SIP_FIND_QUIETLY)
+ MESSAGE(STATUS "Found SIP version: ${SIP_VERSION_STR}")
+ ENDIF(NOT SIP_FIND_QUIETLY)
+ ELSE(SIP_FOUND)
+ IF(SIP_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find SIP")
+ ENDIF(SIP_FIND_REQUIRED)
+ ENDIF(SIP_FOUND)
+
+ENDIF(SIP_VERSION)
diff --git a/kdecore/cmake/modules/FindSIP.py b/kdecore/cmake/modules/FindSIP.py
new file mode 100644
index 0000000..ecb734f
--- /dev/null
+++ b/kdecore/cmake/modules/FindSIP.py
@@ -0,0 +1,15 @@
+# FindSIP.py
+#
+# Copyright (c) 2007, Simon Edwards <simon@simonzone.com>
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+import sys
+import sipconfig
+
+sipcfg = sipconfig.Configuration()
+print("sip_version:%06.0x" % sipcfg.sip_version)
+print("sip_version_str:%s" % sipcfg.sip_version_str)
+print("sip_bin:%s" % sipcfg.sip_bin)
+print("default_sip_dir:%s" % sipcfg.default_sip_dir)
+print("sip_inc_dir:%s" % sipcfg.sip_inc_dir)
diff --git a/kdecore/cmake/modules/FindSamba.cmake b/kdecore/cmake/modules/FindSamba.cmake
new file mode 100644
index 0000000..16522c6
--- /dev/null
+++ b/kdecore/cmake/modules/FindSamba.cmake
@@ -0,0 +1,62 @@
+# - Try to find the samba directory library
+# Once done this will define
+#
+# SAMBA_FOUND - system has SAMBA
+# SAMBA_INCLUDE_DIR - the SAMBA include directory
+# SAMBA_LIBRARIES - The libraries needed to use SAMBA
+# Set SAMBA_REQUIRE_SMBC_SET_CONTEXT to TRUE if you need a version of Samba
+# which comes with smbc_set_context()
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if(SAMBA_INCLUDE_DIR AND SAMBA_LIBRARIES)
+ # Already in cache, be silent
+ set(Samba_FIND_QUIETLY TRUE)
+endif(SAMBA_INCLUDE_DIR AND SAMBA_LIBRARIES)
+
+find_path(SAMBA_INCLUDE_DIR NAMES libsmbclient.h )
+
+find_library(SAMBA_LIBRARIES NAMES smbclient )
+
+
+if(SAMBA_INCLUDE_DIR AND SAMBA_LIBRARIES)
+ set(SAMBA_FOUND TRUE)
+ # check whether libsmbclient has smbc_set_context()
+ include(CheckSymbolExists)
+ include(MacroPushRequiredVars)
+ macro_push_required_vars()
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${SAMBA_LIBRARIES})
+ set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${SAMBA_INCLUDE_DIR})
+ check_symbol_exists(smbc_set_context "libsmbclient.h" SAMBA_HAVE_SMBC_SET_CONTEXT)
+ check_symbol_exists(smbc_option_set "libsmbclient.h" SAMBA_HAVE_SMBC_OPTION_SET)
+ macro_pop_required_vars()
+ # fail if smbc_set_context() was required but hasn't been found
+ if (SAMBA_REQUIRE_SMBC_SET_CONTEXT AND NOT SAMBA_HAVE_SMBC_SET_CONTEXT)
+ set(SAMBA_FOUND FALSE)
+ endif (SAMBA_REQUIRE_SMBC_SET_CONTEXT AND NOT SAMBA_HAVE_SMBC_SET_CONTEXT)
+ # fail if smbc_option_set() was required but hasn't been found
+ if (SAMBA_REQUIRE_SMBC_OPTION_SET AND NOT SAMBA_HAVE_SMBC_OPTION_SET)
+ set(SAMBA_FOUND FALSE)
+ endif (SAMBA_REQUIRE_SMBC_OPTION_SET AND NOT SAMBA_HAVE_SMBC_OPTION_SET)
+
+else(SAMBA_INCLUDE_DIR AND SAMBA_LIBRARIES)
+ set(SAMBA_FOUND FALSE)
+ set(SAMBA_HAVE_SMBC_SET_CONTEXT FALSE)
+endif(SAMBA_INCLUDE_DIR AND SAMBA_LIBRARIES)
+
+
+if(SAMBA_FOUND)
+ if(NOT Samba_FIND_QUIETLY)
+ message(STATUS "Found samba: ${SAMBA_LIBRARIES}")
+ endif(NOT Samba_FIND_QUIETLY)
+else(SAMBA_FOUND)
+ if (Samba_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find Samba library")
+ endif (Samba_FIND_REQUIRED)
+endif(SAMBA_FOUND)
+
+mark_as_advanced(SAMBA_INCLUDE_DIR SAMBA_LIBRARIES)
+
diff --git a/kdecore/cmake/modules/FindSane.cmake b/kdecore/cmake/modules/FindSane.cmake
new file mode 100644
index 0000000..64efa87
--- /dev/null
+++ b/kdecore/cmake/modules/FindSane.cmake
@@ -0,0 +1,21 @@
+# cmake macro to test if we use sane
+#
+# SANE_FOUND - system has SANE libs
+# SANE_INCLUDE_DIR - the SANE include directory
+# SANE_LIBRARIES - The libraries needed to use SANE
+
+# Copyright (c) 2006, Marcus Hufgard <hufgardm@hufgard.de> 2006
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+FIND_PATH(SANE_INCLUDE_DIR sane/sane.h)
+
+FIND_LIBRARY(SANE_LIBRARY NAMES sane libsane
+ PATH_SUFFIXES sane
+)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sane DEFAULT_MSG SANE_LIBRARY SANE_INCLUDE_DIR )
+
+MARK_AS_ADVANCED(SANE_INCLUDE_DIR SANE_LIBRARY)
diff --git a/kdecore/cmake/modules/FindSasl2.cmake b/kdecore/cmake/modules/FindSasl2.cmake
new file mode 100644
index 0000000..9fe12ea
--- /dev/null
+++ b/kdecore/cmake/modules/FindSasl2.cmake
@@ -0,0 +1,26 @@
+# - Try to find the sasl2 directory library
+# Once done this will define
+#
+# SASL2_FOUND - system has SASL2
+# SASL2_INCLUDE_DIR - the SASL2 include directory
+# SASL2_LIBRARIES - The libraries needed to use SASL2
+
+# Copyright (c) 2006, 2007 Laurent Montel, <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+find_path(SASL2_INCLUDE_DIR sasl/sasl.h
+)
+
+# libsasl2 add for windows, because the windows package of cyrus-sasl2
+# contains a libsasl2 also for msvc which is not standard conform
+find_library(SASL2_LIBRARIES NAMES sasl2 libsasl2
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Sasl2 DEFAULT_MSG SASL2_LIBRARIES SASL2_INCLUDE_DIR)
+
+mark_as_advanced(SASL2_INCLUDE_DIR SASL2_LIBRARIES)
+
diff --git a/kdecore/cmake/modules/FindSharedDesktopOntologies.cmake b/kdecore/cmake/modules/FindSharedDesktopOntologies.cmake
new file mode 100644
index 0000000..99b7036
--- /dev/null
+++ b/kdecore/cmake/modules/FindSharedDesktopOntologies.cmake
@@ -0,0 +1,42 @@
+# - Try to find shared-desktop-ontologies
+# The shared-desktop-ontologies package is a direct dependancy of the Nepomuk
+# semantic desktop system and provides all necessary ontology files like
+# RDF, RDFS, NRL, or NIE.
+#
+# The package is created by the OSCAF project (http://oscaf.sourceforge.net).
+#
+# Once done this will define
+#
+# SHAREDDESKTOPONTOLOGIES_FOUND - system has shared-desktop-ontologies
+# SHAREDDESKTOPONTOLOGIES_ROOT_DIR - Folder where the ontologies are stored
+# SHAREDDESKTOPONTOLOGIES_VERSION_MAJOR - The major version number, i.e. '1' in '1.2'
+# SHAREDDESKTOPONTOLOGIES_VERSION_MINOR - The minor version number, i.e. '2' in '1.2'
+# SHAREDDESKTOPONTOLOGIES_VERSION - The complete version string, i.e. '1.2'
+#
+
+# Copyright (c) 2009, Sebastian Trueg, <trueg@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+# First try the SharedDesktopOntologiesConfig.cmake from shared-desktop-ontologies 0.2 and newer
+
+# This is to make it work with cmake 2.6.2, since SDO 0.2 installs its config file into
+# the 2.6.3 compatible location only ( share/cmake/SDO/ instead share/SDO/[cmake/] )
+if( "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_LESS "2.6.3")
+ find_path(_SDO_CONFIG_DIR SharedDesktopOntologiesConfig.cmake PATH_SUFFIXES share/cmake/SharedDesktopOntologies/ )
+endif( "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_LESS "2.6.3")
+
+if(NOT SharedDesktopOntologies_FIND_VERSION)
+ set(SharedDesktopOntologies_FIND_VERSION "${SDO_MIN_VERSION}")
+endif(NOT SharedDesktopOntologies_FIND_VERSION)
+
+find_package(SharedDesktopOntologies ${SharedDesktopOntologies_FIND_VERSION} QUIET NO_MODULE HINTS "${_SDO_CONFIG_DIR}" )
+
+if (SHAREDDESKTOPONTOLOGIES_ROOT_DIR)
+ mark_as_advanced(SHAREDDESKTOPONTOLOGIES_ROOT_DIR)
+endif (SHAREDDESKTOPONTOLOGIES_ROOT_DIR)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(SharedDesktopOntologies REQUIRED_VARS SHAREDDESKTOPONTOLOGIES_ROOT_DIR VERSION_VAR SharedDesktopOntologies_VERSION)
diff --git a/kdecore/cmake/modules/FindSharedMimeInfo.cmake b/kdecore/cmake/modules/FindSharedMimeInfo.cmake
new file mode 100644
index 0000000..16e335d
--- /dev/null
+++ b/kdecore/cmake/modules/FindSharedMimeInfo.cmake
@@ -0,0 +1,78 @@
+# - Try to find the shared-mime-info package
+#
+# Once done this will define
+#
+# SHAREDMIMEINFO_FOUND - system has the shared-mime-info package
+# UPDATE_MIME_DATABASE_EXECUTABLE - the update-mime-database executable
+#
+# The minimum required version of SharedMimeInfo can be specified using the
+# standard syntax, e.g. find_package(SharedMimeInfo 0.20)
+#
+# For backward compatiblity, the following two variables are also supported:
+# SHARED_MIME_INFO_FOUND - same as SHAREDMIMEINFO_FOUND
+# SHARED_MIME_INFO_MINIMUM_VERSION - set to the minimum version you need, default is 0.18.
+# When both are used, i.e. the version is set in the find_package() call and
+# SHARED_MIME_INFO_MINIMUM_VERSION is set, the version specified in the find_package()
+# call takes precedence.
+
+
+# Copyright (c) 2007, Pino Toscano, <toscano.pino@tiscali.it>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+# Support SHARED_MIME_INFO_MINIMUM_VERSION for compatibility:
+if(NOT SharedMimeInfo_FIND_VERSION)
+ set(SharedMimeInfo_FIND_VERSION "${SHARED_MIME_INFO_MINIMUM_VERSION}")
+endif(NOT SharedMimeInfo_FIND_VERSION)
+
+# the minimum version of shared-mime-database we require
+if(NOT SharedMimeInfo_FIND_VERSION)
+ set(SharedMimeInfo_FIND_VERSION "0.18")
+endif(NOT SharedMimeInfo_FIND_VERSION)
+
+find_program (UPDATE_MIME_DATABASE_EXECUTABLE NAMES update-mime-database)
+
+# Store the version number in the cache, so we don't have to search the next time again:
+if (UPDATE_MIME_DATABASE_EXECUTABLE AND NOT SHAREDMIMEINFO_VERSION)
+
+ exec_program (${UPDATE_MIME_DATABASE_EXECUTABLE} ARGS -v RETURN_VALUE _null OUTPUT_VARIABLE _smiVersionRaw)
+
+ string(REGEX REPLACE "update-mime-database \\([a-zA-Z\\-]+\\) ([0-9]\\.[0-9]+).*"
+ "\\1" smiVersion "${_smiVersionRaw}")
+
+ set(SHAREDMIMEINFO_VERSION "${smiVersion}" CACHE STRING "Version number of SharedMimeInfo" FORCE)
+endif (UPDATE_MIME_DATABASE_EXECUTABLE AND NOT SHAREDMIMEINFO_VERSION)
+
+# Use the new FPHSA() syntax:
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(SharedMimeInfo REQUIRED_VARS UPDATE_MIME_DATABASE_EXECUTABLE
+ VERSION_VAR SHAREDMIMEINFO_VERSION )
+
+# For backward compatiblity:
+set(SHARED_MIME_INFO_FOUND ${SHAREDMIMEINFO_FOUND} )
+
+# This should go into MacroLogFeature/FeatureSummary:
+# message(FATAL_ERROR "Could NOT find shared-mime-info. See http://freedesktop.org/wiki/Software/shared-mime-info.")
+
+
+mark_as_advanced(UPDATE_MIME_DATABASE_EXECUTABLE)
+
+
+macro(UPDATE_XDG_MIMETYPES _path)
+ get_filename_component(_xdgmimeDir "${_path}" NAME)
+ if("${_xdgmimeDir}" STREQUAL packages )
+ get_filename_component(_xdgmimeDir "${_path}" PATH)
+ else("${_xdgmimeDir}" STREQUAL packages )
+ set(_xdgmimeDir "${_path}")
+ endif("${_xdgmimeDir}" STREQUAL packages )
+
+ install(CODE "
+set(DESTDIR_VALUE \"\$ENV{DESTDIR}\")
+if (NOT DESTDIR_VALUE)
+ # under Windows relative paths are used, that's why it runs from CMAKE_INSTALL_PREFIX
+ execute_process(COMMAND ${UPDATE_MIME_DATABASE_EXECUTABLE} ${_xdgmimeDir}
+ WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}\")
+endif (NOT DESTDIR_VALUE)
+")
+endmacro (UPDATE_XDG_MIMETYPES)
diff --git a/kdecore/cmake/modules/FindSoprano.cmake b/kdecore/cmake/modules/FindSoprano.cmake
new file mode 100644
index 0000000..b93e027
--- /dev/null
+++ b/kdecore/cmake/modules/FindSoprano.cmake
@@ -0,0 +1,245 @@
+#
+# Find an installation of Soprano
+#
+# Sets the following variables:
+# Soprano_FOUND, SOPRANO_FOUND - true is Soprano has been found
+# SOPRANO_ONTO2VOCABULARYCLASS_EXECUTABLE - the onto2vocabularyclass program, required for adding ontologies
+# SOPRANO_SOPRANOCMD_EXECUTABLE - the sopranocmd program
+# SOPRANO_INCLUDE_DIR - The include directory
+# SOPRANO_LIBRARIES - The Soprano core library to link to (libsoprano)
+# SOPRANO_INDEX_LIBRARIES - The Soprano index library (libsopranoindex)
+# SOPRANO_CLIENT_LIBRARIES - The Soprano client library (libsopranoclient)
+# SOPRANO_SERVER_LIBRARIES - The Soprano server library (libsopranoserver)
+# SOPRANO_VERSION - The Soprano version (string value)
+#
+# SOPRANO_PLUGIN_NQUADPARSER_FOUND - true if the nquadparser plugin is found
+# SOPRANO_PLUGIN_NQUADSERIALIZER_FOUND - true if the nquadserializer plugin is found
+# SOPRANO_PLUGIN_RAPTORPARSER_FOUND - true if the raptorparser plugin is found
+# SOPRANO_PLUGIN_RAPTORSERIALIZER_FOUND - true if the raptorserializer plugin is found
+# SOPRANO_PLUGIN_REDLANDBACKEND_FOUND - true if the redlandbackend plugin is found
+# SOPRANO_PLUGIN_SESAME2BACKEND_FOUND - true if the sesame2backend plugin is found
+# SOPRANO_PLUGIN_VIRTUOSOBACKEND_FOUND - true if the virtuosobackend plugin is found
+#
+# Options:
+# Set SOPRANO_MIN_VERSION to set the minimum required Soprano version (default: 1.99)
+#
+# FindSoprano.cmake supports the COMPONENTS keyword of find_package().
+# If the REQUIRED keyword is used and any of the specified components have not been
+# found, SOPRANO_FOUND will be set to FALSE.
+#
+# The following components are supported:
+# PLUGIN_NQUADPARSER
+# PLUGIN_NQUADSERIALIZER
+# PLUGIN_RAPTORPARSER
+# PLUGIN_RAPTORSERIALIZER
+# PLUGIN_REDLANDBACKEND
+# PLUGIN_SESAME2BACKEND
+# PLUGIN_VIRTUOSOBACKEND
+
+# Copyright (c) 2008, Sebastian Trueg, <sebastian@trueg.de>
+# Copyright (c) 2009, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+include(FindLibraryWithDebug)
+
+find_program(SOPRANO_SOPRANOCMD_EXECUTABLE
+ NAMES sopranocmd
+ HINTS
+ ${BIN_INSTALL_DIR}
+ ${KDE4_BIN_INSTALL_DIR}
+ )
+
+if(NOT WINCE)
+find_program(SOPRANO_ONTO2VOCABULARYCLASS_EXECUTABLE
+ NAMES onto2vocabularyclass
+ HINTS
+ ${BIN_INSTALL_DIR}
+ ${KDE4_BIN_INSTALL_DIR}
+ )
+else(NOT WINCE)
+find_program(SOPRANO_ONTO2VOCABULARYCLASS_EXECUTABLE
+ NAMES onto2vocabularyclass
+ PATHS ${HOST_BINDIR}
+ NO_DEFAULT_PATH
+ )
+endif(NOT WINCE)
+
+
+find_path(SOPRANO_INCLUDE_DIR
+ NAMES
+ soprano/soprano.h
+ HINTS
+ ${INCLUDE_INSTALL_DIR}
+ ${KDE4_INCLUDE_DIR}
+ )
+
+find_library_with_debug(SOPRANO_INDEX_LIBRARIES
+ WIN32_DEBUG_POSTFIX d
+ NAMES
+ sopranoindex
+ HINTS
+ ${LIB_INSTALL_DIR}
+ ${KDE4_LIB_DIR}
+ )
+
+find_library_with_debug(SOPRANO_CLIENT_LIBRARIES
+ WIN32_DEBUG_POSTFIX d
+ NAMES
+ sopranoclient
+ HINTS
+ ${LIB_INSTALL_DIR}
+ ${KDE4_LIB_DIR}
+ )
+
+find_library_with_debug(SOPRANO_LIBRARIES
+ WIN32_DEBUG_POSTFIX d
+ NAMES soprano
+ HINTS
+ ${LIB_INSTALL_DIR}
+ ${KDE4_LIB_DIR}
+)
+
+find_library_with_debug(SOPRANO_SERVER_LIBRARIES
+ WIN32_DEBUG_POSTFIX d
+ NAMES
+ sopranoserver
+ HINTS
+ ${LIB_INSTALL_DIR}
+ ${KDE4_LIB_DIR}
+ )
+
+# check Soprano version
+
+# Support SOPRANO_MIN_VERSION for compatibility:
+if(NOT Soprano_FIND_VERSION)
+ set(Soprano_FIND_VERSION "${SOPRANO_MIN_VERSION}")
+endif(NOT Soprano_FIND_VERSION)
+
+# We set a default for the minimum required version to be backwards compatible
+if(NOT Soprano_FIND_VERSION)
+ set(Soprano_FIND_VERSION "1.99")
+endif(NOT Soprano_FIND_VERSION)
+
+
+if(SOPRANO_INCLUDE_DIR)
+ file(READ ${SOPRANO_INCLUDE_DIR}/soprano/version.h SOPRANO_VERSION_CONTENT)
+ string(REGEX MATCH "SOPRANO_VERSION_STRING \".*\"\n" SOPRANO_VERSION_MATCH "${SOPRANO_VERSION_CONTENT}")
+ if(SOPRANO_VERSION_MATCH)
+ string(REGEX REPLACE "SOPRANO_VERSION_STRING \"(.*)\"\n" "\\1" SOPRANO_VERSION ${SOPRANO_VERSION_MATCH})
+ # find_package_handle_standard_args will do the version checking
+ endif(SOPRANO_VERSION_MATCH)
+endif(SOPRANO_INCLUDE_DIR)
+
+set(_SOPRANO_REQUIRED_COMPONENTS_RESULTS)
+if( Soprano_FIND_COMPONENTS )
+ foreach( _component ${Soprano_FIND_COMPONENTS} )
+ set(_SOPRANO_REQUIRED_COMPONENTS_RESULTS ${_SOPRANO_REQUIRED_COMPONENTS_RESULTS} SOPRANO_${_component}_FOUND)
+ endforeach( _component )
+endif( Soprano_FIND_COMPONENTS )
+
+#look for parser plugins
+if(SOPRANO_INCLUDE_DIR)
+ get_filename_component(_SOPRANO_PREFIX ${SOPRANO_INCLUDE_DIR} PATH)
+
+ find_path(SOPRANO_PLUGIN_ROOT_DIR
+ NAMES
+ soprano/plugins
+ HINTS
+ ${_SOPRANO_PREFIX}/share
+ ${SHARE_INSTALL_PREFIX}
+ PATH_SUFFIXES share
+ )
+ set(SOPRANO_PLUGIN_DIR "${SOPRANO_PLUGIN_ROOT_DIR}/soprano/plugins")
+
+ if(EXISTS ${SOPRANO_PLUGIN_DIR}/nquadparser.desktop)
+ set(SOPRANO_PLUGIN_NQUADPARSER_FOUND TRUE)
+ set(_plugins "${_plugins} nquadparser")
+ endif(EXISTS ${SOPRANO_PLUGIN_DIR}/nquadparser.desktop)
+
+ if(EXISTS ${SOPRANO_PLUGIN_DIR}/nquadserializer.desktop)
+ set(SOPRANO_PLUGIN_NQUADSERIALIZER_FOUND TRUE)
+ set(_plugins "${_plugins} nquadserializer")
+ endif(EXISTS ${SOPRANO_PLUGIN_DIR}/nquadserializer.desktop)
+
+ if(EXISTS ${SOPRANO_PLUGIN_DIR}/raptorparser.desktop)
+ set(SOPRANO_PLUGIN_RAPTORPARSER_FOUND TRUE)
+ set(_plugins "${_plugins} raptorparser")
+ endif(EXISTS ${SOPRANO_PLUGIN_DIR}/raptorparser.desktop)
+
+ if(EXISTS ${SOPRANO_PLUGIN_DIR}/raptorserializer.desktop)
+ set(SOPRANO_PLUGIN_RAPTORSERIALIZER_FOUND TRUE)
+ set(_plugins "${_plugins} raptorserializer")
+ endif(EXISTS ${SOPRANO_PLUGIN_DIR}/raptorserializer.desktop)
+
+ if(EXISTS ${SOPRANO_PLUGIN_DIR}/redlandbackend.desktop)
+ set(SOPRANO_PLUGIN_REDLANDBACKEND_FOUND TRUE)
+ set(_plugins "${_plugins} redlandbackend")
+ endif(EXISTS ${SOPRANO_PLUGIN_DIR}/redlandbackend.desktop)
+
+ if(EXISTS ${SOPRANO_PLUGIN_DIR}/sesame2backend.desktop)
+ set(SOPRANO_PLUGIN_SESAME2BACKEND_FOUND TRUE)
+ set(_plugins "${_plugins} sesame2backend")
+ endif(EXISTS ${SOPRANO_PLUGIN_DIR}/sesame2backend.desktop)
+
+ if(EXISTS ${SOPRANO_PLUGIN_DIR}/virtuosobackend.desktop)
+ set(SOPRANO_PLUGIN_VIRTUOSOBACKEND_FOUND TRUE)
+ set(_plugins "${_plugins} virtuosobackend")
+ endif(EXISTS ${SOPRANO_PLUGIN_DIR}/virtuosobackend.desktop)
+
+ # make sure the Soprano cmake macros are found
+ # We also include it directly for convinience
+ find_file(_SOPRANO_MACRO_FILE NAMES SopranoAddOntology.cmake HINTS ${_SOPRANO_PREFIX}/share/soprano/cmake )
+ if(_SOPRANO_MACRO_FILE)
+ # new Soprano > 2.3.0 location
+ include(${_SOPRANO_MACRO_FILE})
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${_SOPRANO_PREFIX}/share/soprano/cmake)
+ else(_SOPRANO_MACRO_FILE)
+ # the old Soprano 2.3.0 location
+ find_file(_SOPRANO_MACRO_FILE_OLD NAMES SopranoAddOntology.cmake HINTS ${_SOPRANO_PREFIX}/share/apps/cmake/modules )
+ if(_SOPRANO_MACRO_FILE_OLD)
+ include(${_SOPRANO_MACRO_FILE_OLD})
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${_SOPRANO_PREFIX}/share/apps/cmake/modules)
+ endif(_SOPRANO_MACRO_FILE_OLD)
+ endif(_SOPRANO_MACRO_FILE)
+
+endif(SOPRANO_INCLUDE_DIR)
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(Soprano REQUIRED_VARS SOPRANO_INCLUDE_DIR SOPRANO_LIBRARIES
+ ${_SOPRANO_REQUIRED_COMPONENTS_RESULTS}
+ VERSION_VAR SOPRANO_VERSION)
+
+# for compatibility:
+set(Soprano_FOUND ${SOPRANO_FOUND})
+
+# check for all the libs as required to make sure that we do not try to compile with an old version
+
+if(SOPRANO_FOUND AND SOPRANO_INDEX_LIBRARIES)
+ set(SopranoIndex_FOUND TRUE)
+endif(SOPRANO_FOUND AND SOPRANO_INDEX_LIBRARIES)
+
+if(SOPRANO_FOUND AND SOPRANO_CLIENT_LIBRARIES)
+ set(SopranoClient_FOUND TRUE)
+endif(SOPRANO_FOUND AND SOPRANO_CLIENT_LIBRARIES)
+
+if(SOPRANO_FOUND AND SOPRANO_SERVER_LIBRARIES)
+ set(SopranoServer_FOUND TRUE)
+endif(SOPRANO_FOUND AND SOPRANO_SERVER_LIBRARIES)
+
+
+
+mark_as_advanced(SOPRANO_CLIENT_LIBRARIES
+ SOPRANO_INDEX_LIBRARIES
+ SOPRANO_LIBRARIES
+ SOPRANO_SERVER_LIBRARIES
+ SOPRANO_INCLUDE_DIR
+ SOPRANO_PLUGIN_ROOT_DIR
+ _SOPRANO_MACRO_FILE
+ SOPRANO_ONTO2VOCABULARYCLASS_EXECUTABLE
+ SOPRANO_SOPRANOCMD_EXECUTABLE
+ )
+
diff --git a/kdecore/cmake/modules/FindSqlite.cmake b/kdecore/cmake/modules/FindSqlite.cmake
new file mode 100644
index 0000000..c4f2e90
--- /dev/null
+++ b/kdecore/cmake/modules/FindSqlite.cmake
@@ -0,0 +1,50 @@
+# - Try to find Sqlite
+# Once done this will define
+#
+# SQLITE_FOUND - system has Sqlite
+# SQLITE_INCLUDE_DIR - the Sqlite include directory
+# SQLITE_LIBRARIES - Link these to use Sqlite
+# SQLITE_DEFINITIONS - Compiler switches required for using Sqlite
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+
+# Copyright (c) 2008, Gilles Caulier, <caulier.gilles@gmail.com>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if ( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES )
+ # in cache already
+ SET(Sqlite_FIND_QUIETLY TRUE)
+endif ( SQLITE_INCLUDE_DIR AND SQLITE_LIBRARIES )
+
+# use pkg-config to get the directories and then use these values
+# in the FIND_PATH() and FIND_LIBRARY() calls
+if( NOT WIN32 )
+ find_package(PkgConfig)
+
+ pkg_check_modules(PC_SQLITE QUIET sqlite3)
+
+ set(SQLITE_DEFINITIONS ${PC_SQLITE_CFLAGS_OTHER})
+endif( NOT WIN32 )
+
+find_path(SQLITE_INCLUDE_DIR NAMES sqlite3.h
+ PATHS
+ ${PC_SQLITE_INCLUDEDIR}
+ ${PC_SQLITE_INCLUDE_DIRS}
+)
+
+find_library(SQLITE_LIBRARIES NAMES sqlite3
+ PATHS
+ ${PC_SQLITE_LIBDIR}
+ ${PC_SQLITE_LIBRARY_DIRS}
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Sqlite DEFAULT_MSG SQLITE_INCLUDE_DIR SQLITE_LIBRARIES )
+
+# show the SQLITE_INCLUDE_DIR and SQLITE_LIBRARIES variables only in the advanced view
+mark_as_advanced(SQLITE_INCLUDE_DIR SQLITE_LIBRARIES )
+
diff --git a/kdecore/cmake/modules/FindStrigi.cmake b/kdecore/cmake/modules/FindStrigi.cmake
new file mode 100644
index 0000000..239f9c9
--- /dev/null
+++ b/kdecore/cmake/modules/FindStrigi.cmake
@@ -0,0 +1,148 @@
+# - Try to find Strigi, a fast and small desktop search program (http://strigi.sourceforge.net )
+# Once done this will define
+#
+# STRIGI_FOUND - system has Strigi
+# STRIGI_INCLUDE_DIR - the Strigi include directory
+# STRIGI_STREAMANALYZER_LIBRARY - Link these to use Strigi streamanalyzer
+# STRIGI_STREAMS_LIBRARY - Link these to use Strigi streams
+# STRIGI_LINE_ANALYZER_PREFIX - strigi plugin prefix
+# STRIGI_THROUGH_ANALYZER_PREFIX - strigi plugin prefix
+
+# Copyright (c) 2008, Jos van den Oever, <jos@vandenoever.info>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if(NOT STRIGI_MIN_VERSION)
+ set(STRIGI_MIN_VERSION "0.5.9")
+endif(NOT STRIGI_MIN_VERSION)
+
+file(TO_CMAKE_PATH "$ENV{STRIGI_HOME}" strigi_home)
+
+set(_Strigi_FIND_QUIETLY ${Strigi_FIND_QUIETLY})
+# Try to find and load the StrigiConfig.cmake installed by kdesupport/strigi
+find_package(Strigi QUIET NO_MODULE PATHS "${strigi_home}/lib/strigi" "${strigi_home}/lib64/strigi")
+set(Strigi_FIND_QUIETLY ${_Strigi_FIND_QUIETLY})
+
+# If StrigiConfig.cmake (installed by kdesupport/Strigi) has been found
+# and it contains all necessary information (since November 16th, 2008), use the information
+# included there, otherwise search it in the same way as any non-cmake project.
+# This variable is set by StrigiConfig.cmake . Alex
+if (STRIGI_CONFIG_FOUND_AND_HAS_COMPLETE_INFORMATION)
+ set (_strigiErrorMessage "Couldn't find Strigi streams and streamanalyzer libraries. Set the environment variable STRIGI_HOME (or CMAKE_PREFIX_PATH) to the strigi install dir.")
+ set(STRIGI_VERSION_OK TRUE)
+ if(STRIGI_VERSION VERSION_LESS ${STRIGI_MIN_VERSION})
+ set(_strigiErrorMessage "Strigi version ${STRIGI_VERSION} found, but at least version ${STRIGI_MIN_VERSION} is required")
+ set(STRIGI_VERSION_OK FALSE)
+ endif(STRIGI_VERSION VERSION_LESS ${STRIGI_MIN_VERSION})
+
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(Strigi
+ "${_strigiErrorMessage}"
+ STRIGI_STREAMS_LIBRARY STRIGI_STREAMANALYZER_LIBRARY STRIGI_INCLUDE_DIR STRIGI_VERSION_OK)
+
+else(STRIGI_CONFIG_FOUND_AND_HAS_COMPLETE_INFORMATION)
+ # this else() branch is for finding strigi versions before November 16th, 2008. Alex
+ include(FindLibraryWithDebug)
+ include(MacroPushRequiredVars)
+
+ if (WIN32)
+ file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _program_FILES_DIR)
+ endif(WIN32)
+
+ if (NOT WIN32)
+ if(NOT strigi_home)
+ find_package(PkgConfig)
+ if(PKG_CONFIG_EXECUTABLE)
+ pkg_check_modules(STRIGI QUIET libstreamanalyzer>=${STRIGI_MIN_VERSION})
+ endif(PKG_CONFIG_EXECUTABLE)
+ endif(NOT strigi_home)
+ endif(NOT WIN32)
+
+ if (NOT STRIGI_INCLUDEDIR)
+ find_path(STRIGI_INCLUDE_DIR strigi/streamanalyzer.h
+ PATHS
+ ${strigi_home}/include
+ ${STRIGI_INCLUDEDIR}
+ ${_program_FILES_DIR}/strigi/include
+ )
+ set( STRIGI_INCLUDEDIR ${STRIGI_INCLUDE_DIR} )
+ else (NOT STRIGI_INCLUDEDIR)
+ set( STRIGI_INCLUDE_DIR ${STRIGI_INCLUDEDIR} )
+ endif (NOT STRIGI_INCLUDEDIR)
+
+
+ find_library_with_debug(STRIGI_STREAMANALYZER_LIBRARY
+ WIN32_DEBUG_POSTFIX d
+ NAMES streamanalyzer
+ PATHS
+ ${strigi_home}/lib
+ ${STRIGI_LIBRARY_DIRS}
+ ${_program_FILES_DIR}/strigi/lib
+ )
+
+ find_library_with_debug(STRIGI_STREAMS_LIBRARY
+ WIN32_DEBUG_POSTFIX d
+ NAMES streams
+ PATHS
+ ${strigi_home}/lib
+ ${STRIGI_LIBRARY_DIRS}
+ ${_program_FILES_DIR}/strigi/lib
+ )
+
+ find_library_with_debug(STRIGI_STRIGIQTDBUSCLIENT_LIBRARY
+ WIN32_DEBUG_POSTFIX d
+ NAMES strigiqtdbusclient
+ PATHS
+ ${strigi_home}/lib
+ ${STRIGI_LIBRARY_DIRS}
+ ${_program_FILES_DIR}/strigi/lib
+ )
+
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(Strigi
+ "Couldn't find Strigi streams and streamanalyzer libraries. Set the environment variable STRIGI_HOME (or CMAKE_PREFIX_PATH if using CMake >=2.6) to the strigi install dir."
+ STRIGI_STREAMS_LIBRARY STRIGI_STREAMANALYZER_LIBRARY STRIGI_INCLUDE_DIR)
+
+ if (STRIGI_FOUND)
+ set( STRIGI_NEEDS_SIGNED_CHAR TRUE CACHE BOOL "TRUE if strigi is 0.6.0 or later" )
+ set( STRIGI_NEEDS_CHAR FALSE CACHE BOOL "TRUE if strigi is 0.5.9 or before" )
+ endif (STRIGI_FOUND)
+
+endif (STRIGI_CONFIG_FOUND_AND_HAS_COMPLETE_INFORMATION)
+
+
+if(WIN32)
+ # this is needed to have mingw, cygwin and msvc libs installed in one directory
+ if(MSVC)
+ set(STRIGI_LINE_ANALYZER_PREFIX msvc_strigila_)
+ set(STRIGI_THROUGH_ANALYZER_PREFIX msvc_strigita_)
+ elseif(CYGWIN)
+ set(STRIGI_LINE_ANALYZER_PREFIX cyg_strigila_)
+ set(STRIGI_THROUGH_ANALYZER_PREFIX cyg_strigita_)
+ elseif(MINGW)
+ set(STRIGI_LINE_ANALYZER_PREFIX mingw_strigila_)
+ set(STRIGI_THROUGH_ANALYZER_PREFIX mingw_strigita_)
+ endif(MSVC)
+else(WIN32)
+ set(STRIGI_LINE_ANALYZER_PREFIX strigila_)
+ set(STRIGI_THROUGH_ANALYZER_PREFIX strigita_)
+endif(WIN32)
+
+mark_as_advanced(
+ STRIGI_INCLUDE_DIR
+ STRIGI_STREAMANALYZER_LIBRARY
+ STRIGI_STREAMANALYZER_LIBRARY_DEBUG
+ STRIGI_STREAMANALYZER_LIBRARY_RELEASE
+ STRIGI_STREAMS_LIBRARY
+ STRIGI_STREAMS_LIBRARY_DEBUG
+ STRIGI_STREAMS_LIBRARY_RELEASE
+ STRIGI_STRIGIQTDBUSCLIENT_LIBRARY
+ STRIGI_STRIGIQTDBUSCLIENT_LIBRARY_DEBUG
+ STRIGI_STRIGIQTDBUSCLIENT_LIBRARY_RELEASE
+ STRIGI_LINE_ANALYZER_PREFIX
+ STRIGI_THROUGH_ANALYZER_PREFIX
+ STRIGI_NEEDS_SIGNED_CHAR
+ STRIGI_NEEDS_CHAR
+)
diff --git a/kdecore/cmake/modules/FindTaglib.cmake b/kdecore/cmake/modules/FindTaglib.cmake
new file mode 100644
index 0000000..5bbb8ee
--- /dev/null
+++ b/kdecore/cmake/modules/FindTaglib.cmake
@@ -0,0 +1,85 @@
+# - Try to find the Taglib library
+# Once done this will define
+#
+# TAGLIB_FOUND - system has the taglib library
+# TAGLIB_CFLAGS - the taglib cflags
+# TAGLIB_LIBRARIES - The libraries needed to use taglib
+
+# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if(NOT TAGLIB_MIN_VERSION)
+ set(TAGLIB_MIN_VERSION "1.4")
+endif(NOT TAGLIB_MIN_VERSION)
+
+if(NOT WIN32)
+ find_program(TAGLIBCONFIG_EXECUTABLE NAMES taglib-config PATHS
+ ${BIN_INSTALL_DIR}
+ )
+endif(NOT WIN32)
+
+#reset vars
+set(TAGLIB_LIBRARIES)
+set(TAGLIB_CFLAGS)
+
+# if taglib-config has been found
+if(TAGLIBCONFIG_EXECUTABLE)
+
+ exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --version RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_VERSION)
+
+ if(TAGLIB_VERSION STRLESS "${TAGLIB_MIN_VERSION}")
+ message(STATUS "TagLib version not found: version searched :${TAGLIB_MIN_VERSION}, found ${TAGLIB_VERSION}")
+ set(TAGLIB_FOUND FALSE)
+ else(TAGLIB_VERSION STRLESS "${TAGLIB_MIN_VERSION}")
+
+ exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --libs RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_LIBRARIES)
+
+ exec_program(${TAGLIBCONFIG_EXECUTABLE} ARGS --cflags RETURN_VALUE _return_VALUE OUTPUT_VARIABLE TAGLIB_CFLAGS)
+
+ if(TAGLIB_LIBRARIES AND TAGLIB_CFLAGS)
+ set(TAGLIB_FOUND TRUE)
+ message(STATUS "Found taglib: ${TAGLIB_LIBRARIES}")
+ endif(TAGLIB_LIBRARIES AND TAGLIB_CFLAGS)
+ string(REGEX REPLACE " *-I" ";" TAGLIB_INCLUDES "${TAGLIB_CFLAGS}")
+ endif(TAGLIB_VERSION STRLESS "${TAGLIB_MIN_VERSION}")
+ mark_as_advanced(TAGLIB_CFLAGS TAGLIB_LIBRARIES TAGLIB_INCLUDES)
+
+else(TAGLIBCONFIG_EXECUTABLE)
+
+ include(FindLibraryWithDebug)
+ include(FindPackageHandleStandardArgs)
+
+ find_path(TAGLIB_INCLUDES
+ NAMES
+ tag.h
+ PATH_SUFFIXES taglib
+ PATHS
+ ${KDE4_INCLUDE_DIR}
+ ${INCLUDE_INSTALL_DIR}
+ )
+
+ find_library_with_debug(TAGLIB_LIBRARIES
+ WIN32_DEBUG_POSTFIX d
+ NAMES tag
+ PATHS
+ ${KDE4_LIB_DIR}
+ ${LIB_INSTALL_DIR}
+ )
+
+ find_package_handle_standard_args(Taglib DEFAULT_MSG
+ TAGLIB_INCLUDES TAGLIB_LIBRARIES)
+endif(TAGLIBCONFIG_EXECUTABLE)
+
+
+if(TAGLIB_FOUND)
+ if(NOT Taglib_FIND_QUIETLY AND TAGLIBCONFIG_EXECUTABLE)
+ message(STATUS "Taglib found: ${TAGLIB_LIBRARIES}")
+ endif(NOT Taglib_FIND_QUIETLY AND TAGLIBCONFIG_EXECUTABLE)
+else(TAGLIB_FOUND)
+ if(Taglib_FIND_REQUIRED)
+ message(FATAL_ERROR "Could not find Taglib")
+ endif(Taglib_FIND_REQUIRED)
+endif(TAGLIB_FOUND)
+
diff --git a/kdecore/cmake/modules/FindUDev.cmake b/kdecore/cmake/modules/FindUDev.cmake
new file mode 100644
index 0000000..4c8390d
--- /dev/null
+++ b/kdecore/cmake/modules/FindUDev.cmake
@@ -0,0 +1,19 @@
+# - Try to find UDev
+# Once done this will define
+#
+# UDEV_FOUND - system has UDev
+# UDEV_INCLUDE_DIR - the libudev include directory
+# UDEV_LIBS - The libudev libraries
+
+# Copyright (c) 2010, Rafael Fernández López, <ereslibre@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+find_path(UDEV_INCLUDE_DIR libudev.h)
+find_library(UDEV_LIBS udev)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(UDev DEFAULT_MSG UDEV_INCLUDE_DIR UDEV_LIBS)
+
+mark_as_advanced(UDEV_INCLUDE_DIR UDEV_LIBS)
diff --git a/kdecore/cmake/modules/FindUSB.cmake b/kdecore/cmake/modules/FindUSB.cmake
new file mode 100644
index 0000000..f0178a3
--- /dev/null
+++ b/kdecore/cmake/modules/FindUSB.cmake
@@ -0,0 +1,30 @@
+# - Try to find the freetype library
+# Once done this defines
+#
+# LIBUSB_FOUND - system has libusb
+# LIBUSB_INCLUDE_DIR - the libusb include directory
+# LIBUSB_LIBRARIES - Link these to use libusb
+
+# Copyright (c) 2006, 2008 Laurent Montel, <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ find_package(PkgConfig)
+ pkg_check_modules(PC_LIBUSB QUIET libusb)
+endif(NOT WIN32)
+
+find_path(LIBUSB_INCLUDE_DIR usb.h
+ HINTS ${PC_LIBUSB_INCLUDEDIR} ${PC_LIBUSB_INCLUDE_DIRS})
+
+find_library(LIBUSB_LIBRARIES NAMES usb
+ HINTS ${PC_LIBUSB_LIBDIR} ${PC_LIBUSB_LIBRARY_DIRS})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LIBUSB DEFAULT_MSG LIBUSB_LIBRARIES LIBUSB_INCLUDE_DIR)
+
+mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES)
diff --git a/kdecore/cmake/modules/FindWcecompat.cmake b/kdecore/cmake/modules/FindWcecompat.cmake
new file mode 100644
index 0000000..f3c26c3
--- /dev/null
+++ b/kdecore/cmake/modules/FindWcecompat.cmake
@@ -0,0 +1,25 @@
+# Try to find Wcecompat functionality
+# Once done this will define
+#
+# WCECOMPAT_FOUND - system has Wcecompat
+# WCECOMPAT_INCLUDE_DIR - Wcecompat include directory
+# WCECOMPAT_LIBRARIES - Libraries needed to use Wcecompat
+#
+# Copyright (c) 2010, Andreas Holzammer, <andy@kdab.com>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+
+find_path(WCECOMPAT_INCLUDE_DIR errno.h PATH_SUFFIXES wcecompat)
+
+set(WCECOMPAT_LIB_FOUND FALSE)
+
+if(WCECOMPAT_INCLUDE_DIR)
+ find_library(WCECOMPAT_LIBRARIES NAMES wcecompat wcecompatex )
+
+ if(WCECOMPAT_LIBRARIES)
+ set(WCECOMPAT_LIB_FOUND TRUE)
+ endif(WCECOMPAT_LIBRARIES)
+endif(WCECOMPAT_INCLUDE_DIR)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Wcecompat DEFAULT_MSG WCECOMPAT_LIBRARIES WCECOMPAT_LIB_FOUND)
diff --git a/kdecore/cmake/modules/FindX11.cmake b/kdecore/cmake/modules/FindX11.cmake
new file mode 100644
index 0000000..f2f879d
--- /dev/null
+++ b/kdecore/cmake/modules/FindX11.cmake
@@ -0,0 +1,455 @@
+# - Find X11 installation
+# Try to find X11 on UNIX systems. The following values are defined
+# X11_FOUND - True if X11 is available
+# X11_INCLUDE_DIR - include directories to use X11
+# X11_LIBRARIES - link against these to use X11
+#
+# and also the following more fine grained variables:
+# X11_ICE_INCLUDE_PATH, X11_ICE_LIB, X11_ICE_FOUND
+# X11_SM_INCLUDE_PATH, X11_SM_LIB, X11_SM_FOUND
+# X11_X11_INCLUDE_PATH, X11_X11_LIB
+# X11_Xaccessrules_INCLUDE_PATH, X11_Xaccess_FOUND
+# X11_Xaccessstr_INCLUDE_PATH, X11_Xaccess_FOUND
+# X11_Xau_INCLUDE_PATH, X11_Xau_LIB, X11_Xau_FOUND
+# X11_Xcomposite_INCLUDE_PATH, X11_Xcomposite_LIB, X11_Xcomposite_FOUND
+# X11_Xcursor_INCLUDE_PATH, X11_Xcursor_LIB, X11_Xcursor_FOUND
+# X11_Xdamage_INCLUDE_PATH, X11_Xdamage_LIB, X11_Xdamage_FOUND
+# X11_Xdmcp_INCLUDE_PATH, X11_Xdmcp_LIB, X11_Xdmcp_FOUND
+# X11_Xext_LIB, X11_Xext_FOUND
+# X11_dpms_INCLUDE_PATH, (in X11_Xext_LIB), X11_dpms_FOUND
+# X11_XShm_INCLUDE_PATH, (in X11_Xext_LIB), X11_XShm_FOUND
+# X11_Xshape_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xshape_FOUND
+# X11_xf86misc_INCLUDE_PATH, X11_Xxf86misc_LIB, X11_xf86misc_FOUND
+# X11_xf86vmode_INCLUDE_PATH, X11_xf86vmode_FOUND
+# X11_Xfixes_INCLUDE_PATH, X11_Xfixes_LIB, X11_Xfixes_FOUND
+# X11_Xft_INCLUDE_PATH, X11_Xft_LIB, X11_Xft_FOUND
+# X11_Xinerama_INCLUDE_PATH, X11_Xinerama_LIB, X11_Xinerama_FOUND
+# X11_Xinput_INCLUDE_PATH, X11_Xinput_LIB, X11_Xinput_FOUND
+# X11_Xkb_INCLUDE_PATH, X11_Xkb_FOUND
+# X11_Xkblib_INCLUDE_PATH, X11_Xkb_FOUND
+# X11_Xkbfile_INCLUDE_PATH, X11_Xkbfile_LIB, X11_Xkbfile_FOUND
+# X11_Xpm_INCLUDE_PATH, X11_Xpm_LIB, X11_Xpm_FOUND
+# X11_XTest_INCLUDE_PATH, X11_XTest_LIB, X11_XTest_FOUND
+# X11_Xrandr_INCLUDE_PATH, X11_Xrandr_LIB, X11_Xrandr_FOUND
+# X11_Xrender_INCLUDE_PATH, X11_Xrender_LIB, X11_Xrender_FOUND
+# X11_Xscreensaver_INCLUDE_PATH, X11_Xscreensaver_LIB, X11_Xscreensaver_FOUND
+# X11_Xt_INCLUDE_PATH, X11_Xt_LIB, X11_Xt_FOUND
+# X11_Xutil_INCLUDE_PATH, X11_Xutil_FOUND
+# X11_Xv_INCLUDE_PATH, X11_Xv_LIB, X11_Xv_FOUND
+# X11_XSync_INCLUDE_PATH, (in X11_Xext_LIB), X11_XSync_FOUND
+
+# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
+# See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
+
+IF (UNIX)
+ SET(X11_FOUND 0)
+ # X11 is never a framework and some header files may be
+ # found in tcl on the mac
+ SET(CMAKE_FIND_FRAMEWORK_SAVE ${CMAKE_FIND_FRAMEWORK})
+ SET(CMAKE_FIND_FRAMEWORK NEVER)
+ SET(X11_INC_SEARCH_PATH
+ /usr/pkg/xorg/include
+ /usr/X11R6/include
+ /usr/X11R7/include
+ /usr/include/X11
+ /usr/openwin/include
+ /usr/openwin/share/include
+ /opt/graphics/OpenGL/include
+ )
+
+ SET(X11_LIB_SEARCH_PATH
+ /usr/pkg/xorg/lib
+ /usr/X11R6/lib
+ /usr/X11R7/lib
+ /usr/openwin/lib
+ )
+
+ FIND_PATH(X11_X11_INCLUDE_PATH X11/X.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xlib_INCLUDE_PATH X11/Xlib.h ${X11_INC_SEARCH_PATH})
+
+ # Look for includes; keep the list sorted by name of the cmake *_INCLUDE_PATH
+ # variable (which doesn't need to match the include file name).
+
+ # Solaris lacks XKBrules.h, so we should skip kxkbd there.
+ FIND_PATH(X11_ICE_INCLUDE_PATH X11/ICE/ICE.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_SM_INCLUDE_PATH X11/SM/SM.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xaccessrules_INCLUDE_PATH X11/extensions/XKBrules.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xaccessstr_INCLUDE_PATH X11/extensions/XKBstr.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xau_INCLUDE_PATH X11/Xauth.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xcomposite_INCLUDE_PATH X11/extensions/Xcomposite.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xcursor_INCLUDE_PATH X11/Xcursor/Xcursor.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xdamage_INCLUDE_PATH X11/extensions/Xdamage.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xdmcp_INCLUDE_PATH X11/Xdmcp.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_dpms_INCLUDE_PATH X11/extensions/dpms.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_xf86misc_INCLUDE_PATH X11/extensions/xf86misc.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_xf86vmode_INCLUDE_PATH X11/extensions/xf86vmode.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xfixes_INCLUDE_PATH X11/extensions/Xfixes.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xft_INCLUDE_PATH X11/Xft/Xft.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xinerama_INCLUDE_PATH X11/extensions/Xinerama.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xinput_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xkb_INCLUDE_PATH X11/extensions/XKB.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xkblib_INCLUDE_PATH X11/XKBlib.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xpm_INCLUDE_PATH X11/xpm.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_XTest_INCLUDE_PATH X11/extensions/XTest.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_XShm_INCLUDE_PATH X11/extensions/XShm.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xrandr_INCLUDE_PATH X11/extensions/Xrandr.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xrender_INCLUDE_PATH X11/extensions/Xrender.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xscreensaver_INCLUDE_PATH X11/extensions/scrnsaver.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xshape_INCLUDE_PATH X11/extensions/shape.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xutil_INCLUDE_PATH X11/Xutil.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xt_INCLUDE_PATH X11/Intrinsic.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_Xv_INCLUDE_PATH X11/extensions/Xvlib.h ${X11_INC_SEARCH_PATH})
+ FIND_PATH(X11_XSync_INCLUDE_PATH X11/extensions/sync.h ${X11_INC_SEARCH_PATH})
+
+
+ FIND_LIBRARY(X11_X11_LIB X11 ${X11_LIB_SEARCH_PATH})
+
+ # Find additional X libraries. Keep list sorted by library name.
+ FIND_LIBRARY(X11_ICE_LIB ICE ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_SM_LIB SM ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_Xau_LIB Xau ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_Xcomposite_LIB Xcomposite ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_Xcursor_LIB Xcursor ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_Xdamage_LIB Xdamage ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_Xdmcp_LIB Xdmcp ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_Xext_LIB Xext ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_Xfixes_LIB Xfixes ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_Xft_LIB Xft ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_Xinerama_LIB Xinerama ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_Xinput_LIB Xi ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_Xkbfile_LIB xkbfile ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_Xpm_LIB Xpm ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_Xrandr_LIB Xrandr ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_Xrender_LIB Xrender ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_Xscreensaver_LIB Xss ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_Xt_LIB Xt ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_XTest_LIB Xtst ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_Xv_LIB Xv ${X11_LIB_SEARCH_PATH})
+ FIND_LIBRARY(X11_Xxf86misc_LIB Xxf86misc ${X11_LIB_SEARCH_PATH})
+
+ SET(X11_LIBRARY_DIR "")
+ IF(X11_X11_LIB)
+ GET_FILENAME_COMPONENT(X11_LIBRARY_DIR ${X11_X11_LIB} PATH)
+ ENDIF(X11_X11_LIB)
+
+ SET(X11_INCLUDE_DIR) # start with empty list
+ IF(X11_X11_INCLUDE_PATH)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_X11_INCLUDE_PATH})
+ ENDIF(X11_X11_INCLUDE_PATH)
+
+ IF(X11_Xlib_INCLUDE_PATH)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xlib_INCLUDE_PATH})
+ ENDIF(X11_Xlib_INCLUDE_PATH)
+
+ IF(X11_Xutil_INCLUDE_PATH)
+ SET(X11_Xutil_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xutil_INCLUDE_PATH})
+ ENDIF(X11_Xutil_INCLUDE_PATH)
+
+ IF(X11_Xshape_INCLUDE_PATH)
+ SET(X11_Xshape_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xshape_INCLUDE_PATH})
+ ENDIF(X11_Xshape_INCLUDE_PATH)
+
+ SET(X11_LIBRARIES) # start with empty list
+ IF(X11_X11_LIB)
+ SET(X11_LIBRARIES ${X11_LIBRARIES} ${X11_X11_LIB})
+ ENDIF(X11_X11_LIB)
+
+ IF(X11_Xext_LIB)
+ SET(X11_Xext_FOUND TRUE)
+ SET(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xext_LIB})
+ ENDIF(X11_Xext_LIB)
+
+ IF(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH)
+ SET(X11_Xt_FOUND TRUE)
+ ENDIF(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH)
+
+ IF(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH)
+ SET(X11_Xft_FOUND TRUE)
+ SET(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xft_LIB})
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xft_INCLUDE_PATH})
+ ENDIF(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH)
+
+ IF(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH)
+ SET(X11_Xv_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xv_INCLUDE_PATH})
+ ENDIF(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH)
+
+ IF (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH)
+ SET(X11_Xau_FOUND TRUE)
+ SET(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xau_LIB})
+ ENDIF (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH)
+
+ IF (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB)
+ SET(X11_Xdmcp_FOUND TRUE)
+ SET(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xdmcp_LIB})
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdmcp_INCLUDE_PATH})
+ ENDIF (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB)
+
+ IF (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH)
+ SET(X11_Xaccess_FOUND TRUE)
+ SET(X11_Xaccess_INCLUDE_PATH ${X11_Xaccessstr_INCLUDE_PATH})
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xaccess_INCLUDE_PATH})
+ ENDIF (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH)
+
+ IF (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB)
+ SET(X11_Xpm_FOUND TRUE)
+ SET(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xpm_LIB})
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xpm_INCLUDE_PATH})
+ ENDIF (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB)
+
+ IF (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB)
+ SET(X11_Xcomposite_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcomposite_INCLUDE_PATH})
+ ENDIF (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB)
+
+ IF (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB)
+ SET(X11_Xdamage_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdamage_INCLUDE_PATH})
+ ENDIF (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB)
+
+ IF (X11_XShm_INCLUDE_PATH)
+ SET(X11_XShm_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XShm_INCLUDE_PATH})
+ ENDIF (X11_XShm_INCLUDE_PATH)
+
+ IF (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB)
+ SET(X11_XTest_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XTest_INCLUDE_PATH})
+ ENDIF (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB)
+
+ IF (X11_Xinerama_INCLUDE_PATH AND X11_Xinerama_LIB)
+ SET(X11_Xinerama_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinerama_INCLUDE_PATH})
+ ENDIF (X11_Xinerama_INCLUDE_PATH AND X11_Xinerama_LIB)
+
+ IF (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB)
+ SET(X11_Xfixes_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xfixes_INCLUDE_PATH})
+ ENDIF (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB)
+
+ IF (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB)
+ SET(X11_Xrender_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrender_INCLUDE_PATH})
+ ENDIF (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB)
+
+ IF (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB)
+ SET(X11_Xrandr_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrandr_INCLUDE_PATH})
+ ENDIF (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB)
+
+ IF (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB)
+ SET(X11_xf86misc_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86misc_INCLUDE_PATH})
+ ENDIF (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB)
+
+ IF (X11_xf86vmode_INCLUDE_PATH)
+ SET(X11_xf86vmode_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86vmode_INCLUDE_PATH})
+ ENDIF (X11_xf86vmode_INCLUDE_PATH)
+
+ IF (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB)
+ SET(X11_Xcursor_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcursor_INCLUDE_PATH})
+ ENDIF (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB)
+
+ IF (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB)
+ SET(X11_Xscreensaver_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xscreensaver_INCLUDE_PATH})
+ ENDIF (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB)
+ SET(X11_Xss_FOUND ${X11_Xscreensaver_FOUND})
+ SET(X11_Xss_LIB ${X11_Xscreensaver_LIB})
+
+
+ IF (X11_dpms_INCLUDE_PATH)
+ SET(X11_dpms_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_dpms_INCLUDE_PATH})
+ ENDIF (X11_dpms_INCLUDE_PATH)
+
+ IF (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH)
+ SET(X11_Xkb_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkb_INCLUDE_PATH} )
+ ENDIF (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH)
+
+ IF (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH)
+ SET(X11_Xkbfile_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkbfile_INCLUDE_PATH} )
+ ENDIF (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH)
+
+ IF (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB)
+ SET(X11_Xinput_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinput_INCLUDE_PATH})
+ ENDIF (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB)
+
+ IF (X11_XSync_INCLUDE_PATH)
+ SET(X11_XSync_FOUND TRUE)
+ SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XSync_INCLUDE_PATH})
+ ENDIF (X11_XSync_INCLUDE_PATH)
+
+ IF(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH)
+ SET(X11_ICE_FOUND TRUE)
+ ENDIF(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH)
+
+ IF(X11_SM_LIB AND X11_SM_INCLUDE_PATH)
+ SET(X11_SM_FOUND TRUE)
+ ENDIF(X11_SM_LIB AND X11_SM_INCLUDE_PATH)
+
+ # Deprecated variable for backwards compatibility with CMake 1.4
+ IF (X11_X11_INCLUDE_PATH AND X11_LIBRARIES)
+ SET(X11_FOUND 1)
+ ENDIF (X11_X11_INCLUDE_PATH AND X11_LIBRARIES)
+
+ IF(X11_FOUND)
+ INCLUDE(CheckFunctionExists)
+ INCLUDE(CheckLibraryExists)
+
+ # Translated from an autoconf-generated configure script.
+ # See libs.m4 in autoconf's m4 directory.
+ IF($ENV{ISC} MATCHES "^yes$")
+ SET(X11_X_EXTRA_LIBS -lnsl_s -linet)
+ ELSE($ENV{ISC} MATCHES "^yes$")
+ SET(X11_X_EXTRA_LIBS "")
+
+ # See if XOpenDisplay in X11 works by itself.
+ CHECK_LIBRARY_EXISTS("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO)
+ IF(NOT X11_LIB_X11_SOLO)
+ # Find library needed for dnet_ntoa.
+ CHECK_LIBRARY_EXISTS("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
+ IF (X11_LIB_DNET_HAS_DNET_NTOA)
+ SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
+ ELSE (X11_LIB_DNET_HAS_DNET_NTOA)
+ CHECK_LIBRARY_EXISTS("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
+ IF (X11_LIB_DNET_STUB_HAS_DNET_NTOA)
+ SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
+ ENDIF (X11_LIB_DNET_STUB_HAS_DNET_NTOA)
+ ENDIF (X11_LIB_DNET_HAS_DNET_NTOA)
+ ENDIF(NOT X11_LIB_X11_SOLO)
+
+ # Find library needed for gethostbyname.
+ CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
+ IF(NOT CMAKE_HAVE_GETHOSTBYNAME)
+ CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+ IF (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+ SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
+ ELSE (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+ CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
+ IF (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
+ SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
+ ENDIF (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
+ ENDIF (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+ ENDIF(NOT CMAKE_HAVE_GETHOSTBYNAME)
+
+ # Find library needed for connect.
+ CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT)
+ IF(NOT CMAKE_HAVE_CONNECT)
+ CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
+ IF (CMAKE_LIB_SOCKET_HAS_CONNECT)
+ SET (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
+ ENDIF (CMAKE_LIB_SOCKET_HAS_CONNECT)
+ ENDIF(NOT CMAKE_HAVE_CONNECT)
+
+ # Find library needed for remove.
+ CHECK_FUNCTION_EXISTS("remove" CMAKE_HAVE_REMOVE)
+ IF(NOT CMAKE_HAVE_REMOVE)
+ CHECK_LIBRARY_EXISTS("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
+ IF (CMAKE_LIB_POSIX_HAS_REMOVE)
+ SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
+ ENDIF (CMAKE_LIB_POSIX_HAS_REMOVE)
+ ENDIF(NOT CMAKE_HAVE_REMOVE)
+
+ # Find library needed for shmat.
+ CHECK_FUNCTION_EXISTS("shmat" CMAKE_HAVE_SHMAT)
+ IF(NOT CMAKE_HAVE_SHMAT)
+ CHECK_LIBRARY_EXISTS("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
+ IF (CMAKE_LIB_IPS_HAS_SHMAT)
+ SET (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
+ ENDIF (CMAKE_LIB_IPS_HAS_SHMAT)
+ ENDIF(NOT CMAKE_HAVE_SHMAT)
+ ENDIF($ENV{ISC} MATCHES "^yes$")
+
+ IF (X11_SM_FOUND)
+ SET (X11_X_PRE_LIBS ${X11_X_PRE_LIBS} ${X11_SM_LIB})
+ ENDIF (X11_SM_FOUND)
+
+ IF (X11_ICE_FOUND)
+ CHECK_LIBRARY_EXISTS("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
+ CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
+ IF(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
+ SET (X11_X_PRE_LIBS ${X11_X_PRE_LIBS} ${X11_ICE_LIB})
+ ENDIF(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
+ ENDIF (X11_ICE_FOUND)
+
+ # Build the final list of libraries.
+ SET(X11_LIBRARIES ${X11_X_PRE_LIBS} ${X11_LIBRARIES} ${X11_X_EXTRA_LIBS})
+
+ MESSAGE(STATUS "Found X11: ${X11_X11_LIB}")
+ ELSE (X11_FOUND)
+ IF (X11_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find X11")
+ ENDIF (X11_FIND_REQUIRED)
+ ENDIF (X11_FOUND)
+
+ MARK_AS_ADVANCED(
+ X11_X11_INCLUDE_PATH
+ X11_X11_LIB
+ X11_Xext_LIB
+ X11_Xau_LIB
+ X11_Xau_INCLUDE_PATH
+ X11_Xlib_INCLUDE_PATH
+ X11_Xutil_INCLUDE_PATH
+ X11_Xcomposite_INCLUDE_PATH
+ X11_Xcomposite_LIB
+ X11_Xaccess_INCLUDE_PATH
+ X11_Xfixes_LIB
+ X11_Xfixes_INCLUDE_PATH
+ X11_Xrandr_LIB
+ X11_Xrandr_INCLUDE_PATH
+ X11_Xdamage_LIB
+ X11_Xdamage_INCLUDE_PATH
+ X11_Xrender_LIB
+ X11_Xrender_INCLUDE_PATH
+ X11_Xxf86misc_LIB
+ X11_xf86misc_INCLUDE_PATH
+ X11_xf86vmode_INCLUDE_PATH
+ X11_Xinerama_LIB
+ X11_Xinerama_INCLUDE_PATH
+ X11_XTest_LIB
+ X11_XTest_INCLUDE_PATH
+ X11_Xcursor_LIB
+ X11_Xcursor_INCLUDE_PATH
+ X11_dpms_INCLUDE_PATH
+ X11_Xt_LIB
+ X11_Xt_INCLUDE_PATH
+ X11_Xdmcp_LIB
+ X11_LIBRARIES
+ X11_Xaccessrules_INCLUDE_PATH
+ X11_Xaccessstr_INCLUDE_PATH
+ X11_Xdmcp_INCLUDE_PATH
+ X11_Xkb_INCLUDE_PATH
+ X11_Xkblib_INCLUDE_PATH
+ X11_Xkbfile_INCLUDE_PATH
+ X11_Xkbfile_LIB
+ X11_Xscreensaver_INCLUDE_PATH
+ X11_Xscreensaver_LIB
+ X11_Xpm_INCLUDE_PATH
+ X11_Xpm_LIB
+ X11_Xinput_LIB
+ X11_Xinput_INCLUDE_PATH
+ X11_Xft_LIB
+ X11_Xft_INCLUDE_PATH
+ X11_Xshape_INCLUDE_PATH
+ X11_Xv_LIB
+ X11_Xv_INCLUDE_PATH
+ X11_XShm_INCLUDE_PATH
+ X11_ICE_LIB
+ X11_ICE_INCLUDE_PATH
+ X11_SM_LIB
+ X11_SM_INCLUDE_PATH
+ X11_XSync_INCLUDE_PATH
+ )
+ SET(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE})
+ENDIF (UNIX)
+
+# X11_FIND_REQUIRED_<component> could be checked too
diff --git a/kdecore/cmake/modules/FindXKB.cmake b/kdecore/cmake/modules/FindXKB.cmake
new file mode 100644
index 0000000..a91078a
--- /dev/null
+++ b/kdecore/cmake/modules/FindXKB.cmake
@@ -0,0 +1,15 @@
+#
+
+ find_path(X11_XKB_INCLUDE_PATH X11/XKBlib.h "${X11_INC_SEARCH_PATH}")
+ if (X11_XKB_INCLUDE_PATH)
+ MACRO_PUSH_REQUIRED_VARS()
+ set(CMAKE_REQUIRED_LIBRARIES "${X11_LIBRARIES} ${CMAKE_REQUIRED_LIBRARIES}")
+ check_library_exists(X11 XkbLockModifiers "" HAVE_XKB)
+ MACRO_POP_REQUIRED_VARS()
+ if (HAVE_XKB)
+ set(XKB_FOUND TRUE)
+ endif (HAVE_XKB)
+ endif (X11_XKB_INCLUDE_PATH)
+
+
+
diff --git a/kdecore/cmake/modules/FindXine.cmake b/kdecore/cmake/modules/FindXine.cmake
new file mode 100644
index 0000000..7dd08be
--- /dev/null
+++ b/kdecore/cmake/modules/FindXine.cmake
@@ -0,0 +1,77 @@
+# - Try to find the XINE library
+# Once done this will define
+#
+# XINE_FOUND - system has the XINE library
+# XINE_VERSION - XINE version
+# XINE_BUGFIX_VERSION - the XINE bugfix version
+# XINE_INCLUDE_DIR - the XINE include directory
+# XINE_LIBRARY - The libraries needed to use XINE
+# XINE_XCB_FOUND - libxine can use XCB for video output
+
+# Copyright (c) 2006,2007 Laurent Montel, <montel@kde.org>
+# Copyright (c) 2006, Matthias Kretz, <kretz@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+# Support XINE_MIN_VERSION for compatibility:
+IF(NOT Xine_FIND_VERSION)
+ SET(Xine_FIND_VERSION "${XINE_MIN_VERSION}")
+ENDIF(NOT Xine_FIND_VERSION)
+
+# the minimum version of xine we require
+IF(NOT Xine_FIND_VERSION)
+ SET(Xine_FIND_VERSION "1.1.0")
+ENDIF(NOT Xine_FIND_VERSION)
+
+FIND_PACKAGE(PkgConfig)
+PKG_CHECK_MODULES(PC_LIBXINE QUIET libxine)
+SET(XINE_DEFINITIONS ${PC_XINE_CFLAGS_OTHER})
+
+FIND_PATH(XINE_INCLUDE_DIR NAMES xine.h
+ HINTS
+ ${PC_LIBXINE_INCLUDEDIR}
+ ${PC_LIBXINE_INCLUDE_DIRS}
+)
+
+FIND_LIBRARY(XINE_LIBRARY NAMES xine
+ HINTS
+ ${PC_LIBXINE_LIBDIR}
+ ${PC_LIBXINE_LIBRARY_DIRS}
+)
+
+FIND_PROGRAM(XINECONFIG_EXECUTABLE NAMES xine-config
+ HINTS
+ ${PC_LIBXINE_PREFIX}/bin
+)
+
+# Get the version number from xine.h and store it in the cache:
+IF(XINE_INCLUDE_DIR AND NOT XINE_VERSION)
+ IF(EXISTS ${XINE_INCLUDE_DIR}/xine/version.h) # xine 1.2.0+
+ SET(XINE_VERSION_FILE ${XINE_INCLUDE_DIR}/xine/version.h)
+ ELSE(EXISTS ${XINE_INCLUDE_DIR}/xine/version.h)
+ SET(XINE_VERSION_FILE ${XINE_INCLUDE_DIR}/xine.h)
+ ENDIF(EXISTS ${XINE_INCLUDE_DIR}/xine/version.h)
+
+ FILE(READ ${XINE_VERSION_FILE} XINE_VERSION_CONTENT)
+ STRING(REGEX MATCH "#define *XINE_MAJOR_VERSION *([0-9]+)" _dummy "${XINE_VERSION_CONTENT}")
+ SET(XINE_VERSION_MAJOR "${CMAKE_MATCH_1}")
+
+ STRING(REGEX MATCH "#define *XINE_MINOR_VERSION *([0-9]+)" _dummy "${XINE_VERSION_CONTENT}")
+ SET(XINE_VERSION_MINOR "${CMAKE_MATCH_1}")
+
+ STRING(REGEX MATCH "#define *XINE_SUB_VERSION *([0-9]+)" _dummy "${XINE_VERSION_CONTENT}")
+ SET(XINE_VERSION_PATCH "${CMAKE_MATCH_1}")
+
+ SET(XINE_VERSION "${XINE_VERSION_MAJOR}.${XINE_VERSION_MINOR}.${XINE_VERSION_PATCH}" CACHE STRING "Version number of Xine" FORCE)
+
+ IF("${XINE_VERSION}" VERSION_GREATER "${Xine_FIND_VERSION}")
+ STRING(REGEX REPLACE "[0-9]\\.[0-9]\\." "" XINE_BUGFIX_VERSION ${XINE_VERSION})
+ ENDIF("${XINE_VERSION}" VERSION_GREATER "${Xine_FIND_VERSION}")
+ENDIF(XINE_INCLUDE_DIR AND NOT XINE_VERSION)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Xine REQUIRED_VARS XINE_INCLUDE_DIR XINE_LIBRARY XINECONFIG_EXECUTABLE
+ VERSION_VAR XINE_VERSION)
+
+MARK_AS_ADVANCED(XINE_INCLUDE_DIR XINE_LIBRARY XINECONFIG_EXECUTABLE)
diff --git a/kdecore/cmake/modules/FindXmms.cmake b/kdecore/cmake/modules/FindXmms.cmake
new file mode 100644
index 0000000..9f2cdf2
--- /dev/null
+++ b/kdecore/cmake/modules/FindXmms.cmake
@@ -0,0 +1,44 @@
+# Search xmms
+# Once done this will define
+#
+# XMMS_FOUND - system has xmms
+# XMMS_INCLUDE_DIRS - the xmms include directory
+# XMMS_LIBRARIES - Link these to use xmms
+# XMMS_LDFLAGS - for compatibility only, same as XMMS_LIBRARIES
+
+# Copyright (c) 2006, 2007 Laurent Montel, <montel@kde.org>
+# Copyright (c) 2007 Allen Winter <winter@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if (XMMS_INCLUDE_DIRS AND XMMS_LIBRARIES)
+ # in cache already
+ set(XMMS_FOUND TRUE)
+
+else (XMMS_INCLUDE_DIRS AND XMMS_LIBRARIES)
+ if (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ find_package(PkgConfig)
+
+ pkg_check_modules(PC_XMMS QUIET xmms)
+ endif(NOT WIN32)
+
+ find_path(XMMS_INCLUDE_DIRS xmmsctrl.h
+ PATHS ${PC_XMMS_INCLUDEDIR} ${PC_XMMS_INCLUDE_DIRS}
+ PATH_SUFFIXES xmms)
+
+ find_library(XMMS_LIBRARIES NAMES xmms
+ PATHS ${PC_XMMS_LIBDIR} ${PC_XMMS_LIBRARY_DIRS})
+
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(Xmms DEFAULT_MSG
+ XMMS_LIBRARIES XMMS_INCLUDE_DIRS)
+
+ mark_as_advanced(XMMS_INCLUDE_DIRS XMMS_LIBRARIES)
+
+endif (XMMS_INCLUDE_DIRS AND XMMS_LIBRARIES)
+
+# for compatibility
+set(XMMS_LDFLAGS ${XMMS_LIBRARIES})
diff --git a/kdecore/cmake/modules/HandleImportedTargetsInCMakeRequiredLibraries.cmake b/kdecore/cmake/modules/HandleImportedTargetsInCMakeRequiredLibraries.cmake
new file mode 100644
index 0000000..b775b42
--- /dev/null
+++ b/kdecore/cmake/modules/HandleImportedTargetsInCMakeRequiredLibraries.cmake
@@ -0,0 +1,85 @@
+
+# This is a helper function used by CheckCXXSourceRuns.cmake and
+# CheckCXXSourceCompiles.cmake. Actually it should be used by all macros which
+# use TRY_COMPILE() or TRY_RUN().
+# It takes the CMAKE_REQUIRED_LIBRARY variable and searches it for imported
+# (library) targets. Since the project created by TRY_COMPILE() (and TRY_RUN())
+# does not know about these imported targets, this macro here replaces these
+# imported targets with the actual library files on disk and it also
+# adds the libraries from the link interface of these imported targets.
+# E.g the imported target KDE4__kdeui is replaced on my system with /opt/kdelibs/lib/libkdeui.so
+# and the link interface libraries, which includes e.g. /opt/kdelibs/lib/libkdecore.so.
+# This way imported targets work also when used with CHECK_CXX_SOURCE_COMPILES/RUNS().
+
+# Copyright (c) 2009, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+FUNCTION(HANDLE_IMPORTED_TARGETS_IN_CMAKE_REQUIRED_LIBRARIES _RESULT)
+# handle imported library targets
+ SET(_CCSR_IMP_TARGETS_MAP)
+ SET(_CCSR_REQ_LIBS ${CMAKE_REQUIRED_LIBRARIES})
+ SET(_CHECK_FOR_IMPORTED_TARGETS TRUE)
+ SET(_CCSR_LOOP_COUNTER 0)
+ WHILE(_CHECK_FOR_IMPORTED_TARGETS)
+ MATH(EXPR _CCSR_LOOP_COUNTER "${_CCSR_LOOP_COUNTER} + 1 ")
+ SET(_CCSR_NEW_REQ_LIBS )
+ SET(_CHECK_FOR_IMPORTED_TARGETS FALSE)
+ FOREACH(_CURRENT_LIB ${_CCSR_REQ_LIBS})
+ GET_TARGET_PROPERTY(_importedConfigs ${_CURRENT_LIB} IMPORTED_CONFIGURATIONS)
+ IF (_importedConfigs)
+ # Ok, so this is an imported target.
+ # First we get the imported configurations.
+ # Then we get the location of the actual library on disk of the first configuration.
+ # then we'll get its link interface libraries property,
+ # iterate through it and replace all imported targets we find there
+ # with there actual location.
+
+ # guard against infinite loop: abort after 100 iterations ( 100 is arbitrary chosen)
+ IF ("${_CCSR_LOOP_COUNTER}" LESS 100)
+ SET(_CHECK_FOR_IMPORTED_TARGETS TRUE)
+# ELSE ("${_CCSR_LOOP_COUNTER}" LESS 1)
+# MESSAGE(STATUS "********* aborting loop, counter : ${_CCSR_LOOP_COUNTER}")
+ ENDIF ("${_CCSR_LOOP_COUNTER}" LESS 100)
+
+ LIST(GET _importedConfigs 0 _firstImportedConfig)
+ GET_TARGET_PROPERTY(_firstImportedLocation ${_CURRENT_LIB} IMPORTED_LOCATION_${_firstImportedConfig})
+ GET_TARGET_PROPERTY(_linkInterfaceLibs ${_CURRENT_LIB} IMPORTED_LINK_INTERFACE_LIBRARIES_${_firstImportedConfig} )
+
+ LIST(APPEND _CCSR_NEW_REQ_LIBS ${_firstImportedLocation})
+# MESSAGE(STATUS "Appending lib ${_CURRENT_LIB} as ${_firstImportedLocation}")
+ IF(_linkInterfaceLibs)
+ FOREACH(_currentLinkInterfaceLib ${_linkInterfaceLibs})
+# MESSAGE(STATUS "Appending link interface lib ${_currentLinkInterfaceLib}")
+ IF(_currentLinkInterfaceLib)
+ LIST(APPEND _CCSR_NEW_REQ_LIBS ${_currentLinkInterfaceLib} )
+ ENDIF(_currentLinkInterfaceLib)
+ ENDFOREACH(_currentLinkInterfaceLib ${_linkInterfaceLibs})
+ ENDIF(_linkInterfaceLibs)
+ ELSE(_importedConfigs)
+ # "Normal" libraries are just used as they are.
+ LIST(APPEND _CCSR_NEW_REQ_LIBS ${_CURRENT_LIB} )
+# MESSAGE(STATUS "Appending lib directly: ${_CURRENT_LIB}")
+ ENDIF(_importedConfigs)
+ ENDFOREACH(_CURRENT_LIB ${_CCSR_REQ_LIBS})
+
+ SET(_CCSR_REQ_LIBS ${_CCSR_NEW_REQ_LIBS} )
+ ENDWHILE(_CHECK_FOR_IMPORTED_TARGETS)
+
+ # Finally we iterate once more over all libraries. This loop only removes
+ # all remaining imported target names (there shouldn't be any left anyway).
+ SET(_CCSR_NEW_REQ_LIBS )
+ FOREACH(_CURRENT_LIB ${_CCSR_REQ_LIBS})
+ GET_TARGET_PROPERTY(_importedConfigs ${_CURRENT_LIB} IMPORTED_CONFIGURATIONS)
+ IF (NOT _importedConfigs)
+ LIST(APPEND _CCSR_NEW_REQ_LIBS ${_CURRENT_LIB} )
+# MESSAGE(STATUS "final: appending ${_CURRENT_LIB}")
+ ELSE (NOT _importedConfigs)
+# MESSAGE(STATUS "final: skipping ${_CURRENT_LIB}")
+ ENDIF (NOT _importedConfigs)
+ ENDFOREACH(_CURRENT_LIB ${_CCSR_REQ_LIBS})
+ SET(${_RESULT} ${_CCSR_NEW_REQ_LIBS} PARENT_SCOPE)
+
+ENDFUNCTION(HANDLE_IMPORTED_TARGETS_IN_CMAKE_REQUIRED_LIBRARIES _CCSR_REQ_LIBS)
+
diff --git a/kdecore/cmake/modules/KDE4Defaults.cmake b/kdecore/cmake/modules/KDE4Defaults.cmake
new file mode 100644
index 0000000..309b15c
--- /dev/null
+++ b/kdecore/cmake/modules/KDE4Defaults.cmake
@@ -0,0 +1,43 @@
+
+enable_testing()
+SET(BUILD_TESTING ON CACHE INTERNAL "Build the testing tree (internal)")
+
+# support for Dart: http://public.kitware.com/dashboard.php?name=kde
+if (EXISTS ${CMAKE_SOURCE_DIR}/CTestConfig.cmake)
+ include(CTest)
+endif (EXISTS ${CMAKE_SOURCE_DIR}/CTestConfig.cmake)
+
+# Always include srcdir and builddir in include path
+# This saves typing ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} in about every subdir
+# since cmake 2.4.0
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+# put the include dirs which are in the source or build tree
+# before all other include dirs, so the headers in the sources
+# are prefered over the already installed ones
+# since cmake 2.4.1
+set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
+
+# define the generic version of the libraries here
+# this makes it easy to advance it when the next KDE release comes
+# Use this version number for libraries which are at version n in KDE version n
+set(GENERIC_LIB_VERSION "4.8.0")
+set(GENERIC_LIB_SOVERSION "4")
+
+# Use this version number for libraries which are already at version n+1 in KDE version n
+set(KDE_NON_GENERIC_LIB_VERSION "5.8.0")
+set(KDE_NON_GENERIC_LIB_SOVERSION "5")
+
+# windows does not support LD_LIBRARY_PATH or similar
+# all searchable directories has to be defined by the PATH environment var
+# to reduce the number of required pathes executables are placed into
+# the build bin dir
+if (WIN32)
+ set (EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
+# set (LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
+ if (MINGW)
+ set (CMAKE_RC_COMPILER_INIT windres)
+ enable_language (RC)
+ set (CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -i <SOURCE> -o <OBJECT>")
+ endif(MINGW)
+endif(WIN32)
diff --git a/kdecore/cmake/modules/KDE4Macros.cmake b/kdecore/cmake/modules/KDE4Macros.cmake
new file mode 100644
index 0000000..baedaa8
--- /dev/null
+++ b/kdecore/cmake/modules/KDE4Macros.cmake
@@ -0,0 +1,1341 @@
+# for documentation look at FindKDE4Internal.cmake
+
+# this file contains the following macros (or functions):
+# KDE4_ADD_UI_FILES
+# KDE4_ADD_UI3_FILES
+# KDE4_ADD_KCFG_FILES
+# _KDE4_SET_CUSTOM_TARGET_PROPERTY
+# _KDE4_GET_CUSTOM_TARGET_PROPERTY
+# KDE4_MOC_HEADERS
+# KDE4_HANDLE_AUTOMOC
+# KDE4_CREATE_FINAL_FILES
+# KDE4_ADD_PLUGIN
+# KDE4_ADD_KDEINIT_EXECUTABLE
+# KDE4_ADD_UNIT_TEST
+# KDE4_ADD_EXECUTABLE
+# KDE4_ADD_WIDGET_FILES
+# KDE4_UPDATE_ICONCACHE
+# KDE4_INSTALL_ICONS
+# KDE4_REMOVE_OBSOLETE_CMAKE_FILES
+# KDE4_NO_ENABLE_FINAL
+# KDE4_CREATE_HANDBOOK
+# KDE4_ADD_APP_ICON
+# KDE4_CREATE_MANPAGE
+# KDE4_CREATE_BASIC_CMAKE_VERSION_FILE (function)
+# KDE4_INSTALL_AUTH_HELPER_FILES
+# KDE4_AUTH_INSTALL_ACTIONS
+
+# Copyright (c) 2006-2009 Alexander Neundorf, <neundorf@kde.org>
+# Copyright (c) 2006, 2007, Laurent Montel, <montel@kde.org>
+# Copyright (c) 2007 Matthias Kretz <kretz@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+# This is for versions of automoc4 which don't provide these two macros.
+# If such a version is used, just use the "old" style automoc handling.
+if(NOT COMMAND _AUTOMOC4_KDE4_PRE_TARGET_HANDLING)
+
+ macro(_AUTOMOC4_KDE4_PRE_TARGET_HANDLING _target _srcs)
+ if(MSVC)
+ add_automoc4_target("${_target}_automoc" ${_srcs})
+ else(MSVC)
+ automoc4(${_target} ${_srcs} )
+ endif(MSVC)
+ endmacro(_AUTOMOC4_KDE4_PRE_TARGET_HANDLING)
+
+
+ macro(_AUTOMOC4_KDE4_POST_TARGET_HANDLING _target)
+ if(MSVC)
+ add_dependencies(${_target} "${_target}_automoc")
+ endif(MSVC)
+ endmacro(_AUTOMOC4_KDE4_POST_TARGET_HANDLING)
+
+endif(NOT COMMAND _AUTOMOC4_KDE4_PRE_TARGET_HANDLING)
+
+
+macro (KDE4_ADD_KCFG_FILES _sources )
+ foreach (_current_ARG ${ARGN})
+ if( ${_current_ARG} STREQUAL "GENERATE_MOC" )
+ set(_kcfg_generatemoc TRUE)
+ endif( ${_current_ARG} STREQUAL "GENERATE_MOC" )
+
+ if( ${_current_ARG} STREQUAL "USE_RELATIVE_PATH" )
+ set(_kcfg_relativepath TRUE)
+ endif( ${_current_ARG} STREQUAL "USE_RELATIVE_PATH" )
+ endforeach (_current_ARG ${ARGN})
+
+ foreach (_current_FILE ${ARGN})
+
+ if(NOT ${_current_FILE} STREQUAL "GENERATE_MOC" AND NOT ${_current_FILE} STREQUAL "USE_RELATIVE_PATH")
+ get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
+ get_filename_component(_abs_PATH ${_tmp_FILE} PATH)
+
+ if (_kcfg_relativepath) # Process relative path only if the option was set
+ # Get relative path
+ get_filename_component(_rel_PATH ${_current_FILE} PATH)
+
+ if (IS_ABSOLUTE ${_rel_PATH})
+ # We got an absolute path
+ set(_rel_PATH "")
+ endif (IS_ABSOLUTE ${_rel_PATH})
+ endif (_kcfg_relativepath)
+
+ get_filename_component(_basename ${_tmp_FILE} NAME_WE)
+ # If we had a relative path and we're asked to use it, then change the basename accordingly
+ if(NOT ${_rel_PATH} STREQUAL "")
+ set(_basename ${_rel_PATH}/${_basename})
+ endif(NOT ${_rel_PATH} STREQUAL "")
+
+ file(READ ${_tmp_FILE} _contents)
+ string(REGEX REPLACE "^(.*\n)?File=([^\n]+kcfg).*\n.*$" "\\2" _kcfg_FILENAME "${_contents}")
+ set(_src_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
+ set(_header_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
+ set(_moc_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc)
+ set(_kcfg_FILE ${_abs_PATH}/${_kcfg_FILENAME})
+ # Maybe the .kcfg is a generated file?
+ if(NOT EXISTS "${_kcfg_FILE}")
+ set(_kcfg_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_kcfg_FILENAME})
+ endif(NOT EXISTS "${_kcfg_FILE}")
+ if(NOT EXISTS "${_kcfg_FILE}")
+ message(ERROR "${_kcfg_FILENAME} not found; tried in ${_abs_PATH} and ${CMAKE_CURRENT_BINARY_DIR}")
+ endif(NOT EXISTS "${_kcfg_FILE}")
+
+ # make sure the directory exist in the build directory
+ if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${_rel_PATH}")
+ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_rel_PATH})
+ endif(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${_rel_PATH}")
+
+# if (CMAKE_CROSSCOMPILING)
+# set(IMPORT_KCONFIG_COMPILER_EXECUTABLE "${KDE_HOST_TOOLS_PATH}/ImportKConfigCompilerExecutable.cmake" CACHE FILEPATH "Point it to the export file of kconfig_compiler from a native build")
+# include(${IMPORT_KCONFIG_COMPILER_EXECUTABLE})
+# set(KDE4_KCFGC_EXECUTABLE kconfig_compiler)
+# endif (CMAKE_CROSSCOMPILING)
+
+ # the command for creating the source file from the kcfg file
+ add_custom_command(OUTPUT ${_header_FILE} ${_src_FILE}
+ COMMAND ${KDE4_KCFGC_EXECUTABLE}
+ ARGS ${_kcfg_FILE} ${_tmp_FILE} -d ${CMAKE_CURRENT_BINARY_DIR}/${_rel_PATH}
+ MAIN_DEPENDENCY ${_tmp_FILE}
+ DEPENDS ${_kcfg_FILE} ${_KDE4_KCONFIG_COMPILER_DEP} )
+
+ if(_kcfg_generatemoc)
+ qt4_generate_moc(${_header_FILE} ${_moc_FILE} )
+ set_source_files_properties(${_src_FILE} PROPERTIES SKIP_AUTOMOC TRUE) # don't run automoc on this file
+ list(APPEND ${_sources} ${_moc_FILE})
+ endif(_kcfg_generatemoc)
+
+ list(APPEND ${_sources} ${_src_FILE} ${_header_FILE})
+ endif(NOT ${_current_FILE} STREQUAL "GENERATE_MOC" AND NOT ${_current_FILE} STREQUAL "USE_RELATIVE_PATH")
+ endforeach (_current_FILE)
+
+endmacro (KDE4_ADD_KCFG_FILES)
+
+
+get_filename_component(KDE4_MODULE_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
+
+#create the implementation files from the ui files and add them to the list of sources
+#usage: KDE4_ADD_UI_FILES(foo_SRCS ${ui_files})
+macro (KDE4_ADD_UI_FILES _sources )
+ foreach (_current_FILE ${ARGN})
+
+ get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
+ get_filename_component(_basename ${_tmp_FILE} NAME_WE)
+ set(_header ${CMAKE_CURRENT_BINARY_DIR}/ui_${_basename}.h)
+
+ # we need to run uic and replace some things in the generated file
+ # this is done by executing the cmake script kde4uic.cmake
+ add_custom_command(OUTPUT ${_header}
+ COMMAND ${CMAKE_COMMAND}
+ ARGS
+ -DKDE4_HEADER:BOOL=ON
+ -DKDE_UIC_EXECUTABLE:FILEPATH=${QT_UIC_EXECUTABLE}
+ -DKDE_UIC_FILE:FILEPATH=${_tmp_FILE}
+ -DKDE_UIC_H_FILE:FILEPATH=${_header}
+ -DKDE_UIC_BASENAME:STRING=${_basename}
+ -P ${KDE4_MODULE_DIR}/kde4uic.cmake
+ MAIN_DEPENDENCY ${_tmp_FILE}
+ )
+ list(APPEND ${_sources} ${_header})
+ endforeach (_current_FILE)
+endmacro (KDE4_ADD_UI_FILES)
+
+
+# this is basically a copy of the qt4_get_moc_flags() macros from FindQt4.cmake
+# which is for internal use only, so we should not use it here:
+macro (_KDE4_GET_MOC_FLAGS _moc_flags)
+ set(${_moc_flags})
+ get_directory_property(_inc_DIRS INCLUDE_DIRECTORIES)
+
+ foreach(_current ${_inc_DIRS})
+ set(${_moc_flags} ${${_moc_flags}} "-I${_current}")
+ endforeach(_current ${_inc_DIRS})
+
+ get_directory_property(_defines COMPILE_DEFINITIONS)
+ foreach(_current ${_defines})
+ set(${_moc_flags} ${${_moc_flags}} "-D${_current}")
+ endforeach(_current ${_defines})
+
+ if(Q_WS_WIN)
+ set(${_moc_flags} ${${_moc_flags}} -DWIN32)
+ endif(Q_WS_WIN)
+
+ # if Qt is installed only as framework, add -F /library/Frameworks to the moc arguments
+ # otherwise moc can't find the headers in the framework include dirs
+ if(APPLE AND "${QT_QTCORE_INCLUDE_DIR}" MATCHES "/Library/Frameworks/")
+ set(${_moc_INC_DIRS} ${${_moc_INC_DIRS}} "-F/Library/Frameworks")
+ endif(APPLE AND "${QT_QTCORE_INCLUDE_DIR}" MATCHES "/Library/Frameworks/")
+
+endmacro(_KDE4_GET_MOC_FLAGS)
+
+
+#create the implementation files from the ui files and add them to the list of sources
+#usage: KDE4_ADD_UI3_FILES(foo_SRCS ${ui_files})
+macro (KDE4_ADD_UI3_FILES _sources )
+
+ _kde4_get_moc_flags(_moc_INCS)
+
+ foreach (_current_FILE ${ARGN})
+
+ get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
+ get_filename_component(_basename ${_tmp_FILE} NAME_WE)
+ set(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
+ set(_src ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
+ set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc.cpp)
+
+ add_custom_command(OUTPUT ${_header}
+ COMMAND ${CMAKE_COMMAND}
+ -DKDE3_HEADER:BOOL=ON
+ -DKDE_UIC_EXECUTABLE:FILEPATH=${QT_UIC3_EXECUTABLE}
+ -DKDE_UIC_FILE:FILEPATH=${_tmp_FILE}
+ -DKDE_UIC_H_FILE:FILEPATH=${_header}
+ -DKDE_UIC_BASENAME:STRING=${_basename}
+ -DKDE_UIC_PLUGIN_DIR:FILEPATH="."
+ -P ${KDE4_MODULE_DIR}/kde4uic.cmake
+ MAIN_DEPENDENCY ${_tmp_FILE}
+ )
+
+# we need to run uic3 and replace some things in the generated file
+ # this is done by executing the cmake script kde4uic.cmake
+ add_custom_command(OUTPUT ${_src}
+ COMMAND ${CMAKE_COMMAND}
+ ARGS
+ -DKDE3_IMPL:BOOL=ON
+ -DKDE_UIC_EXECUTABLE:FILEPATH=${QT_UIC3_EXECUTABLE}
+ -DKDE_UIC_FILE:FILEPATH=${_tmp_FILE}
+ -DKDE_UIC_CPP_FILE:FILEPATH=${_src}
+ -DKDE_UIC_H_FILE:FILEPATH=${_header}
+ -DKDE_UIC_BASENAME:STRING=${_basename}
+ -DKDE_UIC_PLUGIN_DIR:FILEPATH="."
+ -P ${KDE4_MODULE_DIR}/kde4uic.cmake
+ MAIN_DEPENDENCY ${_header}
+ )
+
+ add_custom_command(OUTPUT ${_moc}
+ COMMAND ${QT_MOC_EXECUTABLE}
+ ARGS ${_moc_INCS} ${_header} -o ${_moc}
+ MAIN_DEPENDENCY ${_header}
+ )
+ list(APPEND ${_sources} ${_src} ${_moc} )
+
+ endforeach (_current_FILE)
+endmacro (KDE4_ADD_UI3_FILES)
+
+macro (_KDE4_SET_CUSTOM_TARGET_PROPERTY _target_name _property_name _property)
+ string(REGEX REPLACE "[/ ]" "_" _dir "${CMAKE_CURRENT_SOURCE_DIR}")
+ set(_kde4_${_dir}_${_target_name}_${_property_name} "${_property}")
+endmacro (_KDE4_SET_CUSTOM_TARGET_PROPERTY)
+
+
+macro (_KDE4_GET_CUSTOM_TARGET_PROPERTY _var _target_name _property_name)
+ string(REGEX REPLACE "[/ ]" "_" _dir "${CMAKE_CURRENT_SOURCE_DIR}")
+ set(${_var} "${_kde4_${_dir}_${_target_name}_${_property_name}}")
+endmacro (_KDE4_GET_CUSTOM_TARGET_PROPERTY)
+
+
+macro (KDE4_MOC_HEADERS _target_NAME)
+ # if automoc4 from kdesupport has been found, use the macro provided there
+ automoc4_moc_headers(${_target_NAME} ${ARGN})
+endmacro (KDE4_MOC_HEADERS)
+
+macro(KDE4_HANDLE_AUTOMOC _target_NAME _SRCS)
+ # if automoc4 from kdesupport has been found, use the macro provided there
+ automoc4(${_target_NAME} ${_SRCS})
+endmacro(KDE4_HANDLE_AUTOMOC)
+
+macro(KDE4_INSTALL_TS_FILES _lang _sdir)
+ file(GLOB_RECURSE _ts_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${_sdir}/*)
+ foreach(_current_TS_FILES ${_ts_files})
+ string(REGEX MATCH "\\.svn/" _in_svn ${_current_TS_FILES})
+ if(NOT _in_svn)
+ get_filename_component(_subpath ${_current_TS_FILES} PATH)
+ install(FILES ${_current_TS_FILES} DESTINATION ${LOCALE_INSTALL_DIR}/${_lang}/LC_SCRIPTS/${_subpath})
+ endif(NOT _in_svn)
+ endforeach(_current_TS_FILES)
+endmacro(KDE4_INSTALL_TS_FILES)
+
+
+macro (KDE4_CREATE_HANDBOOK _docbook)
+ get_filename_component(_input ${_docbook} ABSOLUTE)
+ set(_doc ${CMAKE_CURRENT_BINARY_DIR}/index.cache.bz2)
+
+ #Bootstrap
+ if (_kdeBootStrapping)
+ set(_ssheet "${CMAKE_BINARY_DIR}/kdoctools/customization/kde-chunk.xsl")
+ set(_bootstrapOption "--srcdir=${CMAKE_BINARY_DIR}/kdoctools/")
+ else (_kdeBootStrapping)
+ set(_ssheet "${KDE4_DATA_INSTALL_DIR}/ksgmltools2/customization/kde-chunk.xsl")
+ set(_bootstrapOption)
+ endif (_kdeBootStrapping)
+
+ file(GLOB _docs *.docbook)
+
+# if (CMAKE_CROSSCOMPILING)
+# set(IMPORT_MEINPROC4_EXECUTABLE "${KDE_HOST_TOOLS_PATH}/ImportMeinProc4Executable.cmake" CACHE FILEPATH "Point it to the export file of meinproc4 from a native build")
+# include(${IMPORT_MEINPROC4_EXECUTABLE})
+# set(KDE4_MEINPROC_EXECUTABLE meinproc4)
+# endif (CMAKE_CROSSCOMPILING)
+
+ add_custom_command(OUTPUT ${_doc}
+ COMMAND ${KDE4_MEINPROC_EXECUTABLE} --check ${_bootstrapOption} --cache ${_doc} ${_input}
+ DEPENDS ${_docs} ${_KDE4_MEINPROC_EXECUTABLE_DEP} ${_ssheet}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+ get_filename_component(_targ ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+ set(_targ "${_targ}-handbook")
+ add_custom_target(${_targ} ALL DEPENDS ${_doc})
+
+ if(KDE4_ENABLE_HTMLHANDBOOK)
+ set(_htmlDoc ${CMAKE_CURRENT_SOURCE_DIR}/index.html)
+ add_custom_command(OUTPUT ${_htmlDoc}
+ COMMAND ${KDE4_MEINPROC_EXECUTABLE} --check ${_bootstrapOption} -o ${_htmlDoc} ${_input}
+ DEPENDS ${_input} ${_KDE4_MEINPROC_EXECUTABLE_DEP} ${_ssheet}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+ add_custom_target(htmlhandbook DEPENDS ${_htmlDoc})
+ endif(KDE4_ENABLE_HTMLHANDBOOK)
+
+ set(_args ${ARGN})
+
+ set(_installDest)
+ if(_args)
+ list(GET _args 0 _tmp)
+ if("${_tmp}" STREQUAL "INSTALL_DESTINATION")
+ list(GET _args 1 _installDest )
+ list(REMOVE_AT _args 0 1)
+ endif("${_tmp}" STREQUAL "INSTALL_DESTINATION")
+ endif(_args)
+
+ get_filename_component(dirname ${CMAKE_CURRENT_SOURCE_DIR} NAME_WE)
+ if(_args)
+ list(GET _args 0 _tmp)
+ if("${_tmp}" STREQUAL "SUBDIR")
+ list(GET _args 1 dirname )
+ list(REMOVE_AT _args 0 1)
+ endif("${_tmp}" STREQUAL "SUBDIR")
+ endif(_args)
+
+ if(_installDest)
+ file(GLOB _images *.png)
+ install(FILES ${_doc} ${_docs} ${_images} DESTINATION ${_installDest}/${dirname})
+ # TODO symlinks on non-unix platforms
+ if (UNIX)
+ # execute some cmake code on make install which creates the symlink
+ install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink \"${_installDest}/common\" \"\$ENV{DESTDIR}${_installDest}/${dirname}/common\" )" )
+ endif (UNIX)
+ endif(_installDest)
+
+endmacro (KDE4_CREATE_HANDBOOK)
+
+
+macro (KDE4_CREATE_MANPAGE _docbook _section)
+ get_filename_component(_input ${_docbook} ABSOLUTE)
+ get_filename_component(_base ${_input} NAME)
+
+ string(REGEX REPLACE "\\.${_section}\\.docbook$" "" _base ${_base})
+
+ set(_doc ${CMAKE_CURRENT_BINARY_DIR}/${_base}.${_section})
+ # sometimes we have "man-" prepended
+ string(REGEX REPLACE "/man-" "/" _outdoc ${_doc})
+
+ #Bootstrap
+ if (_kdeBootStrapping)
+ set(_ssheet "${CMAKE_BINARY_DIR}/kdoctools/customization/kde-include-man.xsl")
+ set(_bootstrapOption "--srcdir=${CMAKE_BINARY_DIR}/kdoctools/")
+ else (_kdeBootStrapping)
+ set(_ssheet "${KDE4_DATA_INSTALL_DIR}/ksgmltools2/customization/kde-include-man.xsl")
+ set(_bootstrapOption)
+ endif (_kdeBootStrapping)
+
+# if (CMAKE_CROSSCOMPILING)
+# set(IMPORT_MEINPROC4_EXECUTABLE "${KDE_HOST_TOOLS_PATH}/ImportMeinProc4Executable.cmake" CACHE FILEPATH "Point it to the export file of meinproc4 from a native build")
+# include(${IMPORT_MEINPROC4_EXECUTABLE})
+# set(KDE4_MEINPROC_EXECUTABLE meinproc4)
+# endif (CMAKE_CROSSCOMPILING)
+
+ add_custom_command(OUTPUT ${_outdoc}
+ COMMAND ${KDE4_MEINPROC_EXECUTABLE} --stylesheet ${_ssheet} --check ${_bootstrapOption} ${_input}
+ DEPENDS ${_input} ${_KDE4_MEINPROC_EXECUTABLE_DEP} ${_ssheet}
+ )
+ get_filename_component(_targ ${CMAKE_CURRENT_SOURCE_DIR} NAME)
+ set(_targ "${_targ}-manpage-${_base}")
+ add_custom_target(${_targ} ALL DEPENDS "${_outdoc}")
+
+ set(_args ${ARGN})
+
+ set(_installDest)
+ if(_args)
+ list(GET _args 0 _tmp)
+ if("${_tmp}" STREQUAL "INSTALL_DESTINATION")
+ list(GET _args 1 _installDest )
+ list(REMOVE_AT _args 0 1)
+ endif("${_tmp}" STREQUAL "INSTALL_DESTINATION")
+ endif(_args)
+
+ get_filename_component(dirname ${CMAKE_CURRENT_SOURCE_DIR} NAME_WE)
+ if(_args)
+ list(GET _args 0 _tmp)
+ if("${_tmp}" STREQUAL "SUBDIR")
+ list(GET _args 1 dirname )
+ list(REMOVE_AT _args 0 1)
+ endif("${_tmp}" STREQUAL "SUBDIR")
+ endif(_args)
+
+ if(_installDest)
+ install(FILES ${_outdoc} DESTINATION ${_installDest}/man${_section})
+ endif(_installDest)
+endmacro (KDE4_CREATE_MANPAGE)
+
+
+macro (KDE4_UPDATE_ICONCACHE)
+ # Update mtime of hicolor icon theme dir.
+ # We don't always have touch command (e.g. on Windows), so instead create
+ # and delete a temporary file in the theme dir.
+ install(CODE "
+ set(DESTDIR_VALUE \"\$ENV{DESTDIR}\")
+ if (NOT DESTDIR_VALUE)
+ file(WRITE \"${ICON_INSTALL_DIR}/hicolor/temp.txt\" \"update\")
+ file(REMOVE \"${ICON_INSTALL_DIR}/hicolor/temp.txt\")
+ endif (NOT DESTDIR_VALUE)
+ ")
+endmacro (KDE4_UPDATE_ICONCACHE)
+
+# a "map" of short type names to the directories
+# unknown names should give empty results
+# KDE 3 compatibility
+set(_KDE4_ICON_GROUP_mime "mimetypes")
+set(_KDE4_ICON_GROUP_filesys "places")
+set(_KDE4_ICON_GROUP_device "devices")
+set(_KDE4_ICON_GROUP_app "apps")
+set(_KDE4_ICON_GROUP_action "actions")
+# KDE 4 / icon naming specification compatibility
+set(_KDE4_ICON_GROUP_mimetypes "mimetypes")
+set(_KDE4_ICON_GROUP_places "places")
+set(_KDE4_ICON_GROUP_devices "devices")
+set(_KDE4_ICON_GROUP_apps "apps")
+set(_KDE4_ICON_GROUP_actions "actions")
+set(_KDE4_ICON_GROUP_categories "categories")
+set(_KDE4_ICON_GROUP_status "status")
+set(_KDE4_ICON_GROUP_emblems "emblems")
+set(_KDE4_ICON_GROUP_emotes "emotes")
+set(_KDE4_ICON_GROUP_animations "animations")
+set(_KDE4_ICON_GROUP_intl "intl")
+
+# a "map" of short theme names to the theme directory
+set(_KDE4_ICON_THEME_ox "oxygen")
+set(_KDE4_ICON_THEME_cr "crystalsvg")
+set(_KDE4_ICON_THEME_lo "locolor")
+set(_KDE4_ICON_THEME_hi "hicolor")
+
+
+# only used internally by KDE4_INSTALL_ICONS
+macro (_KDE4_ADD_ICON_INSTALL_RULE _install_SCRIPT _install_PATH _group _orig_NAME _install_NAME _l10n_SUBDIR)
+
+ # if the string doesn't match the pattern, the result is the full string, so all three have the same content
+ if (NOT ${_group} STREQUAL ${_install_NAME} )
+ set(_icon_GROUP ${_KDE4_ICON_GROUP_${_group}})
+ if(NOT _icon_GROUP)
+ set(_icon_GROUP "actions")
+ endif(NOT _icon_GROUP)
+# message(STATUS "icon: ${_current_ICON} size: ${_size} group: ${_group} name: ${_name} l10n: ${_l10n_SUBDIR}")
+ install(FILES ${_orig_NAME} DESTINATION ${_install_PATH}/${_icon_GROUP}/${_l10n_SUBDIR}/ RENAME ${_install_NAME} )
+ endif (NOT ${_group} STREQUAL ${_install_NAME} )
+
+endmacro (_KDE4_ADD_ICON_INSTALL_RULE)
+
+
+macro (KDE4_INSTALL_ICONS _defaultpath )
+
+ # the l10n-subdir if language given as second argument (localized icon)
+ set(_lang ${ARGV1})
+ if(_lang)
+ set(_l10n_SUBDIR l10n/${_lang})
+ else(_lang)
+ set(_l10n_SUBDIR ".")
+ endif(_lang)
+
+ # first the png icons
+ file(GLOB _icons *.png)
+ foreach (_current_ICON ${_icons} )
+ # since CMake 2.6 regex matches are stored in special variables CMAKE_MATCH_x, if it didn't match, they are empty
+ string(REGEX MATCH "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.png)$" _dummy "${_current_ICON}")
+ set(_type "${CMAKE_MATCH_1}")
+ set(_size "${CMAKE_MATCH_2}")
+ set(_group "${CMAKE_MATCH_3}")
+ set(_name "${CMAKE_MATCH_4}")
+
+ set(_theme_GROUP ${_KDE4_ICON_THEME_${_type}})
+ if( _theme_GROUP)
+ _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
+ ${_defaultpath}/${_theme_GROUP}/${_size}x${_size}
+ ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR})
+ endif( _theme_GROUP)
+ endforeach (_current_ICON)
+
+ # mng icons
+ file(GLOB _icons *.mng)
+ foreach (_current_ICON ${_icons} )
+ # since CMake 2.6 regex matches are stored in special variables CMAKE_MATCH_x, if it didn't match, they are empty
+ string(REGEX MATCH "^.*/([a-zA-Z]+)([0-9]+)\\-([a-z]+)\\-(.+\\.mng)$" _dummy "${_current_ICON}")
+ set(_type "${CMAKE_MATCH_1}")
+ set(_size "${CMAKE_MATCH_2}")
+ set(_group "${CMAKE_MATCH_3}")
+ set(_name "${CMAKE_MATCH_4}")
+
+ set(_theme_GROUP ${_KDE4_ICON_THEME_${_type}})
+ if( _theme_GROUP)
+ _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
+ ${_defaultpath}/${_theme_GROUP}/${_size}x${_size}
+ ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR})
+ endif( _theme_GROUP)
+ endforeach (_current_ICON)
+
+ # and now the svg icons
+ file(GLOB _icons *.svgz)
+ foreach (_current_ICON ${_icons} )
+ # since CMake 2.6 regex matches are stored in special variables CMAKE_MATCH_x, if it didn't match, they are empty
+ string(REGEX MATCH "^.*/([a-zA-Z]+)sc\\-([a-z]+)\\-(.+\\.svgz)$" _dummy "${_current_ICON}")
+ set(_type "${CMAKE_MATCH_1}")
+ set(_group "${CMAKE_MATCH_2}")
+ set(_name "${CMAKE_MATCH_3}")
+
+ set(_theme_GROUP ${_KDE4_ICON_THEME_${_type}})
+ if( _theme_GROUP)
+ _KDE4_ADD_ICON_INSTALL_RULE(${CMAKE_CURRENT_BINARY_DIR}/install_icons.cmake
+ ${_defaultpath}/${_theme_GROUP}/scalable
+ ${_group} ${_current_ICON} ${_name} ${_l10n_SUBDIR})
+ endif( _theme_GROUP)
+ endforeach (_current_ICON)
+
+ kde4_update_iconcache()
+
+endmacro (KDE4_INSTALL_ICONS)
+
+
+# For all C++ sources a big source file which includes all the files
+# is created.
+# This is not done for the C sources, they are just gathered in a separate list
+# because they are usually not written by KDE and as such not intended to be
+# compiled all-in-one.
+macro (KDE4_CREATE_FINAL_FILES _filenameCPP _filesExcludedFromFinalFile )
+ set(${_filesExcludedFromFinalFile})
+ file(WRITE "${_filenameCPP}" "//autogenerated file\n")
+ foreach (_current_FILE ${ARGN})
+ get_filename_component(_abs_FILE "${_current_FILE}" ABSOLUTE)
+ # don't include any generated files in the final-file
+ # because then cmake will not know the dependencies
+ get_source_file_property(_isGenerated "${_abs_FILE}" GENERATED)
+ if (_isGenerated)
+ list(APPEND ${_filesExcludedFromFinalFile} "${_abs_FILE}")
+ else (_isGenerated)
+ # only put C++ files in the final-file
+ if("${_abs_FILE}" MATCHES ".+\\.(cpp|cc|cxx|C)$")
+ file(APPEND "${_filenameCPP}" "#include \"${_abs_FILE}\"\n")
+ else("${_abs_FILE}" MATCHES ".+\\.(cpp|cc|cxx|C)$")
+ list(APPEND ${_filesExcludedFromFinalFile} "${_abs_FILE}")
+ endif("${_abs_FILE}" MATCHES ".+\\.(cpp|cc|cxx|C)$")
+ endif (_isGenerated)
+ endforeach (_current_FILE)
+
+endmacro (KDE4_CREATE_FINAL_FILES)
+
+# This macro doesn't set up the RPATH related options for executables anymore,
+# since now (wioth cmake 2.6) just the full RPATH is used always for everything.
+# It does create wrapper shell scripts for the executables.
+# It overrides the defaults set in FindKDE4Internal.cmake.
+# For every executable a wrapper script is created, which sets the appropriate
+# environment variable for the platform (LD_LIBRARY_PATH on most UNIX systems,
+# DYLD_LIBRARY_PATH on OS X and PATH in Windows) so that it points to the built
+# but not yet installed versions of the libraries. So if RPATH is disabled, the executables
+# can be run via these scripts from the build tree and will find the correct libraries.
+# If RPATH is not disabled, these scripts are also used but only for consistency, because
+# they don't really influence anything then, because the compiled-in RPATH overrides
+# the LD_LIBRARY_PATH env. variable.
+macro (KDE4_HANDLE_RPATH_FOR_EXECUTABLE _target_NAME)
+ if (UNIX)
+ if (APPLE)
+ set(_library_path_variable "DYLD_LIBRARY_PATH")
+ elseif (CYGWIN)
+ set(_library_path_variable "PATH")
+ else (APPLE)
+ set(_library_path_variable "LD_LIBRARY_PATH")
+ endif (APPLE)
+
+ if (APPLE)
+ # DYLD_LIBRARY_PATH does not work like LD_LIBRARY_PATH
+ # OSX already has the RPATH in libraries and executables, putting runtime directories in
+ # DYLD_LIBRARY_PATH actually breaks things
+ set(_ld_library_path "${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/:${KDE4_LIB_DIR}")
+ else (APPLE)
+ set(_ld_library_path "${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/:${LIB_INSTALL_DIR}:${KDE4_LIB_DIR}:${QT_LIBRARY_DIR}")
+ endif (APPLE)
+ get_target_property(_executable ${_target_NAME} LOCATION )
+
+ # use add_custom_target() to have the sh-wrapper generated during build time instead of cmake time
+ if (CMAKE_VERSION VERSION_GREATER 2.8.3)
+ add_custom_command(TARGET ${_target_NAME} POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ -D_filename=${_executable}.shell -D_library_path_variable=${_library_path_variable}
+ -D_ld_library_path="${_ld_library_path}" -D_executable=$<TARGET_FILE:${_target_NAME}>
+ -P ${KDE4_MODULE_DIR}/kde4_exec_via_sh.cmake
+ )
+ else ()
+ add_custom_command(TARGET ${_target_NAME} POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ -D_filename=${_executable}.shell -D_library_path_variable=${_library_path_variable}
+ -D_ld_library_path="${_ld_library_path}" -D_executable=${_executable}
+ -P ${KDE4_MODULE_DIR}/kde4_exec_via_sh.cmake
+ )
+ endif ()
+
+ macro_additional_clean_files(${_executable}.shell)
+
+ # under UNIX, set the property WRAPPER_SCRIPT to the name of the generated shell script
+ # so it can be queried and used later on easily
+ set_target_properties(${_target_NAME} PROPERTIES WRAPPER_SCRIPT ${_executable}.shell)
+
+ else (UNIX)
+ # under windows, set the property WRAPPER_SCRIPT just to the name of the executable
+ # maybe later this will change to a generated batch file (for setting the PATH so that the Qt libs are found)
+ get_target_property(_executable ${_target_NAME} LOCATION )
+ set_target_properties(${_target_NAME} PROPERTIES WRAPPER_SCRIPT ${_executable})
+
+ set(_ld_library_path "${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}\;${LIB_INSTALL_DIR}\;${KDE4_LIB_DIR}\;${QT_LIBRARY_DIR}")
+ get_target_property(_executable ${_target_NAME} LOCATION )
+
+ # use add_custom_target() to have the batch-file-wrapper generated during build time instead of cmake time
+ add_custom_command(TARGET ${_target_NAME} POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ -D_filename="${_executable}.bat"
+ -D_ld_library_path="${_ld_library_path}" -D_executable="${_executable}"
+ -P ${KDE4_MODULE_DIR}/kde4_exec_via_sh.cmake
+ )
+
+ endif (UNIX)
+endmacro (KDE4_HANDLE_RPATH_FOR_EXECUTABLE)
+
+
+macro (KDE4_ADD_PLUGIN _target_NAME )
+#if the first argument is "WITH_PREFIX" then keep the standard "lib" prefix,
+#otherwise set the prefix empty
+
+ set(_args ${ARGN})
+ # default to module
+ set(_add_lib_param "MODULE")
+ set(_with_pre FALSE)
+
+ foreach(arg ${_args})
+ if (arg STREQUAL "WITH_PREFIX")
+ set(_with_pre TRUE)
+ endif (arg STREQUAL "WITH_PREFIX")
+ if (arg STREQUAL "STATIC")
+ set(_add_lib_param STATIC)
+ endif (arg STREQUAL "STATIC")
+ if (arg STREQUAL "SHARED")
+ set(_add_lib_param SHARED)
+ endif (arg STREQUAL "SHARED")
+ if (arg STREQUAL "MODULE")
+ set(_add_lib_param MODULE)
+ endif (arg STREQUAL "MODULE")
+ endforeach(arg)
+
+ if(_with_pre)
+ list(REMOVE_ITEM _args "WITH_PREFIX")
+ endif(_with_pre)
+ if(_add_lib_param STREQUAL "STATIC")
+ list(REMOVE_ITEM _args "STATIC")
+ endif(_add_lib_param STREQUAL "STATIC")
+ if (_add_lib_param STREQUAL "SHARED")
+ list(REMOVE_ITEM _args "SHARED")
+ endif (_add_lib_param STREQUAL "SHARED")
+ if (_add_lib_param STREQUAL "MODULE")
+ list(REMOVE_ITEM _args "MODULE")
+ endif (_add_lib_param STREQUAL "MODULE")
+
+ set(_SRCS ${_args})
+
+ _automoc4_kde4_pre_target_handling(${_target_NAME} _SRCS)
+
+ if("${_add_lib_param}" STREQUAL "STATIC")
+ add_definitions(-DQT_STATICPLUGIN)
+ endif("${_add_lib_param}" STREQUAL "STATIC")
+
+ if (KDE4_ENABLE_FINAL)
+ kde4_create_final_files(${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_final_cpp.cpp _separate_files ${_SRCS})
+ add_library(${_target_NAME} ${_add_lib_param} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_final_cpp.cpp ${_separate_files})
+ else (KDE4_ENABLE_FINAL)
+ add_library(${_target_NAME} ${_add_lib_param} ${_SRCS})
+ endif (KDE4_ENABLE_FINAL)
+
+ _automoc4_kde4_post_target_handling(${_target_NAME})
+
+ if (NOT _with_pre)
+ set_target_properties(${_target_NAME} PROPERTIES PREFIX "")
+ endif (NOT _with_pre)
+
+ # for shared libraries/plugins a -DMAKE_target_LIB is required
+ string(TOUPPER ${_target_NAME} _symbol)
+ string(REGEX REPLACE "[^_A-Za-z0-9]" "_" _symbol ${_symbol})
+ set(_symbol "MAKE_${_symbol}_LIB")
+ set_target_properties(${_target_NAME} PROPERTIES DEFINE_SYMBOL ${_symbol})
+
+endmacro (KDE4_ADD_PLUGIN _target_NAME _with_PREFIX)
+
+
+# this macro is intended to check whether a list of source
+# files has the "NOGUI" or "RUN_UNINSTALLED" keywords at the beginning
+# in _output_LIST the list of source files is returned with the "NOGUI"
+# and "RUN_UNINSTALLED" keywords removed
+# if "NOGUI" is in the list of files, the _nogui argument is set to
+# "NOGUI" (which evaluates to TRUE in cmake), otherwise it is set empty
+# (which evaluates to FALSE in cmake)
+# "RUN_UNINSTALLED" in the list of files is ignored, it is not necessary anymore
+# since KDE 4.2 (with cmake 2.6.2), since then all executables are always built
+# with RPATH pointing into the build dir.
+# if "TEST" is in the list of files, the _test argument is set to
+# "TEST" (which evaluates to TRUE in cmake), otherwise it is set empty
+# (which evaluates to FALSE in cmake)
+macro(KDE4_CHECK_EXECUTABLE_PARAMS _output_LIST _nogui _test)
+ set(${_nogui})
+ set(${_test})
+ set(${_output_LIST} ${ARGN})
+ list(LENGTH ${_output_LIST} count)
+
+ list(GET ${_output_LIST} 0 first_PARAM)
+
+ set(second_PARAM "NOTFOUND")
+ if (${count} GREATER 1)
+ list(GET ${_output_LIST} 1 second_PARAM)
+ endif (${count} GREATER 1)
+
+ set(remove "NOTFOUND")
+
+ if (${first_PARAM} STREQUAL "NOGUI")
+ set(${_nogui} "NOGUI")
+ set(remove 0)
+ endif (${first_PARAM} STREQUAL "NOGUI")
+
+ if (${first_PARAM} STREQUAL "RUN_UNINSTALLED")
+ set(remove 0)
+ endif (${first_PARAM} STREQUAL "RUN_UNINSTALLED")
+
+ if (${first_PARAM} STREQUAL "TEST")
+ set(${_test} "TEST")
+ set(remove 0)
+ endif (${first_PARAM} STREQUAL "TEST")
+
+ if (${second_PARAM} STREQUAL "NOGUI")
+ set(${_nogui} "NOGUI")
+ set(remove 0;1)
+ endif (${second_PARAM} STREQUAL "NOGUI")
+
+ if (${second_PARAM} STREQUAL "RUN_UNINSTALLED")
+ set(remove 0;1)
+ endif (${second_PARAM} STREQUAL "RUN_UNINSTALLED")
+
+ if (${second_PARAM} STREQUAL "TEST")
+ set(${_test} "TEST")
+ set(remove 0;1)
+ endif (${second_PARAM} STREQUAL "TEST")
+
+
+ if (NOT "${remove}" STREQUAL "NOTFOUND")
+ list(REMOVE_AT ${_output_LIST} ${remove})
+ endif (NOT "${remove}" STREQUAL "NOTFOUND")
+
+endmacro(KDE4_CHECK_EXECUTABLE_PARAMS)
+
+
+macro (KDE4_ADD_KDEINIT_EXECUTABLE _target_NAME )
+
+ kde4_check_executable_params(_SRCS _nogui _test ${ARGN})
+
+ configure_file(${KDE4_MODULE_DIR}/kde4init_dummy.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp)
+ set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp PROPERTIES SKIP_AUTOMOC TRUE)
+ # under Windows, build a normal executable and additionally a dummy kdeinit4_foo.lib, whose only purpose on windows is to
+ # keep the linking logic from the CMakeLists.txt on UNIX working (under UNIX all necessary libs are linked against the kdeinit
+ # library instead against the executable, under windows we want to have everything in the executable, but for compatibility we have to
+ # keep the library there-
+ if(WIN32)
+ if (MINGW)
+ list(FIND _SRCS ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_res.o _res_position)
+ else(MINGW)
+ list(FIND _SRCS ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}.rc _res_position)
+ endif(MINGW)
+ if(NOT _res_position EQUAL -1)
+ list(GET _SRCS ${_res_position} _resourcefile)
+ list(REMOVE_AT _SRCS ${_res_position})
+ endif(NOT _res_position EQUAL -1)
+
+ set(_KDEINIT4_TARGET_NAME_ ${_target_NAME})
+ string(REGEX REPLACE "[-]" "_" _KDEINIT4_TARGET_NAME_ "${_KDEINIT4_TARGET_NAME_}")
+ configure_file(${KDE4_MODULE_DIR}/kde4init_win32lib_dummy.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_win32lib_dummy.cpp)
+ add_library(kdeinit_${_target_NAME} STATIC ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_win32lib_dummy.cpp)
+
+ if (KDE4_ENABLE_FINAL)
+ kde4_create_final_files(${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_final_cpp.cpp _separate_files ${_SRCS})
+ kde4_add_executable(${_target_NAME} "${_nogui}" ${CMAKE_CURRENT_BINARY_DIR}/kdeinit_${_target_NAME}_final_cpp.cpp ${_separate_files} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp ${_resourcefile})
+
+ else (KDE4_ENABLE_FINAL)
+ kde4_add_executable(${_target_NAME} "${_nogui}" ${_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp ${_resourcefile})
+ endif (KDE4_ENABLE_FINAL)
+
+ set_target_properties(kdeinit_${_target_NAME} PROPERTIES OUTPUT_NAME kdeinit4_${_target_NAME})
+
+ target_link_libraries(${_target_NAME} ${QT_QTMAIN_LIBRARY} kdeinit_${_target_NAME})
+ else(WIN32)
+ _automoc4_kde4_pre_target_handling(kdeinit_${_target_NAME} _SRCS)
+
+ if (KDE4_ENABLE_FINAL)
+ kde4_create_final_files(${CMAKE_CURRENT_BINARY_DIR}/kdeinit_${_target_NAME}_final_cpp.cpp _separate_files ${_SRCS})
+ add_library(kdeinit_${_target_NAME} SHARED ${CMAKE_CURRENT_BINARY_DIR}/kdeinit_${_target_NAME}_final_cpp.cpp ${_separate_files})
+
+ else (KDE4_ENABLE_FINAL)
+ add_library(kdeinit_${_target_NAME} SHARED ${_SRCS})
+ endif (KDE4_ENABLE_FINAL)
+
+ _automoc4_kde4_post_target_handling(kdeinit_${_target_NAME})
+
+ set_target_properties(kdeinit_${_target_NAME} PROPERTIES OUTPUT_NAME kdeinit4_${_target_NAME})
+
+ kde4_add_executable(${_target_NAME} "${_nogui}" ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp)
+ target_link_libraries(${_target_NAME} kdeinit_${_target_NAME})
+ endif(WIN32)
+
+endmacro (KDE4_ADD_KDEINIT_EXECUTABLE)
+
+# Add a unit test, which is executed when running make test .
+# The targets are always created, but only built for the "all"
+# target if the option KDE4_BUILD_TESTS is enabled. Otherwise the rules for the target
+# are created but not built by default. You can build them by manually building the target.
+# The name of the target can be specified using TESTNAME <testname>, if it is not given
+# the macro will default to the <name>
+macro (KDE4_ADD_UNIT_TEST _test_NAME)
+ set(_srcList ${ARGN})
+ set(_targetName ${_test_NAME})
+ if( ${ARGV1} STREQUAL "TESTNAME" )
+ set(_targetName ${ARGV2})
+ list(REMOVE_AT _srcList 0 1)
+ endif( ${ARGV1} STREQUAL "TESTNAME" )
+
+ set(_nogui)
+ list(GET ${_srcList} 0 first_PARAM)
+ if( ${first_PARAM} STREQUAL "NOGUI" )
+ set(_nogui "NOGUI")
+ endif( ${first_PARAM} STREQUAL "NOGUI" )
+
+ kde4_add_executable( ${_test_NAME} TEST ${_srcList} )
+
+ if(NOT KDE4_TEST_OUTPUT)
+ set(KDE4_TEST_OUTPUT plaintext)
+ endif(NOT KDE4_TEST_OUTPUT)
+ set(KDE4_TEST_OUTPUT ${KDE4_TEST_OUTPUT} CACHE STRING "The output to generate when running the QTest unit tests")
+
+ set(using_qtest "")
+ foreach(_filename ${_srcList})
+ if(NOT using_qtest)
+ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_filename}")
+ file(READ ${_filename} file_CONTENT)
+ string(REGEX MATCH "QTEST_(KDE)?MAIN" using_qtest "${file_CONTENT}")
+ endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_filename}")
+ endif(NOT using_qtest)
+ endforeach(_filename)
+
+ get_target_property( loc ${_test_NAME} LOCATION )
+ if(WIN32)
+ if(MSVC_IDE)
+ STRING(REGEX REPLACE "\\$\\(.*\\)" "\${CTEST_CONFIGURATION_TYPE}" loc "${loc}")
+ endif()
+ # .bat because of rpath handling
+ set(_executable "${loc}.bat")
+ else(WIN32)
+ if (Q_WS_MAC AND NOT _nogui)
+ set(_executable ${EXECUTABLE_OUTPUT_PATH}/${_test_NAME}.app/Contents/MacOS/${_test_NAME})
+ else (Q_WS_MAC AND NOT _nogui)
+ # .shell because of rpath handling
+ set(_executable "${loc}.shell")
+ endif (Q_WS_MAC AND NOT _nogui)
+ endif(WIN32)
+
+ if (using_qtest AND KDE4_TEST_OUTPUT STREQUAL "xml")
+ #MESSAGE(STATUS "${_targetName} : Using QTestLib, can produce XML report.")
+ add_test( ${_targetName} ${_executable} -xml -o ${_targetName}.tml)
+ else (using_qtest AND KDE4_TEST_OUTPUT STREQUAL "xml")
+ #MESSAGE(STATUS "${_targetName} : NOT using QTestLib, can't produce XML report, please use QTestLib to write your unit tests.")
+ add_test( ${_targetName} ${_executable} )
+ endif (using_qtest AND KDE4_TEST_OUTPUT STREQUAL "xml")
+
+# add_test( ${_targetName} ${EXECUTABLE_OUTPUT_PATH}/${_test_NAME} -xml -o ${_test_NAME}.tml )
+
+ if (NOT MSVC_IDE) #not needed for the ide
+ # if the tests are EXCLUDE_FROM_ALL, add a target "buildtests" to build all tests
+ if (NOT KDE4_BUILD_TESTS)
+ get_directory_property(_buildtestsAdded BUILDTESTS_ADDED)
+ if(NOT _buildtestsAdded)
+ add_custom_target(buildtests)
+ set_directory_properties(PROPERTIES BUILDTESTS_ADDED TRUE)
+ endif(NOT _buildtestsAdded)
+ add_dependencies(buildtests ${_test_NAME})
+ endif (NOT KDE4_BUILD_TESTS)
+ endif (NOT MSVC_IDE)
+
+endmacro (KDE4_ADD_UNIT_TEST)
+
+
+# add a manifest file to executables.
+#
+# There is a henn-egg problem when a target runtime part is renamed using
+# the OUTPUT_NAME option of cmake's set_target_properties command.
+#
+# At now the Makefiles rules creating for manifest adding are performed
+# *after* the cmake's add_executable command but *before* an optional
+# set_target_properties command.
+# This means that in KDE4_ADD_MANIFEST the LOCATION property contains
+# the unchanged runtime part name of the target. :-(
+#
+# The recently used workaround is to specify a variable build off the target name followed
+# by _OUTPUT_NAME before calling kde4_add_executable as shown in the following example:
+#
+# set(xyz_OUTPUT_NAME test)
+# kde4_add_executable( xyz <source>)
+# set_target_properties( xyz PROPERTIES OUTPUT_NAME ${xyz_OUTPUT_NAME} )
+#
+# The full solution would be to introduce a kde4_target_link_libraries macro and to
+# call KDE4_ADD_MANIFEST inside instead of calling in kde4_add_executable.
+# This would require patching of *all* places in the KDE sources where target_link_libraries
+# is used and to change the related docs.
+#
+# Because yet I found only 2 locations where this problem occurs (kjs, k3b), the workaround
+# seems to be a pragmatically solution.
+#
+# This macro is an internal macro only used by kde4_add_executable
+#
+macro (_KDE4_ADD_MANIFEST _target_NAME)
+ set(x ${_target_NAME}_OUTPUT_NAME)
+ if (${x})
+ get_target_property(_var ${_target_NAME} LOCATION )
+ string(REPLACE "${_target_NAME}" "${${x}}" _executable ${_var})
+ else(${x})
+ get_target_property(_executable ${_target_NAME} LOCATION )
+ endif(${x})
+
+ if (_kdeBootStrapping)
+ set(_cmake_module_path ${CMAKE_SOURCE_DIR}/cmake/modules)
+ else (_kdeBootStrapping)
+ set(_cmake_module_path ${KDE4_INSTALL_DIR}/share/apps/cmake/modules)
+ endif (_kdeBootStrapping)
+
+ set(_manifest ${_cmake_module_path}/Win32.Manifest.in)
+ #message(STATUS ${_executable} ${_manifest})
+ add_custom_command(
+ TARGET ${_target_NAME}
+ POST_BUILD
+ COMMAND ${KDE4_MT_EXECUTABLE}
+ ARGS
+ -manifest ${_manifest}
+ -updateresource:${_executable}
+ COMMENT "adding vista trustInfo manifest to ${_target_NAME}"
+ )
+endmacro(_KDE4_ADD_MANIFEST)
+
+
+macro (KDE4_ADD_EXECUTABLE _target_NAME)
+
+ kde4_check_executable_params( _SRCS _nogui _test ${ARGN})
+
+ set(_add_executable_param)
+
+ # determine additional parameters for add_executable()
+ # for GUI apps, create a bundle on OSX
+ if (Q_WS_MAC)
+ set(_add_executable_param MACOSX_BUNDLE)
+ endif (Q_WS_MAC)
+
+ # for GUI apps, this disables the additional console under Windows
+ if (WIN32)
+ set(_add_executable_param WIN32)
+ endif (WIN32)
+
+ if (_nogui)
+ set(_add_executable_param)
+ endif (_nogui)
+
+ if (_test AND NOT KDE4_BUILD_TESTS)
+ set(_add_executable_param ${_add_executable_param} EXCLUDE_FROM_ALL)
+ endif (_test AND NOT KDE4_BUILD_TESTS)
+
+ _automoc4_kde4_pre_target_handling(${_target_NAME} _SRCS)
+
+ if (KDE4_ENABLE_FINAL)
+ kde4_create_final_files(${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_final_cpp.cpp _separate_files ${_SRCS})
+ add_executable(${_target_NAME} ${_add_executable_param} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_final_cpp.cpp ${_separate_files})
+ else (KDE4_ENABLE_FINAL)
+ add_executable(${_target_NAME} ${_add_executable_param} ${_SRCS})
+ endif (KDE4_ENABLE_FINAL)
+
+ IF (KDE4_ENABLE_UAC_MANIFEST)
+ _kde4_add_manifest(${_target_NAME})
+ ENDIF(KDE4_ENABLE_UAC_MANIFEST)
+
+ _automoc4_kde4_post_target_handling(${_target_NAME})
+
+ if (_test)
+ set_target_properties(${_target_NAME} PROPERTIES COMPILE_FLAGS -DKDESRCDIR="\\"${CMAKE_CURRENT_SOURCE_DIR}/\\"")
+ endif (_test)
+
+ kde4_handle_rpath_for_executable(${_target_NAME})
+
+ if (WIN32)
+ target_link_libraries(${_target_NAME} ${QT_QTMAIN_LIBRARY})
+ endif (WIN32)
+
+endmacro (KDE4_ADD_EXECUTABLE)
+
+
+macro (KDE4_ADD_LIBRARY _target_NAME _lib_TYPE)
+
+ set(_first_SRC ${_lib_TYPE})
+ set(_add_lib_param)
+
+ if (${_lib_TYPE} STREQUAL "STATIC")
+ set(_first_SRC)
+ set(_add_lib_param STATIC)
+ endif (${_lib_TYPE} STREQUAL "STATIC")
+ if (${_lib_TYPE} STREQUAL "SHARED")
+ set(_first_SRC)
+ set(_add_lib_param SHARED)
+ endif (${_lib_TYPE} STREQUAL "SHARED")
+ if (${_lib_TYPE} STREQUAL "MODULE")
+ set(_first_SRC)
+ set(_add_lib_param MODULE)
+ endif (${_lib_TYPE} STREQUAL "MODULE")
+
+ set(_SRCS ${_first_SRC} ${ARGN})
+
+ _automoc4_kde4_pre_target_handling(${_target_NAME} _SRCS)
+
+ if (KDE4_ENABLE_FINAL)
+ kde4_create_final_files(${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_final_cpp.cpp _separate_files ${_SRCS})
+ add_library(${_target_NAME} ${_add_lib_param} ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_final_cpp.cpp ${_separate_files})
+ else (KDE4_ENABLE_FINAL)
+ add_library(${_target_NAME} ${_add_lib_param} ${_SRCS})
+ endif (KDE4_ENABLE_FINAL)
+
+ _automoc4_kde4_post_target_handling(${_target_NAME})
+
+ # for shared libraries a -DMAKE_target_LIB is required
+ string(TOUPPER ${_target_NAME} _symbol)
+ string(REGEX REPLACE "[^_A-Za-z0-9]" "_" _symbol ${_symbol})
+ set(_symbol "MAKE_${_symbol}_LIB")
+ set_target_properties(${_target_NAME} PROPERTIES DEFINE_SYMBOL ${_symbol})
+
+ # By default don't add any linked libraries to the "exported"
+ # link interfaces, so that executables linking against this library
+ # will not automatically add implicit dependencies to their link list.
+ #
+ # This reduces inter-package dependencies and makes it easier to remove
+ # dependencies of shared libraries without breaking binary compatibility.
+ if(NOT "${_add_lib_param}" STREQUAL "STATIC")
+ set_target_properties(${_target_NAME} PROPERTIES LINK_INTERFACE_LIBRARIES "" )
+ endif(NOT "${_add_lib_param}" STREQUAL "STATIC")
+
+endmacro (KDE4_ADD_LIBRARY _target_NAME _lib_TYPE)
+
+macro (KDE4_ADD_WIDGET_FILES _sources)
+ foreach (_current_FILE ${ARGN})
+
+ get_filename_component(_input ${_current_FILE} ABSOLUTE)
+ get_filename_component(_basename ${_input} NAME_WE)
+ set(_source ${CMAKE_CURRENT_BINARY_DIR}/${_basename}widgets.cpp)
+ set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}widgets.moc)
+
+ # create source file from the .widgets file
+ add_custom_command(OUTPUT ${_source}
+ COMMAND ${KDE4_MAKEKDEWIDGETS_EXECUTABLE}
+ ARGS -o ${_source} ${_input}
+ MAIN_DEPENDENCY ${_input} DEPENDS ${_KDE4_MAKEKDEWIDGETS_DEP})
+
+ # create moc file
+ qt4_generate_moc(${_source} ${_moc} )
+
+ list(APPEND ${_sources} ${_source} ${_moc})
+
+ endforeach (_current_FILE)
+
+endmacro (KDE4_ADD_WIDGET_FILES)
+
+
+macro(KDE4_REMOVE_OBSOLETE_CMAKE_FILES)
+# the files listed here will be removed by remove_obsoleted_cmake_files.cmake, Alex
+ install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/remove_files.cmake )
+ set(module_install_dir ${DATA_INSTALL_DIR}/cmake/modules )
+
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/remove_files.cmake "#generated by cmake, dont edit\n\n")
+ foreach ( _current_FILE ${ARGN})
+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/remove_files.cmake "message(STATUS \"Removing ${module_install_dir}/${_current_FILE}\" )\n" )
+ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/remove_files.cmake "exec_program( ${CMAKE_COMMAND} ARGS -E remove ${module_install_dir}/${_current_FILE} OUTPUT_VARIABLE _dummy)\n" )
+ endforeach ( _current_FILE)
+
+endmacro(KDE4_REMOVE_OBSOLETE_CMAKE_FILES)
+
+
+macro(KDE4_NO_ENABLE_FINAL _project_name)
+ if(KDE4_ENABLE_FINAL)
+ set(KDE4_ENABLE_FINAL OFF)
+ remove_definitions(-DKDE_USE_FINAL)
+ message(STATUS "You used enable-final argument but \"${_project_name}\" doesn't support it. Try to fix compile it and remove KDE4_NO_ENABLE_FINAL macro. Thanks")
+
+ endif(KDE4_ENABLE_FINAL)
+endmacro(KDE4_NO_ENABLE_FINAL _project_name)
+
+
+macro(KDE4_CREATE_EXPORTS_HEADER _outputFile _libName)
+ string(TOUPPER ${_libName} _libNameUpperCase)
+ string(REGEX REPLACE "[^_A-Za-z0-9]" "_" _libNameUpperCase ${_libNameUpperCase})
+ # the next line is is required, because in CMake arguments to macros are not real
+ # variables, but handled differently. The next line create a real CMake variable,
+ # so configure_file() will replace it correctly.
+ set(_libName ${_libName})
+ # compared to write(FILE) configure_file() only really writes the file if the
+ # contents have changed. Otherwise we would have a lot of recompiles.
+ configure_file(${KDE4_MODULE_DIR}/kde4exportsheader.h.in ${_outputFile})
+endmacro(KDE4_CREATE_EXPORTS_HEADER _outputFile _libName)
+
+
+macro (KDE4_CREATE_HTML_HANDBOOK _docbook)
+ message(STATUS "KDE4_CREATE_HTML_HANDBOOK() is deprecated. Enable the option KDE4_ENABLE_HTMLHANDBOOK instead, this will give you targets htmlhandbook for creating the html help.")
+endmacro (KDE4_CREATE_HTML_HANDBOOK)
+
+
+# adds application icon to target source list
+# 'appsources' - the sources of the application
+# 'pngfiles' - specifies the list of icon files
+# example: KDE4_ADD_WIN32_APP_ICON(myapp_SRCS "pics/cr16-myapp.png;pics/cr32-myapp.png")
+macro (KDE4_ADD_WIN32_APP_ICON appsources)
+ message(STATUS "KDE4_ADD_WIN32_APP_ICON() is deprecated, use KDE4_ADD_APP_ICON() instead")
+ if (WIN32)
+ if(NOT WINCE)
+ find_program(PNG2ICO_EXECUTABLE NAMES png2ico)
+ else(NOT WINCE)
+ find_program(PNG2ICO_EXECUTABLE NAMES png2ico PATHS ${HOST_BINDIR} NO_DEFAULT_PATH )
+ endif(NOT WINCE)
+ string(REPLACE _SRCS "" appname ${appsources})
+ if (PNG2ICO_EXECUTABLE)
+ set (_outfilename ${CMAKE_CURRENT_BINARY_DIR}/${appname})
+
+ # png2ico is found by the above find_program
+# message("png2ico ${_outfilename}.ico ${ARGN}")
+ exec_program(png2ico ARGS ${_outfilename}.ico ${ARGN})
+
+ # now make rc file for adding it to the sources
+ file(WRITE ${_outfilename}.rc "IDI_ICON1 ICON DISCARDABLE \"${_outfilename}.ico\"\n")
+ list(APPEND ${appsources} ${CMAKE_CURRENT_BINARY_DIR}/${appname}.rc)
+ endif(PNG2ICO_EXECUTABLE)
+ endif(WIN32)
+endmacro (KDE4_ADD_WIN32_APP_ICON)
+
+# adds application icon to target source list
+# for detailed documentation see the top of FindKDE4Internal.cmake
+macro (KDE4_ADD_APP_ICON appsources pattern)
+ set (_outfilename ${CMAKE_CURRENT_BINARY_DIR}/${appsources})
+
+ if (WIN32)
+ if(NOT WINCE)
+ find_program(PNG2ICO_EXECUTABLE NAMES png2ico)
+ else(NOT WINCE)
+ find_program(PNG2ICO_EXECUTABLE NAMES png2ico PATHS ${HOST_BINDIR} NO_DEFAULT_PATH )
+ endif(NOT WINCE)
+ if (PNG2ICO_EXECUTABLE)
+ string(REPLACE "*" "(.*)" pattern_rx "${pattern}")
+ file(GLOB files "${pattern}")
+ foreach (it ${files})
+ string(REGEX REPLACE "${pattern_rx}" "\\1" fn "${it}")
+ if (fn MATCHES ".*16.*" )
+ list (APPEND _icons ${it})
+ endif (fn MATCHES ".*16.*")
+ if (fn MATCHES ".*32.*" )
+ list (APPEND _icons ${it})
+ endif (fn MATCHES ".*32.*")
+ if (fn MATCHES ".*48.*" )
+ list (APPEND _icons ${it})
+ endif (fn MATCHES ".*48.*")
+ if (fn MATCHES ".*64.*" )
+ list (APPEND _icons ${it})
+ endif (fn MATCHES ".*64.*")
+ if (fn MATCHES ".*128.*" )
+ list (APPEND _icons ${it})
+ endif (fn MATCHES ".*128.*")
+ endforeach (it)
+ if (_icons)
+ add_custom_command(OUTPUT ${_outfilename}.ico ${_outfilename}.rc
+ COMMAND ${PNG2ICO_EXECUTABLE} ARGS --rcfile ${_outfilename}.rc ${_outfilename}.ico ${_icons}
+ DEPENDS ${PNG2ICO_EXECUTABLE} ${_icons}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ )
+ list(APPEND ${appsources} ${_outfilename}.rc)
+ else(_icons)
+ message(STATUS "Unable to find a related icon that matches pattern ${pattern} for variable ${appsources} - application will not have an application icon!")
+ endif(_icons)
+ else(PNG2ICO_EXECUTABLE)
+ message(STATUS "Unable to find the png2ico utility - application will not have an application icon!")
+ endif(PNG2ICO_EXECUTABLE)
+ endif(WIN32)
+ if (Q_WS_MAC)
+ # first convert image to a tiff using the Mac OS X "sips" utility,
+ # then use tiff2icns to convert to an icon
+ find_program(SIPS_EXECUTABLE NAMES sips)
+ find_program(TIFF2ICNS_EXECUTABLE NAMES tiff2icns)
+ if (SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE)
+ file(GLOB_RECURSE files "${pattern}")
+ # we can only test for the 128-icon like that - we don't use patterns anymore
+ foreach (it ${files})
+ if (it MATCHES ".*128.*" )
+ set (_icon ${it})
+ endif (it MATCHES ".*128.*")
+ endforeach (it)
+
+ if (_icon)
+
+ # first, get the basename of our app icon
+ add_custom_command(OUTPUT ${_outfilename}.icns ${outfilename}.tiff
+ COMMAND ${SIPS_EXECUTABLE} -s format tiff ${_icon} --out ${outfilename}.tiff
+ COMMAND ${TIFF2ICNS_EXECUTABLE} ${outfilename}.tiff ${_outfilename}.icns
+ DEPENDS ${_icon}
+ )
+
+ # This will register the icon into the bundle
+ set(MACOSX_BUNDLE_ICON_FILE ${appsources}.icns)
+
+ # Append the icns file to the sources list so it will be a dependency to the
+ # main target
+ list(APPEND ${appsources} ${_outfilename}.icns)
+
+ # Install the icon into the Resources dir in the bundle
+ set_source_files_properties(${_outfilename}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
+
+ else(_icon)
+ # TODO - try to scale a non-128 icon...? Try to convert an SVG on the fly?
+ message(STATUS "Unable to find an 128x128 icon that matches pattern ${pattern} for variable ${appsources} - application will not have an application icon!")
+ endif(_icon)
+
+ else(SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE)
+ message(STATUS "Unable to find the sips and tiff2icns utilities - application will not have an application icon!")
+ endif(SIPS_EXECUTABLE AND TIFF2ICNS_EXECUTABLE)
+ endif(Q_WS_MAC)
+endmacro (KDE4_ADD_APP_ICON)
+
+
+# This macro is only kept around for compatibility, it is not needed/used anymore
+# since CMake 2.6.0. With CMake 2.6.0 it is not necessary anymore link libraries again
+# ("relink") to change their RPATH. Since this is fast now, they are now always built with
+# full RPATH.
+# Still keep this macro here, since somebody might use it and so that would break
+# if we would just remove it from here.
+# What it does now it sets the target properties of the given target the same way as
+# they were set by the old version of the macro with the option FULL_RPATH enabled.
+# This one may be a candidate for removal. Alex
+macro (KDE4_HANDLE_RPATH_FOR_LIBRARY _target_NAME)
+ message(STATUS "You are using the macro KDE4_HANDLE_RPATH_FOR_LIBRARY(), which is an internal macro and shouldn't be used by external projects. Please remove it.")
+ if (NOT CMAKE_SKIP_RPATH)
+ set_target_properties(${_target_NAME} PROPERTIES SKIP_BUILD_RPATH FALSE BUILD_WITH_INSTALL_RPATH FALSE)
+ endif (NOT CMAKE_SKIP_RPATH)
+endmacro (KDE4_HANDLE_RPATH_FOR_LIBRARY)
+
+# This macro adds the needed files for an helper executable meant to be used by applications using KAuth.
+# It accepts the helper target, the helper ID (the DBUS name) and the user under which the helper will run on.
+# This macro takes care of generate the needed files, and install them in the right location. This boils down
+# to a DBus policy to let the helper register on the system bus, and a service file for letting the helper
+# being automatically activated by the system bus.
+# *WARNING* You have to install the helper in ${LIBEXEC_INSTALL_DIR} to make sure everything will work.
+function(KDE4_INSTALL_AUTH_HELPER_FILES HELPER_TARGET HELPER_ID HELPER_USER)
+ if(KDE4_AUTH_HELPER_BACKEND_NAME STREQUAL "DBUS")
+ if (_kdeBootStrapping)
+ set(_stubFilesDir ${CMAKE_SOURCE_DIR}/kdecore/auth/backends/dbus/ )
+ else (_kdeBootStrapping)
+ set(_stubFilesDir ${KDE4_DATA_INSTALL_DIR}/kauth/ )
+ endif (_kdeBootStrapping)
+
+ configure_file(${_stubFilesDir}/dbus_policy.stub
+ ${CMAKE_CURRENT_BINARY_DIR}/${HELPER_ID}.conf)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${HELPER_ID}.conf
+ DESTINATION ${SYSCONF_INSTALL_DIR}/dbus-1/system.d/)
+
+ configure_file(${_stubFilesDir}/dbus_service.stub
+ ${CMAKE_CURRENT_BINARY_DIR}/${HELPER_ID}.service)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${HELPER_ID}.service
+ DESTINATION ${DBUS_SYSTEM_SERVICES_INSTALL_DIR})
+ endif(KDE4_AUTH_HELPER_BACKEND_NAME STREQUAL "DBUS")
+endfunction(KDE4_INSTALL_AUTH_HELPER_FILES)
+
+# This macro generates an action file, depending on the backend used, for applications using KAuth.
+# It accepts the helper id (the DBUS name) and a file containing the actions (check kdelibs/kdecore/auth/example
+# for file format). The macro will take care of generating the file according to the backend specified,
+# and to install it in the right location. This (at the moment) means that on Linux (PolicyKit) a .policy
+# file will be generated and installed into the policykit action directory (usually /usr/share/PolicyKit/policy/),
+# and on Mac (Authorization Services) will be added to the system action registry using the native MacOS API during
+# the install phase
+function(KDE4_INSTALL_AUTH_ACTIONS HELPER_ID ACTIONS_FILE)
+
+ if(KDE4_AUTH_BACKEND_NAME STREQUAL "APPLE")
+ install(CODE "execute_process(COMMAND ${KDE4_KAUTH_POLICY_GEN_EXECUTABLE} ${ACTIONS_FILE} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})")
+ elseif(KDE4_AUTH_BACKEND_NAME STREQUAL "POLKITQT" OR KDE4_AUTH_BACKEND_NAME STREQUAL "POLKITQT-1")
+ set(_output ${CMAKE_CURRENT_BINARY_DIR}/${HELPER_ID}.policy)
+ get_filename_component(_input ${ACTIONS_FILE} ABSOLUTE)
+
+ add_custom_command(OUTPUT ${_output}
+ COMMAND ${KDE4_KAUTH_POLICY_GEN_EXECUTABLE} ${_input} > ${_output}
+ MAIN_DEPENDENCY ${_input}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMENT "Generating ${HELPER_ID}.policy"
+ DEPENDS ${_KDE4_KAUTH_POLICY_GEN_EXECUTABLE_DEP})
+ add_custom_target("actions for ${HELPER_ID}" ALL DEPENDS ${_output})
+
+ install(FILES ${_output} DESTINATION ${KDE4_AUTH_POLICY_FILES_INSTALL_DIR})
+ endif()
+
+endfunction(KDE4_INSTALL_AUTH_ACTIONS)
+
+
+macro(_KDE4_EXPORT_LIBRARY_DEPENDENCIES _append_or_write _filename)
+ message(FATAL_ERROR "_KDE4_EXPORT_LIBRARY_DEPENDENCIES() was an internal macro and has been removed again. Just remove the code which calls it, there is no substitute.")
+endmacro(_KDE4_EXPORT_LIBRARY_DEPENDENCIES)
+
+macro (_KDE4_TARGET_LINK_INTERFACE_LIBRARIES _target _interface_libs)
+ message(FATAL_ERROR "_KDE4_TARGET_LINK_INTERFACE_LIBRARIES() doesn't exist anymore. Set the LINK_INTERFACE_LIBRARIES target property instead. See kdelibs/kdecore/CMakeLists.txt for an example.")
+endmacro (_KDE4_TARGET_LINK_INTERFACE_LIBRARIES)
+
+macro (KDE4_TARGET_LINK_INTERFACE_LIBRARIES _target _interface_libs)
+ message(FATAL_ERROR "KDE4_TARGET_LINK_INTERFACE_LIBRARIES() doesn't exist anymore. Set the LINK_INTERFACE_LIBRARIES target property instead. See kdelibs/kdecore/CMakeLists.txt for an example.")
+endmacro (KDE4_TARGET_LINK_INTERFACE_LIBRARIES _target _interface_libs)
+
+macro (KDE4_INSTALL_HANDBOOK _lang)
+ message(STATUS "KDE4_INSTALL_HANDBOOK() is deprecated. Remove it please. Now all is done in KDE4_CREATE_HANDBOOK.")
+endmacro (KDE4_INSTALL_HANDBOOK )
+
+macro (KDE4_SET_CUSTOM_TARGET_PROPERTY)
+ message(FATAL_ERROR "KDE4_SET_CUSTOM_TARGET_PROPERTY() is deprecated, just use a simple variable instead")
+endmacro (KDE4_SET_CUSTOM_TARGET_PROPERTY)
+
+macro (KDE4_GET_CUSTOM_TARGET_PROPERTY)
+ message(FATAL_ERROR "KDE4_GET_CUSTOM_TARGET_PROPERTY() is deprecated, just use a simple variable instead")
+endmacro (KDE4_GET_CUSTOM_TARGET_PROPERTY)
diff --git a/kdecore/cmake/modules/MacroAddCompileFlags.cmake b/kdecore/cmake/modules/MacroAddCompileFlags.cmake
new file mode 100644
index 0000000..12038c0
--- /dev/null
+++ b/kdecore/cmake/modules/MacroAddCompileFlags.cmake
@@ -0,0 +1,19 @@
+# - MACRO_ADD_COMPILE_FLAGS(<_target> "flags...")
+
+# Copyright (c) 2006, Oswald Buddenhagen, <ossi@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+MACRO (MACRO_ADD_COMPILE_FLAGS _target _flg)
+
+ GET_TARGET_PROPERTY(_flags ${_target} COMPILE_FLAGS)
+ if (_flags)
+ set(_flags "${_flags} ${_flg}")
+ else (_flags)
+ set(_flags "${_flg}")
+ endif (_flags)
+ SET_TARGET_PROPERTIES(${_target} PROPERTIES COMPILE_FLAGS "${_flags}")
+
+ENDMACRO (MACRO_ADD_COMPILE_FLAGS)
diff --git a/kdecore/cmake/modules/MacroAddLinkFlags.cmake b/kdecore/cmake/modules/MacroAddLinkFlags.cmake
new file mode 100644
index 0000000..a10d39e
--- /dev/null
+++ b/kdecore/cmake/modules/MacroAddLinkFlags.cmake
@@ -0,0 +1,18 @@
+# - MACRO_ADD_LINK_FLAGS(<_target> "flags...")
+
+# Copyright (c) 2006, Oswald Buddenhagen, <ossi@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+MACRO (MACRO_ADD_LINK_FLAGS _target _flg)
+
+ GET_TARGET_PROPERTY(_flags ${_target} LINK_FLAGS)
+ if (_flags)
+ set(_flags "${_flags} ${_flg}")
+ else (_flags)
+ set(_flags "${_flg}")
+ endif (_flags)
+ SET_TARGET_PROPERTIES(${_target} PROPERTIES LINK_FLAGS "${_flags}")
+
+ENDMACRO (MACRO_ADD_LINK_FLAGS)
diff --git a/kdecore/cmake/modules/MacroAdditionalCleanFiles.cmake b/kdecore/cmake/modules/MacroAdditionalCleanFiles.cmake
new file mode 100644
index 0000000..593182f
--- /dev/null
+++ b/kdecore/cmake/modules/MacroAdditionalCleanFiles.cmake
@@ -0,0 +1,21 @@
+# - MACRO_ADDITIONAL_CLEAN_FILES(files...)
+# MACRO_OPTIONAL_FIND_PACKAGE( <name> [QUIT] )
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+MACRO (MACRO_ADDITIONAL_CLEAN_FILES)
+ GET_DIRECTORY_PROPERTY(_tmp_DIR_PROPS ADDITIONAL_MAKE_CLEAN_FILES )
+
+ if (_tmp_DIR_PROPS)
+ set(_tmp_DIR_PROPS ${_tmp_DIR_PROPS} ${ARGN})
+ else (_tmp_DIR_PROPS)
+ set(_tmp_DIR_PROPS ${ARGN})
+ endif (_tmp_DIR_PROPS)
+
+ SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${_tmp_DIR_PROPS}")
+ENDMACRO (MACRO_ADDITIONAL_CLEAN_FILES)
+
diff --git a/kdecore/cmake/modules/MacroAppendIf.cmake b/kdecore/cmake/modules/MacroAppendIf.cmake
new file mode 100644
index 0000000..86fe014
--- /dev/null
+++ b/kdecore/cmake/modules/MacroAppendIf.cmake
@@ -0,0 +1,22 @@
+# MACRO_APPEND_IF(CONDITION VAR VALUE1...VALUEN )
+# This convenience macro appends the values VALUE1 up to VALUEN to the list
+# given in VAR, but only if the variable CONDITION is TRUE:
+#
+# usage example:
+# IF(SOMELIB_FOUND)
+# SET(my_sources ${my_sources} somefile.c someotherfile.c)
+# ENDIF(SOMELIB_FOUND)
+#
+# becomes:
+# MACRO_APPEND_IF(SOMELIB_FOUND my_sources somefile.c someotherfile.c)
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+macro(macro_append_if _cond _list)
+ if(${_cond})
+ list(APPEND ${_list} ${ARGN})
+ endif(${_cond})
+endmacro(macro_append_if _cond _list)
diff --git a/kdecore/cmake/modules/MacroBoolTo01.cmake b/kdecore/cmake/modules/MacroBoolTo01.cmake
new file mode 100644
index 0000000..63b9852
--- /dev/null
+++ b/kdecore/cmake/modules/MacroBoolTo01.cmake
@@ -0,0 +1,20 @@
+# MACRO_BOOL_TO_01( VAR RESULT0 ... RESULTN )
+# This macro evaluates its first argument
+# and sets all the given vaiables either to 0 or 1
+# depending on the value of the first one
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+MACRO(MACRO_BOOL_TO_01 FOUND_VAR )
+ FOREACH (_current_VAR ${ARGN})
+ IF(${FOUND_VAR})
+ SET(${_current_VAR} 1)
+ ELSE(${FOUND_VAR})
+ SET(${_current_VAR} 0)
+ ENDIF(${FOUND_VAR})
+ ENDFOREACH(_current_VAR)
+ENDMACRO(MACRO_BOOL_TO_01)
diff --git a/kdecore/cmake/modules/MacroEnsureOutOfSourceBuild.cmake b/kdecore/cmake/modules/MacroEnsureOutOfSourceBuild.cmake
new file mode 100644
index 0000000..cb26e0c
--- /dev/null
+++ b/kdecore/cmake/modules/MacroEnsureOutOfSourceBuild.cmake
@@ -0,0 +1,20 @@
+# - MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>)
+# MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>)
+# Call this macro in your project if you want to enforce out-of-source builds.
+# If an in-source build is detected, it will abort with the given error message.
+# This macro works in any of the CMakeLists.txt of your project, but the recommended
+# location to call this is close to the beginning of the top level CMakeLists.txt
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+MACRO (MACRO_ENSURE_OUT_OF_SOURCE_BUILD _errorMessage)
+
+ STRING(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource)
+ IF(insource)
+ MESSAGE(FATAL_ERROR "${_errorMessage}")
+ ENDIF(insource)
+
+ENDMACRO (MACRO_ENSURE_OUT_OF_SOURCE_BUILD)
diff --git a/kdecore/cmake/modules/MacroEnsureVersion.cmake b/kdecore/cmake/modules/MacroEnsureVersion.cmake
new file mode 100644
index 0000000..6797e5b
--- /dev/null
+++ b/kdecore/cmake/modules/MacroEnsureVersion.cmake
@@ -0,0 +1,117 @@
+# This file defines the following macros for developers to use in ensuring
+# that installed software is of the right version:
+#
+# MACRO_ENSURE_VERSION - test that a version number is greater than
+# or equal to some minimum
+# MACRO_ENSURE_VERSION_RANGE - test that a version number is greater than
+# or equal to some minimum and less than some
+# maximum
+# MACRO_ENSURE_VERSION2 - deprecated, do not use in new code
+#
+
+# MACRO_ENSURE_VERSION
+# This macro compares version numbers of the form "x.y.z" or "x.y"
+# MACRO_ENSURE_VERSION( FOO_MIN_VERSION FOO_VERSION_FOUND FOO_VERSION_OK)
+# will set FOO_VERSION_OK to true if FOO_VERSION_FOUND >= FOO_MIN_VERSION
+# Leading and trailing text is ok, e.g.
+# MACRO_ENSURE_VERSION( "2.5.31" "flex 2.5.4a" VERSION_OK)
+# which means 2.5.31 is required and "flex 2.5.4a" is what was found on the system
+
+# Copyright (c) 2006, David Faure, <faure@kde.org>
+# Copyright (c) 2007, Will Stephenson <wstephenson@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+# MACRO_ENSURE_VERSION_RANGE
+# This macro ensures that a version number of the form
+# "x.y.z" or "x.y" falls within a range defined by
+# min_version <= found_version < max_version.
+# If this expression holds, FOO_VERSION_OK will be set TRUE
+#
+# Example: MACRO_ENSURE_VERSION_RANGE3( "0.1.0" ${FOOCODE_VERSION} "0.7.0" FOO_VERSION_OK )
+#
+# This macro will break silently if any of x,y,z are greater than 100.
+#
+# Copyright (c) 2007, Will Stephenson <wstephenson@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+# NORMALIZE_VERSION
+# Helper macro to convert version numbers of the form "x.y.z"
+# to an integer equal to 10^4 * x + 10^2 * y + z
+#
+# This macro will break silently if any of x,y,z are greater than 100.
+#
+# Copyright (c) 2006, David Faure, <faure@kde.org>
+# Copyright (c) 2007, Will Stephenson <wstephenson@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+# CHECK_RANGE_INCLUSIVE_LOWER
+# Helper macro to check whether x <= y < z
+#
+# Copyright (c) 2007, Will Stephenson <wstephenson@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+MACRO(NORMALIZE_VERSION _requested_version _normalized_version)
+ STRING(REGEX MATCH "[^0-9]*[0-9]+\\.[0-9]+\\.[0-9]+.*" _threePartMatch "${_requested_version}")
+ if (_threePartMatch)
+ # parse the parts of the version string
+ STRING(REGEX REPLACE "[^0-9]*([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" _major_vers "${_requested_version}")
+ STRING(REGEX REPLACE "[^0-9]*[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" _minor_vers "${_requested_version}")
+ STRING(REGEX REPLACE "[^0-9]*[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" _patch_vers "${_requested_version}")
+ else (_threePartMatch)
+ STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+" "\\1" _major_vers "${_requested_version}")
+ STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)" "\\1" _minor_vers "${_requested_version}")
+ set(_patch_vers "0")
+ endif (_threePartMatch)
+
+ # compute an overall version number which can be compared at once
+ MATH(EXPR ${_normalized_version} "${_major_vers}*10000 + ${_minor_vers}*100 + ${_patch_vers}")
+ENDMACRO(NORMALIZE_VERSION)
+
+MACRO(MACRO_CHECK_RANGE_INCLUSIVE_LOWER _lower_limit _value _upper_limit _ok)
+ if (${_value} LESS ${_lower_limit})
+ set( ${_ok} FALSE )
+ elseif (${_value} EQUAL ${_lower_limit})
+ set( ${_ok} TRUE )
+ elseif (${_value} EQUAL ${_upper_limit})
+ set( ${_ok} FALSE )
+ elseif (${_value} GREATER ${_upper_limit})
+ set( ${_ok} FALSE )
+ else (${_value} LESS ${_lower_limit})
+ set( ${_ok} TRUE )
+ endif (${_value} LESS ${_lower_limit})
+ENDMACRO(MACRO_CHECK_RANGE_INCLUSIVE_LOWER)
+
+MACRO(MACRO_ENSURE_VERSION requested_version found_version var_too_old)
+ NORMALIZE_VERSION( ${requested_version} req_vers_num )
+ NORMALIZE_VERSION( ${found_version} found_vers_num )
+
+ if (found_vers_num LESS req_vers_num)
+ set( ${var_too_old} FALSE )
+ else (found_vers_num LESS req_vers_num)
+ set( ${var_too_old} TRUE )
+ endif (found_vers_num LESS req_vers_num)
+
+ENDMACRO(MACRO_ENSURE_VERSION)
+
+MACRO(MACRO_ENSURE_VERSION2 requested_version2 found_version2 var_too_old2)
+ MACRO_ENSURE_VERSION( ${requested_version2} ${found_version2} ${var_too_old2})
+ENDMACRO(MACRO_ENSURE_VERSION2)
+
+MACRO(MACRO_ENSURE_VERSION_RANGE min_version found_version max_version var_ok)
+ NORMALIZE_VERSION( ${min_version} req_vers_num )
+ NORMALIZE_VERSION( ${found_version} found_vers_num )
+ NORMALIZE_VERSION( ${max_version} max_vers_num )
+
+ MACRO_CHECK_RANGE_INCLUSIVE_LOWER( ${req_vers_num} ${found_vers_num} ${max_vers_num} ${var_ok})
+ENDMACRO(MACRO_ENSURE_VERSION_RANGE)
+
+
diff --git a/kdecore/cmake/modules/MacroKAuth.cmake b/kdecore/cmake/modules/MacroKAuth.cmake
new file mode 100644
index 0000000..2bde63c
--- /dev/null
+++ b/kdecore/cmake/modules/MacroKAuth.cmake
@@ -0,0 +1,3 @@
+message(FATAL_ERROR "Don't include(MacroKAuth) anymore, it's now included in find_package(KDE4). This file will be removed soon, and will not appear in KDE 4.4 release.")
+
+
diff --git a/kdecore/cmake/modules/MacroLibrary.cmake b/kdecore/cmake/modules/MacroLibrary.cmake
new file mode 100644
index 0000000..a467d84
--- /dev/null
+++ b/kdecore/cmake/modules/MacroLibrary.cmake
@@ -0,0 +1,19 @@
+# - include MacroLibrary offers a collection of macros which extend the built-in cmake commands
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+INCLUDE(MacroOptionalFindPackage)
+INCLUDE(MacroOptionalAddSubdirectory)
+INCLUDE(MacroAdditionalCleanFiles)
+INCLUDE(MacroAddFileDependencies)
+INCLUDE(MacroAddCompileFlags)
+INCLUDE(MacroAddLinkFlags)
+INCLUDE(MacroAppendIf)
+INCLUDE(MacroEnsureOutOfSourceBuild)
+INCLUDE(MacroBoolTo01)
+INCLUDE(MacroPushRequiredVars)
+INCLUDE(MacroLogFeature)
+INCLUDE(MacroWriteBasicCMakeVersionFile)
diff --git a/kdecore/cmake/modules/MacroLogFeature.cmake b/kdecore/cmake/modules/MacroLogFeature.cmake
new file mode 100644
index 0000000..45e27b6
--- /dev/null
+++ b/kdecore/cmake/modules/MacroLogFeature.cmake
@@ -0,0 +1,157 @@
+# This file defines the Feature Logging macros.
+#
+# MACRO_LOG_FEATURE(VAR FEATURE DESCRIPTION URL [REQUIRED [MIN_VERSION [COMMENTS]]])
+# Logs the information so that it can be displayed at the end
+# of the configure run
+# VAR : TRUE or FALSE, indicating whether the feature is supported
+# FEATURE: name of the feature, e.g. "libjpeg"
+# DESCRIPTION: description what this feature provides
+# URL: home page
+# REQUIRED: TRUE or FALSE, indicating whether the featue is required
+# MIN_VERSION: minimum version number. empty string if unneeded
+# COMMENTS: More info you may want to provide. empty string if unnecessary
+#
+# MACRO_DISPLAY_FEATURE_LOG()
+# Call this to display the collected results.
+# Exits CMake with a FATAL error message if a required feature is missing
+#
+# Example:
+#
+# INCLUDE(MacroLogFeature)
+#
+# FIND_PACKAGE(JPEG)
+# MACRO_LOG_FEATURE(JPEG_FOUND "libjpeg" "Support JPEG images" "http://www.ijg.org" TRUE "3.2a" "")
+# ...
+# MACRO_DISPLAY_FEATURE_LOG()
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+# Copyright (c) 2006, Allen Winter, <winter@kde.org>
+# Copyright (c) 2009, Sebastian Trueg, <trueg@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+IF (NOT _macroLogFeatureAlreadyIncluded)
+ SET(_file ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
+ IF (EXISTS ${_file})
+ FILE(REMOVE ${_file})
+ ENDIF (EXISTS ${_file})
+
+ SET(_file ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
+ IF (EXISTS ${_file})
+ FILE(REMOVE ${_file})
+ ENDIF (EXISTS ${_file})
+
+ SET(_file ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)
+ IF (EXISTS ${_file})
+ FILE(REMOVE ${_file})
+ ENDIF (EXISTS ${_file})
+
+ SET(_macroLogFeatureAlreadyIncluded TRUE)
+
+ INCLUDE(FeatureSummary)
+
+ENDIF (NOT _macroLogFeatureAlreadyIncluded)
+
+
+MACRO(MACRO_LOG_FEATURE _var _package _description _url ) # _required _minvers _comments)
+
+ STRING(TOUPPER "${ARGV4}" _required)
+ SET(_minvers "${ARGV5}")
+ SET(_comments "${ARGV6}")
+
+ IF (${_var})
+ SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
+ ELSE (${_var})
+ IF ("${_required}" STREQUAL "TRUE")
+ SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
+ ELSE ("${_required}" STREQUAL "TRUE")
+ SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)
+ ENDIF ("${_required}" STREQUAL "TRUE")
+ ENDIF (${_var})
+
+ SET(_logtext " * ${_package}")
+
+ IF (NOT ${_var})
+ IF (${_minvers} MATCHES ".*")
+ SET(_logtext "${_logtext} (${_minvers} or higher)")
+ ENDIF (${_minvers} MATCHES ".*")
+ SET(_logtext "${_logtext} <${_url}>\n ")
+ ELSE (NOT ${_var})
+ SET(_logtext "${_logtext} - ")
+ ENDIF (NOT ${_var})
+
+ SET(_logtext "${_logtext}${_description}")
+
+ IF (NOT ${_var})
+ IF (${_comments} MATCHES ".*")
+ SET(_logtext "${_logtext}\n ${_comments}")
+ ENDIF (${_comments} MATCHES ".*")
+# SET(_logtext "${_logtext}\n") #double-space missing features?
+ ENDIF (NOT ${_var})
+
+ FILE(APPEND "${_LOGFILENAME}" "${_logtext}\n")
+
+ IF(COMMAND SET_PACKAGE_INFO) # in FeatureSummary.cmake since CMake 2.8.3
+ SET_PACKAGE_INFO("${_package}" "\"${_description}\"" "${_url}" "\"${_comments}\"")
+ ENDIF(COMMAND SET_PACKAGE_INFO)
+
+ENDMACRO(MACRO_LOG_FEATURE)
+
+
+MACRO(MACRO_DISPLAY_FEATURE_LOG)
+ IF(COMMAND FEATURE_SUMMARY) # in FeatureSummary.cmake since CMake 2.8.3
+ FEATURE_SUMMARY(FILENAME ${CMAKE_CURRENT_BINARY_DIR}/FindPackageLog.txt
+ WHAT ALL)
+ ENDIF(COMMAND FEATURE_SUMMARY)
+
+ SET(_missingFile ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
+ SET(_enabledFile ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
+ SET(_disabledFile ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)
+
+ IF (EXISTS ${_missingFile} OR EXISTS ${_enabledFile} OR EXISTS ${_disabledFile})
+ SET(_printSummary TRUE)
+ ENDIF (EXISTS ${_missingFile} OR EXISTS ${_enabledFile} OR EXISTS ${_disabledFile})
+
+ IF(_printSummary)
+ SET(_missingDeps 0)
+ IF (EXISTS ${_enabledFile})
+ FILE(READ ${_enabledFile} _enabled)
+ FILE(REMOVE ${_enabledFile})
+ SET(_summary "${_summary}\n-----------------------------------------------------------------------------\n-- The following external packages were located on your system.\n-- This installation will have the extra features provided by these packages.\n-----------------------------------------------------------------------------\n${_enabled}")
+ ENDIF (EXISTS ${_enabledFile})
+
+
+ IF (EXISTS ${_disabledFile})
+ SET(_missingDeps 1)
+ FILE(READ ${_disabledFile} _disabled)
+ FILE(REMOVE ${_disabledFile})
+ SET(_summary "${_summary}\n-----------------------------------------------------------------------------\n-- The following OPTIONAL packages could NOT be located on your system.\n-- Consider installing them to enable more features from this software.\n-----------------------------------------------------------------------------\n${_disabled}")
+ ENDIF (EXISTS ${_disabledFile})
+
+
+ IF (EXISTS ${_missingFile})
+ SET(_missingDeps 1)
+ FILE(READ ${_missingFile} _requirements)
+ SET(_summary "${_summary}\n-----------------------------------------------------------------------------\n-- The following REQUIRED packages could NOT be located on your system.\n-- You must install these packages before continuing.\n-----------------------------------------------------------------------------\n${_requirements}")
+ FILE(REMOVE ${_missingFile})
+ SET(_haveMissingReq 1)
+ ENDIF (EXISTS ${_missingFile})
+
+
+ IF (NOT ${_missingDeps})
+ SET(_summary "${_summary}\n-----------------------------------------------------------------------------\n-- Congratulations! All external packages have been found.")
+ ENDIF (NOT ${_missingDeps})
+
+
+ MESSAGE(${_summary})
+ MESSAGE("-----------------------------------------------------------------------------\n")
+
+
+ IF(_haveMissingReq)
+ MESSAGE(FATAL_ERROR "Exiting: Missing Requirements")
+ ENDIF(_haveMissingReq)
+
+ ENDIF(_printSummary)
+
+ENDMACRO(MACRO_DISPLAY_FEATURE_LOG)
diff --git a/kdecore/cmake/modules/MacroOptionalAddSubdirectory.cmake b/kdecore/cmake/modules/MacroOptionalAddSubdirectory.cmake
new file mode 100644
index 0000000..ec0ea30
--- /dev/null
+++ b/kdecore/cmake/modules/MacroOptionalAddSubdirectory.cmake
@@ -0,0 +1,41 @@
+# - MACRO_OPTIONAL_ADD_SUBDIRECTORY() combines ADD_SUBDIRECTORY() with an OPTION()
+# MACRO_OPTIONAL_ADD_SUBDIRECTORY( <dir> )
+# If you use MACRO_OPTIONAL_ADD_SUBDIRECTORY() instead of ADD_SUBDIRECTORY(),
+# this will have two effects
+# 1 - CMake will not complain if the directory doesn't exist
+# This makes sense if you want to distribute just one of the subdirs
+# in a source package, e.g. just one of the subdirs in kdeextragear.
+# 2 - If the directory exists, it will offer an option to skip the
+# subdirectory.
+# This is useful if you want to compile only a subset of all
+# directories.
+#
+# If the CMake variable DISABLE_ALL_OPTIONAL_SUBDIRECTORIES is set to TRUE
+# for the first CMake run on the project, all optional subdirectories will be disabled
+# by default (but can of course be enabled via the respective options).
+# E.g. the following will disable all optional subdirectories except the one named "kcalc":
+# $ cmake -DDISABLE_ALL_OPTIONAL_SUBDIRECTORIES=TRUE -DBUILD_kcalc=TRUE <srcdir>
+
+# Copyright (c) 2007, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+MACRO (MACRO_OPTIONAL_ADD_SUBDIRECTORY _dir )
+ GET_FILENAME_COMPONENT(_fullPath ${_dir} ABSOLUTE)
+ IF(EXISTS ${_fullPath}/CMakeLists.txt)
+ IF(DISABLE_ALL_OPTIONAL_SUBDIRECTORIES)
+ SET(_DEFAULT_OPTION_VALUE FALSE)
+ ELSE(DISABLE_ALL_OPTIONAL_SUBDIRECTORIES)
+ SET(_DEFAULT_OPTION_VALUE TRUE)
+ ENDIF(DISABLE_ALL_OPTIONAL_SUBDIRECTORIES)
+ IF(DISABLE_ALL_OPTIONAL_SUBDIRS AND NOT DEFINED BUILD_${_dir})
+ SET(_DEFAULT_OPTION_VALUE FALSE)
+ ENDIF(DISABLE_ALL_OPTIONAL_SUBDIRS AND NOT DEFINED BUILD_${_dir})
+ OPTION(BUILD_${_dir} "Build directory ${_dir}" ${_DEFAULT_OPTION_VALUE})
+ IF(BUILD_${_dir})
+ ADD_SUBDIRECTORY(${_dir})
+ ENDIF(BUILD_${_dir})
+ ENDIF(EXISTS ${_fullPath}/CMakeLists.txt)
+ENDMACRO (MACRO_OPTIONAL_ADD_SUBDIRECTORY)
diff --git a/kdecore/cmake/modules/MacroOptionalDependPackage.cmake b/kdecore/cmake/modules/MacroOptionalDependPackage.cmake
new file mode 100644
index 0000000..2ea7996
--- /dev/null
+++ b/kdecore/cmake/modules/MacroOptionalDependPackage.cmake
@@ -0,0 +1,22 @@
+# Search if cmake module is installed in computer
+# cmake will not fail but signal that we must install depend package before.
+# add as previously name of cmake module "_name" and define package needed "_module_needed"
+# if return DEPEND_PACKAGE_${_name}
+
+# Copyright (c) 2007, Montel Laurent <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+macro (MACRO_OPTIONAL_DEPEND_PACKAGE _name _module_needed)
+ set(_packagename Find${_name}.cmake)
+ find_file(_PACKAGE_DEPEND_FOUND ${_packagename} PATHS ${CMAKE_MODULE_PATH} )
+ if(NOT _PACKAGE_DEPEND_FOUND)
+ message(STATUS "optional cmake package ${_packagename} (for ${_module_needed}) was not found.")
+ set(DEPEND_PACKAGE_${_name} FALSE)
+ else(NOT _PACKAGE_DEPEND_FOUND)
+ set(DEPEND_PACKAGE_${_name} TRUE)
+ endif(NOT _PACKAGE_DEPEND_FOUND)
+endmacro (MACRO_OPTIONAL_DEPEND_PACKAGE)
+
diff --git a/kdecore/cmake/modules/MacroOptionalFindPackage.cmake b/kdecore/cmake/modules/MacroOptionalFindPackage.cmake
new file mode 100644
index 0000000..d4ed48e
--- /dev/null
+++ b/kdecore/cmake/modules/MacroOptionalFindPackage.cmake
@@ -0,0 +1,48 @@
+# - MACRO_OPTIONAL_FIND_PACKAGE() combines FIND_PACKAGE() with an OPTION()
+# MACRO_OPTIONAL_FIND_PACKAGE( <name> [QUIT] )
+# This macro is a combination of OPTION() and FIND_PACKAGE(), it
+# works like FIND_PACKAGE(), but additionally it automatically creates
+# an option name WITH_<name>, which can be disabled via the cmake GUI.
+# or via -DWITH_<name>=OFF
+# The standard <name>_FOUND variables can be used in the same way
+# as when using the normal FIND_PACKAGE()
+
+# Copyright (c) 2006-2010 Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+# This is just a helper macro to set a bunch of variables empty.
+# We don't know whether the package uses UPPERCASENAME or CamelCaseName, so we try both:
+macro(_MOFP_SET_EMPTY_IF_DEFINED _name _var)
+ if(DEFINED ${_name}_${_var})
+ set(${_name}_${_var} "")
+ endif(DEFINED ${_name}_${_var})
+
+ string(TOUPPER ${_name} _nameUpper)
+ if(DEFINED ${_nameUpper}_${_var})
+ set(${_nameUpper}_${_var} "")
+ endif(DEFINED ${_nameUpper}_${_var})
+endmacro(_MOFP_SET_EMPTY_IF_DEFINED _package _var)
+
+
+macro (MACRO_OPTIONAL_FIND_PACKAGE _name )
+ option(WITH_${_name} "Search for ${_name} package" ON)
+ if (WITH_${_name})
+ find_package(${_name} ${ARGN})
+ else (WITH_${_name})
+ string(TOUPPER ${_name} _nameUpper)
+ set(${_name}_FOUND FALSE)
+ set(${_nameUpper}_FOUND FALSE)
+
+ _mofp_set_empty_if_defined(${_name} INCLUDE_DIRS)
+ _mofp_set_empty_if_defined(${_name} INCLUDE_DIR)
+ _mofp_set_empty_if_defined(${_name} INCLUDES)
+ _mofp_set_empty_if_defined(${_name} LIBRARY)
+ _mofp_set_empty_if_defined(${_name} LIBRARIES)
+ _mofp_set_empty_if_defined(${_name} LIBS)
+ _mofp_set_empty_if_defined(${_name} FLAGS)
+ _mofp_set_empty_if_defined(${_name} DEFINITIONS)
+ endif (WITH_${_name})
+endmacro (MACRO_OPTIONAL_FIND_PACKAGE)
+
diff --git a/kdecore/cmake/modules/MacroPushRequiredVars.cmake b/kdecore/cmake/modules/MacroPushRequiredVars.cmake
new file mode 100644
index 0000000..650b566
--- /dev/null
+++ b/kdecore/cmake/modules/MacroPushRequiredVars.cmake
@@ -0,0 +1,47 @@
+# this module defines two macros:
+# MACRO_PUSH_REQUIRED_VARS()
+# and
+# MACRO_POP_REQUIRED_VARS()
+# use these if you call cmake macros which use
+# any of the CMAKE_REQUIRED_XXX variables
+#
+# Usage:
+# MACRO_PUSH_REQUIRED_VARS()
+# SET(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DSOME_MORE_DEF)
+# CHECK_FUNCTION_EXISTS(...)
+# MACRO_POP_REQUIRED_VARS()
+
+# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+MACRO(MACRO_PUSH_REQUIRED_VARS)
+
+ IF(NOT DEFINED _PUSH_REQUIRED_VARS_COUNTER)
+ SET(_PUSH_REQUIRED_VARS_COUNTER 0)
+ ENDIF(NOT DEFINED _PUSH_REQUIRED_VARS_COUNTER)
+
+ MATH(EXPR _PUSH_REQUIRED_VARS_COUNTER "${_PUSH_REQUIRED_VARS_COUNTER}+1")
+
+ SET(_CMAKE_REQUIRED_INCLUDES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_INCLUDES})
+ SET(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
+ SET(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_LIBRARIES})
+ SET(_CMAKE_REQUIRED_FLAGS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER} ${CMAKE_REQUIRED_FLAGS})
+ENDMACRO(MACRO_PUSH_REQUIRED_VARS)
+
+MACRO(MACRO_POP_REQUIRED_VARS)
+
+# don't pop more than we pushed
+ IF("${_PUSH_REQUIRED_VARS_COUNTER}" GREATER "0")
+
+ SET(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})
+ SET(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})
+ SET(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})
+ SET(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_PUSH_REQUIRED_VARS_COUNTER}})
+
+ MATH(EXPR _PUSH_REQUIRED_VARS_COUNTER "${_PUSH_REQUIRED_VARS_COUNTER}-1")
+ ENDIF("${_PUSH_REQUIRED_VARS_COUNTER}" GREATER "0")
+
+ENDMACRO(MACRO_POP_REQUIRED_VARS)
+
diff --git a/kdecore/cmake/modules/MacroWriteBasicCMakeVersionFile.cmake b/kdecore/cmake/modules/MacroWriteBasicCMakeVersionFile.cmake
new file mode 100644
index 0000000..6f9e418
--- /dev/null
+++ b/kdecore/cmake/modules/MacroWriteBasicCMakeVersionFile.cmake
@@ -0,0 +1,22 @@
+# MACRO_WRITE_BASIC_CMAKE_VERSION_FILE( _filename _major _minor _patch)
+# Writes a file for use as <package>ConfigVersion.cmake file to <_filename>.
+# See the documentation of FIND_PACKAGE() for details on this.
+# _filename is the output filename, it should be in the build tree.
+# _major is the major version number of the project to be installed
+# _minor is the minor version number of the project to be installed
+# _patch is the patch version number of the project to be installed
+#
+
+# Copyright (c) 2008, Alexander Neundorf, <neundorf@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+get_filename_component(_currentListFileDir ${CMAKE_CURRENT_LIST_FILE} PATH)
+
+function(MACRO_WRITE_BASIC_CMAKE_VERSION_FILE _filename _major _minor _patch)
+ set(PROJECT_VERSION_MAJOR ${_major})
+ set(PROJECT_VERSION_MINOR ${_minor})
+ set(PROJECT_VERSION_PATCH ${_patch})
+ configure_file(${_currentListFileDir}/BasicFindPackageVersion.cmake.in "${_filename}" @ONLY)
+endfunction(MACRO_WRITE_BASIC_CMAKE_VERSION_FILE _major _minor _patch)
diff --git a/kdecore/cmake/modules/NepomukAddOntologyClasses.cmake b/kdecore/cmake/modules/NepomukAddOntologyClasses.cmake
new file mode 100644
index 0000000..a2bdd5b
--- /dev/null
+++ b/kdecore/cmake/modules/NepomukAddOntologyClasses.cmake
@@ -0,0 +1,115 @@
+#
+# Use the Nepomuk resource class generator to generate convinient Resource subclasses
+# from ontologies.
+#
+# Usage:
+# NEPOMUK_ADD_ONTOLOGY_CLASSES(<sources-var>
+# [FAST]
+# [ONTOLOGIES] <onto-file1> [<onto-file2> ...]
+# [CLASSES <class1> [<class2> ...]]
+# [VISIBILITY <visibility-name>]
+# )
+#
+# If FAST is specified the rcgen parameter --fast will be used which results in resource classes
+# not based on Nepomuk::Resource but on a custom class which does not perform any checks and simply
+# writes the data to Nepomuk (hence the name fast).
+#
+# The optional CLASSES parameter allows to specify the classes to be generated (RDF URIs) in
+# case one does not want all classes in the ontologies to be generated.
+#
+# The optional VISIBILITY parameter can only be used in non-fast mode and allows to set the gcc visibility
+# to make the generated classes usable in a publically exported API. The <visibility-name> is used to create
+# the name of the export macro and the export include file. Thus, when using "VISIBILITY foobar" include
+# file "foobar_export.h" needs to define FOOBAR_EXPORT.
+#
+# Copyright (c) 2009 Sebastian Trueg <trueg@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+macro(NEPOMUK_ADD_ONTOLOGY_CLASSES _sources)
+ # extract arguments
+ set(_current_arg_type "onto")
+ foreach(_arg ${ARGN})
+ if(${_arg} STREQUAL "ONTOLOGIES")
+ set(_current_arg_type "onto")
+ elseif(${_arg} STREQUAL "VISIBILITY")
+ set(_current_arg_type "visib")
+ elseif(${_arg} STREQUAL "CLASSES")
+ set(_current_arg_type "class")
+ elseif(${_arg} STREQUAL "FAST")
+ set(_fastmode "--fast")
+ else(${_arg} STREQUAL "ONTOLOGIES")
+ if(${_current_arg_type} STREQUAL "onto")
+ list(APPEND _ontologies ${_arg})
+ get_filename_component(_filename ${_arg} NAME)
+ list(APPEND _ontofilenames ${_filename})
+ elseif(${_current_arg_type} STREQUAL "class")
+ list(APPEND _classes "--class" "${_arg}")
+ else(${_current_arg_type} STREQUAL "onto")
+ set(_visibility "--visibility" "${_arg}")
+ endif(${_current_arg_type} STREQUAL "onto")
+ endif(${_arg} STREQUAL "ONTOLOGIES")
+ endforeach(_arg)
+
+ # find our helper program (first in the install dir, then everywhere)
+ if(NOT WINCE)
+ find_program(RCGEN nepomuk-rcgen PATHS ${KDE4_BIN_INSTALL_DIR} ${BIN_INSTALL_DIR} NO_DEFAULT_PATH)
+ find_program(RCGEN nepomuk-rcgen)
+ else(NOT WINCE)
+ find_program(RCGEN nepomuk-rcgen PATHS ${HOST_BINDIR} NO_DEFAULT_PATH)
+ endif(NOT WINCE)
+
+ if(NOT RCGEN)
+ message(SEND_ERROR "Failed to find the Nepomuk source generator" )
+ else(NOT RCGEN)
+ file(TO_NATIVE_PATH ${RCGEN} RCGEN)
+
+ # we generate the files in the current binary dir
+ set(_targetdir ${CMAKE_CURRENT_BINARY_DIR})
+
+ # generate the list of source and header files
+ execute_process(
+ COMMAND ${RCGEN} ${_fastmode} --listheaders --prefix ${_targetdir}/ ${_classes} ${_visibility} ${_ontologies}
+ OUTPUT_VARIABLE _out_headers
+ RESULT_VARIABLE rcgen_result
+ )
+ if(NOT ${rcgen_result} EQUAL 0)
+ message(SEND_ERROR "Running ${RCGEN} to generate list of headers failed with error code ${rcgen_result}")
+ endif(NOT ${rcgen_result} EQUAL 0)
+
+ execute_process(
+ COMMAND ${RCGEN} ${_fastmode} --listsources --prefix ${_targetdir}/ ${_classes} ${_visibility} ${_ontologies}
+ OUTPUT_VARIABLE _out_sources
+ RESULT_VARIABLE rcgen_result
+ )
+ if(NOT ${rcgen_result} EQUAL 0)
+ message(SEND_ERROR "Running ${RCGEN} to generate list of sources failed with error code ${rcgen_result}")
+ endif(NOT ${rcgen_result} EQUAL 0)
+
+ add_custom_command(OUTPUT ${_out_headers} ${_out_sources}
+ COMMAND ${RCGEN} ${_fastmode} --writeall --target ${_targetdir}/ ${_classes} ${_visibility} ${_ontologies}
+ DEPENDS ${_ontologies}
+ COMMENT "Generating ontology source files from ${_ontofilenames}"
+ )
+
+ # make sure the includes are found
+ include_directories(${_targetdir})
+
+ # finally append the source files to the source list
+ list(APPEND ${_sources} ${_out_sources})
+ endif(NOT RCGEN)
+
+ # reset variable names used
+ unset(_current_arg_type)
+ unset(_arg)
+ unset(_ontologies)
+ unset(_ontofilenames)
+ unset(_classes)
+ unset(_visibility)
+ unset(_fastmode)
+ unset(_targetdir)
+ unset(_out_headers)
+ unset(_out_sources)
+ unset(rcgen_result)
+endmacro(NEPOMUK_ADD_ONTOLOGY_CLASSES)
diff --git a/kdecore/cmake/modules/NepomukMacros.cmake b/kdecore/cmake/modules/NepomukMacros.cmake
new file mode 100644
index 0000000..14acd2b
--- /dev/null
+++ b/kdecore/cmake/modules/NepomukMacros.cmake
@@ -0,0 +1,67 @@
+# This file contains the following macros:
+#
+# NEPOMUK_GENERATE_FROM_ONTOLOGY
+# Parameters:
+# ontofile - Path to the NRL ontology defining the resources to be generated.
+# targetdir - Folder to which the generated sources should be written.
+# out_headers - Variable which will be filled with the names of all generated headers.
+# out_sources - Variable which will be filled with the names of all generated sources.
+# out_includes - Variable which will be filled with complete include statements of all
+# generated resource classes.
+#
+# In addition to the parameters an arbitrary number of template filenames can be set as arguments
+#
+# In case of success NEPOMUK_RESOURCES_GENERATED is true, otherwise false
+
+# (C) 2007 Sebastian Trueg <trueg@kde.org>
+
+
+macro(NEPOMUK_GENERATE_FROM_ONTOLOGY ontofile targetdir out_headers out_sources out_includes)
+
+ # init
+ set(NEPOMUK_RESOURCES_GENERATED false)
+
+ find_program(RCGEN nepomuk-rcgen PATHS ${KDE4_BIN_INSTALL_DIR} ${BIN_INSTALL_DIR} NO_DEFAULT_PATH)
+
+ if(NOT RCGEN)
+
+ message(STATUS "Failed to find the Nepomuk source generator" )
+
+ else(NOT RCGEN)
+
+ FILE(TO_NATIVE_PATH ${RCGEN} RCGEN)
+
+ execute_process(
+ COMMAND ${RCGEN} --listheaders --prefix ${targetdir}/ --ontologies ${ontofile}
+ OUTPUT_VARIABLE ${out_headers}
+ RESULT_VARIABLE rcgen_result
+ )
+
+ # If the first call succeeds it is very very likely that the rest will, too
+ if(${rcgen_result} EQUAL 0)
+
+ execute_process(
+ COMMAND ${RCGEN} --listsources --prefix ${targetdir}/ --ontologies ${ontofile}
+ OUTPUT_VARIABLE ${out_sources}
+ )
+
+ execute_process(
+ COMMAND ${RCGEN} --listincludes --ontologies ${ontofile}
+ OUTPUT_VARIABLE ${out_includes}
+ )
+
+ execute_process(
+ COMMAND ${RCGEN} --writeall --templates ${ARGN} --target ${targetdir}/ --ontologies ${ontofile}
+ )
+
+ set(NEPOMUK_RESOURCES_GENERATED true)
+
+ else(${rcgen_result} EQUAL 0)
+
+ message(STATUS "Failed to generate Nepomuk resource classes.")
+
+ endif(${rcgen_result} EQUAL 0)
+
+ endif(NOT RCGEN)
+
+endmacro(NEPOMUK_GENERATE_FROM_ONTOLOGY)
diff --git a/kdecore/cmake/modules/PythonCompile.py b/kdecore/cmake/modules/PythonCompile.py
new file mode 100644
index 0000000..156fea2
--- /dev/null
+++ b/kdecore/cmake/modules/PythonCompile.py
@@ -0,0 +1,4 @@
+# By Simon Edwards <simon@simonzone.com>
+# This file is in the public domain.
+import py_compile, sys
+sys.exit(py_compile.main())
diff --git a/kdecore/cmake/modules/PythonMacros.cmake b/kdecore/cmake/modules/PythonMacros.cmake
new file mode 100644
index 0000000..774c6b2
--- /dev/null
+++ b/kdecore/cmake/modules/PythonMacros.cmake
@@ -0,0 +1,62 @@
+# Python macros
+# ~~~~~~~~~~~~~
+# Copyright (c) 2007, Simon Edwards <simon@simonzone.com>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+# This file defines the following macros:
+#
+# PYTHON_INSTALL (SOURCE_FILE DESINATION_DIR)
+# Install the SOURCE_FILE, which is a Python .py file, into the
+# destination directory during install. The file will be byte compiled
+# and both the .py file and .pyc file will be installed.
+
+GET_FILENAME_COMPONENT(PYTHON_MACROS_MODULE_PATH ${CMAKE_CURRENT_LIST_FILE} PATH)
+
+MACRO(PYTHON_INSTALL SOURCE_FILE DESINATION_DIR)
+
+ FIND_FILE(_python_compile_py PythonCompile.py PATHS ${CMAKE_MODULE_PATH})
+
+ ADD_CUSTOM_TARGET(compile_python_files ALL)
+
+ # Install the source file.
+ INSTALL(FILES ${SOURCE_FILE} DESTINATION ${DESINATION_DIR})
+
+ # Byte compile and install the .pyc file.
+ GET_FILENAME_COMPONENT(_absfilename ${SOURCE_FILE} ABSOLUTE)
+ GET_FILENAME_COMPONENT(_filename ${SOURCE_FILE} NAME)
+ GET_FILENAME_COMPONENT(_filenamebase ${SOURCE_FILE} NAME_WE)
+ GET_FILENAME_COMPONENT(_basepath ${SOURCE_FILE} PATH)
+
+ if(WIN32)
+ string(REGEX REPLACE ".:/" "/" _basepath "${_basepath}")
+ endif(WIN32)
+
+ SET(_bin_py ${CMAKE_CURRENT_BINARY_DIR}/${_basepath}/${_filename})
+ SET(_bin_pyc ${CMAKE_CURRENT_BINARY_DIR}/${_basepath}/${_filenamebase}.pyc)
+
+ FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_basepath})
+
+ SET(_message "-DMESSAGE=Byte-compiling ${_bin_py}")
+
+ GET_FILENAME_COMPONENT(_abs_bin_py ${_bin_py} ABSOLUTE)
+ IF(_abs_bin_py STREQUAL ${_absfilename}) # Don't copy the file onto itself.
+ ADD_CUSTOM_COMMAND(
+ TARGET compile_python_files
+ COMMAND ${CMAKE_COMMAND} -E echo ${_message}
+ COMMAND ${PYTHON_EXECUTABLE} ${_python_compile_py} ${_bin_py}
+ DEPENDS ${_absfilename}
+ )
+ ELSE(_abs_bin_py STREQUAL ${_absfilename})
+ ADD_CUSTOM_COMMAND(
+ TARGET compile_python_files
+ COMMAND ${CMAKE_COMMAND} -E echo ${_message}
+ COMMAND ${CMAKE_COMMAND} -E copy ${_absfilename} ${_bin_py}
+ COMMAND ${PYTHON_EXECUTABLE} ${_python_compile_py} ${_bin_py}
+ DEPENDS ${_absfilename}
+ )
+ ENDIF(_abs_bin_py STREQUAL ${_absfilename})
+
+ INSTALL(FILES ${_bin_pyc} DESTINATION ${DESINATION_DIR})
+ENDMACRO(PYTHON_INSTALL)
diff --git a/kdecore/cmake/modules/Qt4ConfigDependentSettings.cmake b/kdecore/cmake/modules/Qt4ConfigDependentSettings.cmake
new file mode 100644
index 0000000..b5462e7
--- /dev/null
+++ b/kdecore/cmake/modules/Qt4ConfigDependentSettings.cmake
@@ -0,0 +1,384 @@
+# This file is included by FindQt4.cmake, don't include it directly.
+
+#=============================================================================
+# Copyright 2005-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distributed this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+
+###############################################
+#
+# configuration/system dependent settings
+#
+###############################################
+
+# this check for X11 and threads may not be necessary, since it is not
+# contained in the cmake version of FindQt4.cmake:
+
+# for unix add X11 stuff
+IF(UNIX)
+ # on OS X X11 may not be required
+ IF (Q_WS_X11)
+ FIND_PACKAGE(X11 REQUIRED)
+ ENDIF (Q_WS_X11)
+ FIND_PACKAGE(Threads)
+ SET(QT_QTCORE_LIBRARY ${QT_QTCORE_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
+ENDIF(UNIX)
+
+
+# find dependencies for some Qt modules
+# when doing builds against a static Qt, they are required
+# when doing builds against a shared Qt, they are not required
+# if a user needs the dependencies, and they couldn't be found, they can set
+# the variables themselves.
+
+SET(QT_QTGUI_LIB_DEPENDENCIES "")
+SET(QT_QTCORE_LIB_DEPENDENCIES "")
+SET(QT_QTNETWORK_LIB_DEPENDENCIES "")
+SET(QT_QTOPENGL_LIB_DEPENDENCIES "")
+SET(QT_QTDBUS_LIB_DEPENDENCIES "")
+SET(QT_QTHELP_LIB_DEPENDENCIES ${QT_QTCLUCENE_LIBRARY})
+
+
+IF(WIN32)
+ # On Windows, qconfig.pri has "static" for static library builds
+ IF(QT_CONFIG MATCHES "static")
+ SET(QT_IS_STATIC 1)
+ ENDIF(QT_CONFIG MATCHES "static")
+ELSE(WIN32)
+ # On other platforms, check file extension to know if its static
+ IF(QT_QTCORE_LIBRARY_RELEASE)
+ GET_FILENAME_COMPONENT(qtcore_lib_ext "${QT_QTCORE_LIBRARY_RELEASE}" EXT)
+ IF("${qtcore_lib_ext}" STREQUAL "${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ SET(QT_IS_STATIC 1)
+ ENDIF("${qtcore_lib_ext}" STREQUAL "${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ ENDIF(QT_QTCORE_LIBRARY_RELEASE)
+ IF(QT_QTCORE_LIBRARY_DEBUG)
+ GET_FILENAME_COMPONENT(qtcore_lib_ext "${QT_QTCORE_LIBRARY_DEBUG}" EXT)
+ IF(${qtcore_lib_ext} STREQUAL ${CMAKE_STATIC_LIBRARY_SUFFIX})
+ SET(QT_IS_STATIC 1)
+ ENDIF(${qtcore_lib_ext} STREQUAL ${CMAKE_STATIC_LIBRARY_SUFFIX})
+ ENDIF(QT_QTCORE_LIBRARY_DEBUG)
+ENDIF(WIN32)
+
+# build using shared Qt needs -DQT_DLL on Windows
+IF(WIN32 AND NOT QT_IS_STATIC)
+ SET(QT_DEFINITIONS ${QT_DEFINITIONS} -DQT_DLL)
+ENDIF(WIN32 AND NOT QT_IS_STATIC)
+
+
+# QtOpenGL dependencies
+QT_QUERY_QMAKE(QMAKE_LIBS_OPENGL "QMAKE_LIBS_OPENGL")
+IF(Q_WS_MAC)
+# On the Mac OpenGL is probably frameworks and QMAKE_LIBS_OPENGL can be e.g. "-framework OpenGL -framework AGL".
+# The separate_arguments() call in the other branch makes "-framework;-OpenGL;-framework;-lAGL" appear in the
+# linker command. So we need to protect the "-framework foo" as non-separatable strings.
+# We do this by replacing the space after "-framework" with an underscore, then calling separate_arguments(),
+# and then we replace the underscores again with spaces. So we get proper linker commands. Alex
+ STRING(REGEX REPLACE "-framework +" "-framework_" QMAKE_LIBS_OPENGL "${QMAKE_LIBS_OPENGL}")
+ SEPARATE_ARGUMENTS(QMAKE_LIBS_OPENGL)
+ STRING(REGEX REPLACE "-framework_" "-framework " QMAKE_LIBS_OPENGL "${QMAKE_LIBS_OPENGL}")
+ELSE(Q_WS_MAC)
+ SEPARATE_ARGUMENTS(QMAKE_LIBS_OPENGL)
+ENDIF(Q_WS_MAC)
+SET (QT_QTOPENGL_LIB_DEPENDENCIES ${QT_QTOPENGL_LIB_DEPENDENCIES} ${QMAKE_LIBS_OPENGL})
+
+
+## system png
+IF(QT_QCONFIG MATCHES "system-png")
+ FIND_LIBRARY(QT_PNG_LIBRARY NAMES png)
+ MARK_AS_ADVANCED(QT_PNG_LIBRARY)
+ IF(QT_PNG_LIBRARY)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_PNG_LIBRARY})
+ ENDIF(QT_PNG_LIBRARY)
+ENDIF(QT_QCONFIG MATCHES "system-png")
+
+
+# for X11, get X11 library directory
+IF(Q_WS_X11)
+ QT_QUERY_QMAKE(QMAKE_LIBDIR_X11 "QMAKE_LIBDIR_X11")
+ENDIF(Q_WS_X11)
+
+
+## X11 SM
+IF(QT_QCONFIG MATCHES "x11sm")
+ # ask qmake where the x11 libs are
+ FIND_LIBRARY(QT_X11_SM_LIBRARY NAMES SM PATHS ${QMAKE_LIBDIR_X11})
+ FIND_LIBRARY(QT_X11_ICE_LIBRARY NAMES ICE PATHS ${QMAKE_LIBDIR_X11})
+ MARK_AS_ADVANCED(QT_X11_SM_LIBRARY)
+ MARK_AS_ADVANCED(QT_X11_ICE_LIBRARY)
+ IF(QT_X11_SM_LIBRARY AND QT_X11_ICE_LIBRARY)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_X11_SM_LIBRARY} ${QT_X11_ICE_LIBRARY})
+ ENDIF(QT_X11_SM_LIBRARY AND QT_X11_ICE_LIBRARY)
+ENDIF(QT_QCONFIG MATCHES "x11sm")
+
+
+## Xi
+IF(QT_QCONFIG MATCHES "tablet")
+ FIND_LIBRARY(QT_XI_LIBRARY NAMES Xi PATHS ${QMAKE_LIBDIR_X11})
+ MARK_AS_ADVANCED(QT_XI_LIBRARY)
+ IF(QT_XI_LIBRARY)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_XI_LIBRARY})
+ ENDIF(QT_XI_LIBRARY)
+ENDIF(QT_QCONFIG MATCHES "tablet")
+
+
+## Xrender
+IF(QT_QCONFIG MATCHES "xrender")
+ FIND_LIBRARY(QT_XRENDER_LIBRARY NAMES Xrender PATHS ${QMAKE_LIBDIR_X11})
+ MARK_AS_ADVANCED(QT_XRENDER_LIBRARY)
+ IF(QT_XRENDER_LIBRARY)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_XRENDER_LIBRARY})
+ ENDIF(QT_XRENDER_LIBRARY)
+ENDIF(QT_QCONFIG MATCHES "xrender")
+
+
+## Xrandr
+IF(QT_QCONFIG MATCHES "xrandr")
+ FIND_LIBRARY(QT_XRANDR_LIBRARY NAMES Xrandr PATHS ${QMAKE_LIBDIR_X11})
+ MARK_AS_ADVANCED(QT_XRANDR_LIBRARY)
+ IF(QT_XRANDR_LIBRARY)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_XRANDR_LIBRARY})
+ ENDIF(QT_XRANDR_LIBRARY)
+ENDIF(QT_QCONFIG MATCHES "xrandr")
+
+
+## Xcursor
+IF(QT_QCONFIG MATCHES "xcursor")
+ FIND_LIBRARY(QT_XCURSOR_LIBRARY NAMES Xcursor PATHS ${QMAKE_LIBDIR_X11})
+ MARK_AS_ADVANCED(QT_XCURSOR_LIBRARY)
+ IF(QT_XCURSOR_LIBRARY)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_XCURSOR_LIBRARY})
+ ENDIF(QT_XCURSOR_LIBRARY)
+ENDIF(QT_QCONFIG MATCHES "xcursor")
+
+
+## Xinerama
+IF(QT_QCONFIG MATCHES "xinerama")
+ FIND_LIBRARY(QT_XINERAMA_LIBRARY NAMES Xinerama PATHS ${QMAKE_LIBDIR_X11})
+ MARK_AS_ADVANCED(QT_XINERAMA_LIBRARY)
+ IF(QT_XINERAMA_LIBRARY)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_XINERAMA_LIBRARY})
+ ENDIF(QT_XINERAMA_LIBRARY)
+ENDIF(QT_QCONFIG MATCHES "xinerama")
+
+
+## Xfixes
+IF(QT_QCONFIG MATCHES "xfixes")
+ FIND_LIBRARY(QT_XFIXES_LIBRARY NAMES Xfixes PATHS ${QMAKE_LIBDIR_X11})
+ MARK_AS_ADVANCED(QT_XFIXES_LIBRARY)
+ IF(QT_XFIXES_LIBRARY)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_XFIXES_LIBRARY})
+ ENDIF(QT_XFIXES_LIBRARY)
+ENDIF(QT_QCONFIG MATCHES "xfixes")
+
+
+## system-freetype
+IF(QT_QCONFIG MATCHES "system-freetype")
+ FIND_LIBRARY(QT_FREETYPE_LIBRARY NAMES freetype)
+ MARK_AS_ADVANCED(QT_FREETYPE_LIBRARY)
+ IF(QT_FREETYPE_LIBRARY)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_FREETYPE_LIBRARY})
+ ENDIF(QT_FREETYPE_LIBRARY)
+ENDIF(QT_QCONFIG MATCHES "system-freetype")
+
+
+## fontconfig
+IF(QT_QCONFIG MATCHES "fontconfig")
+ FIND_LIBRARY(QT_FONTCONFIG_LIBRARY NAMES fontconfig)
+ MARK_AS_ADVANCED(QT_FONTCONFIG_LIBRARY)
+ IF(QT_FONTCONFIG_LIBRARY)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${QT_FONTCONFIG_LIBRARY})
+ ENDIF(QT_FONTCONFIG_LIBRARY)
+ENDIF(QT_QCONFIG MATCHES "fontconfig")
+
+
+## system-zlib
+IF(QT_QCONFIG MATCHES "system-zlib")
+ FIND_LIBRARY(QT_ZLIB_LIBRARY NAMES z)
+ MARK_AS_ADVANCED(QT_ZLIB_LIBRARY)
+ IF(QT_ZLIB_LIBRARY)
+ SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_ZLIB_LIBRARY})
+ ENDIF(QT_ZLIB_LIBRARY)
+ENDIF(QT_QCONFIG MATCHES "system-zlib")
+
+
+## openssl
+IF(NOT Q_WS_WIN)
+ SET(_QT_NEED_OPENSSL 0)
+ IF(QT_VERSION_MINOR LESS 4 AND QT_QCONFIG MATCHES "openssl")
+ SET(_QT_NEED_OPENSSL 1)
+ ENDIF(QT_VERSION_MINOR LESS 4 AND QT_QCONFIG MATCHES "openssl")
+ IF(QT_VERSION_MINOR GREATER 3 AND QT_QCONFIG MATCHES "openssl-linked")
+ SET(_QT_NEED_OPENSSL 1)
+ ENDIF(QT_VERSION_MINOR GREATER 3 AND QT_QCONFIG MATCHES "openssl-linked")
+ IF(_QT_NEED_OPENSSL)
+ FIND_PACKAGE(OpenSSL)
+ IF(OPENSSL_LIBRARIES)
+ SET(QT_QTNETWORK_LIB_DEPENDENCIES ${QT_QTNETWORK_LIB_DEPENDENCIES} ${OPENSSL_LIBRARIES})
+ ENDIF(OPENSSL_LIBRARIES)
+ ENDIF(_QT_NEED_OPENSSL)
+ENDIF(NOT Q_WS_WIN)
+
+
+## dbus
+IF(QT_QCONFIG MATCHES "dbus")
+
+ # if the dbus library isn't found, we'll assume its not required to build
+ # shared Qt on Linux doesn't require it
+ IF(NOT QT_DBUS_LIBRARY)
+ EXECUTE_PROCESS(COMMAND pkg-config --libs-only-L dbus-1
+ OUTPUT_VARIABLE _dbus_query_output
+ RESULT_VARIABLE _dbus_result
+ ERROR_VARIABLE _dbus_query_output )
+
+ IF(_dbus_result MATCHES 0)
+ STRING(REPLACE "-L" "" _dbus_query_output "${_dbus_query_output}")
+ SEPARATE_ARGUMENTS(_dbus_query_output)
+ ELSE(_dbus_result MATCHES 0)
+ SET(_dbus_query_output)
+ ENDIF(_dbus_result MATCHES 0)
+
+ FIND_LIBRARY(QT_DBUS_LIBRARY NAMES dbus-1 PATHS ${_dbus_query_output} )
+
+ IF(QT_DBUS_LIBRARY)
+ SET(QT_QTDBUS_LIB_DEPENDENCIES ${QT_QTDBUS_LIB_DEPENDENCIES} ${QT_DBUS_LIBRARY})
+ ENDIF(QT_DBUS_LIBRARY)
+
+ MARK_AS_ADVANCED(QT_DBUS_LIBRARY)
+ ENDIF(NOT QT_DBUS_LIBRARY)
+
+ENDIF(QT_QCONFIG MATCHES "dbus")
+
+
+## glib
+IF(QT_QCONFIG MATCHES "glib")
+
+ # if the glib libraries aren't found, we'll assume its not required to build
+ # shared Qt on Linux doesn't require it
+
+ # Qt 4.2.0+ uses glib-2.0
+ IF(NOT QT_GLIB_LIBRARY OR NOT QT_GTHREAD_LIBRARY)
+ EXECUTE_PROCESS(COMMAND pkg-config --libs-only-L glib-2.0 gthread-2.0
+ OUTPUT_VARIABLE _glib_query_output
+ RESULT_VARIABLE _glib_result
+ ERROR_VARIABLE _glib_query_output )
+
+ IF(_glib_result MATCHES 0)
+ STRING(REPLACE "-L" "" _glib_query_output "${_glib_query_output}")
+ SEPARATE_ARGUMENTS(_glib_query_output)
+ ELSE(_glib_result MATCHES 0)
+ SET(_glib_query_output)
+ ENDIF(_glib_result MATCHES 0)
+
+ FIND_LIBRARY(QT_GLIB_LIBRARY NAMES glib-2.0 PATHS ${_glib_query_output} )
+ FIND_LIBRARY(QT_GTHREAD_LIBRARY NAMES gthread-2.0 PATHS ${_glib_query_output} )
+
+ MARK_AS_ADVANCED(QT_GLIB_LIBRARY)
+ MARK_AS_ADVANCED(QT_GTHREAD_LIBRARY)
+ ENDIF(NOT QT_GLIB_LIBRARY OR NOT QT_GTHREAD_LIBRARY)
+
+ IF(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY)
+ SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES}
+ ${QT_GTHREAD_LIBRARY} ${QT_GLIB_LIBRARY})
+ ENDIF(QT_GLIB_LIBRARY AND QT_GTHREAD_LIBRARY)
+
+
+ # Qt 4.5+ also links to gobject-2.0
+ IF(QT_VERSION_MINOR GREATER 4)
+ IF(NOT QT_GOBJECT_LIBRARY)
+ EXECUTE_PROCESS(COMMAND pkg-config --libs-only-L gobject-2.0
+ OUTPUT_VARIABLE _glib_query_output
+ RESULT_VARIABLE _glib_result
+ ERROR_VARIABLE _glib_query_output )
+
+ IF(_glib_result MATCHES 0)
+ STRING(REPLACE "-L" "" _glib_query_output "${_glib_query_output}")
+ SEPARATE_ARGUMENTS(_glib_query_output)
+ ELSE(_glib_result MATCHES 0)
+ SET(_glib_query_output)
+ ENDIF(_glib_result MATCHES 0)
+
+ FIND_LIBRARY(QT_GOBJECT_LIBRARY NAMES gobject-2.0 PATHS ${_glib_query_output} )
+
+ MARK_AS_ADVANCED(QT_GOBJECT_LIBRARY)
+ ENDIF(NOT QT_GOBJECT_LIBRARY)
+
+ IF(QT_GOBJECT_LIBRARY)
+ SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES}
+ ${QT_GOBJECT_LIBRARY})
+ ENDIF(QT_GOBJECT_LIBRARY)
+ ENDIF(QT_VERSION_MINOR GREATER 4)
+
+ENDIF(QT_QCONFIG MATCHES "glib")
+
+
+## clock-monotonic, just see if we need to link with rt
+IF(QT_QCONFIG MATCHES "clock-monotonic")
+ SET(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
+ SET(CMAKE_REQUIRED_LIBRARIES rt)
+ CHECK_SYMBOL_EXISTS(_POSIX_TIMERS "unistd.h;time.h" QT_POSIX_TIMERS)
+ SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
+ IF(QT_POSIX_TIMERS)
+ FIND_LIBRARY(QT_RT_LIBRARY NAMES rt)
+ MARK_AS_ADVANCED(QT_RT_LIBRARY)
+ IF(QT_RT_LIBRARY)
+ SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_RT_LIBRARY})
+ ENDIF(QT_RT_LIBRARY)
+ ENDIF(QT_POSIX_TIMERS)
+ENDIF(QT_QCONFIG MATCHES "clock-monotonic")
+
+
+IF(Q_WS_X11)
+ # X11 libraries Qt absolutely depends on
+ QT_QUERY_QMAKE(QT_LIBS_X11 "QMAKE_LIBS_X11")
+ SEPARATE_ARGUMENTS(QT_LIBS_X11)
+ FOREACH(QT_X11_LIB ${QT_LIBS_X11})
+ STRING(REGEX REPLACE "-l" "" QT_X11_LIB "${QT_X11_LIB}")
+ SET(QT_TMP_STR "QT_X11_${QT_X11_LIB}_LIBRARY")
+ FIND_LIBRARY(${QT_TMP_STR} NAMES "${QT_X11_LIB}" PATHS ${QMAKE_LIBDIR_X11})
+ MARK_AS_ADVANCED(${QT_TMP_STR})
+ IF(${QT_TMP_STR})
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${${QT_TMP_STR}})
+ ENDIF(${QT_TMP_STR})
+ ENDFOREACH(QT_X11_LIB)
+
+ QT_QUERY_QMAKE(QT_LIBS_THREAD "QMAKE_LIBS_THREAD")
+ SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QT_LIBS_THREAD})
+
+ QT_QUERY_QMAKE(QMAKE_LIBS_DYNLOAD "QMAKE_LIBS_DYNLOAD")
+ SET (QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${QMAKE_LIBS_DYNLOAD})
+
+ENDIF(Q_WS_X11)
+
+
+IF(Q_WS_WIN)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} imm32 winmm)
+ SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ws2_32)
+ENDIF(Q_WS_WIN)
+
+
+IF(Q_WS_MAC)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework Carbon")
+
+ # Qt 4.0, 4.1, 4.2 use QuickTime
+ IF(QT_VERSION_MINOR LESS 3)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework QuickTime")
+ ENDIF(QT_VERSION_MINOR LESS 3)
+
+ # Qt 4.2+ use AppKit
+ IF(QT_VERSION_MINOR GREATER 1)
+ SET(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} "-framework AppKit")
+ ENDIF(QT_VERSION_MINOR GREATER 1)
+
+ SET(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} "-framework ApplicationServices")
+ENDIF(Q_WS_MAC)
+
diff --git a/kdecore/cmake/modules/Qt4Macros.cmake b/kdecore/cmake/modules/Qt4Macros.cmake
new file mode 100644
index 0000000..1422c59
--- /dev/null
+++ b/kdecore/cmake/modules/Qt4Macros.cmake
@@ -0,0 +1,414 @@
+# This file is included by FindQt4.cmake, don't include it directly.
+
+#=============================================================================
+# Copyright 2005-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distributed this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+
+######################################
+#
+# Macros for building Qt files
+#
+######################################
+
+
+MACRO (QT4_EXTRACT_OPTIONS _qt4_files _qt4_options)
+ SET(${_qt4_files})
+ SET(${_qt4_options})
+ SET(_QT4_DOING_OPTIONS FALSE)
+ FOREACH(_currentArg ${ARGN})
+ IF ("${_currentArg}" STREQUAL "OPTIONS")
+ SET(_QT4_DOING_OPTIONS TRUE)
+ ELSE ("${_currentArg}" STREQUAL "OPTIONS")
+ IF(_QT4_DOING_OPTIONS)
+ LIST(APPEND ${_qt4_options} "${_currentArg}")
+ ELSE(_QT4_DOING_OPTIONS)
+ LIST(APPEND ${_qt4_files} "${_currentArg}")
+ ENDIF(_QT4_DOING_OPTIONS)
+ ENDIF ("${_currentArg}" STREQUAL "OPTIONS")
+ ENDFOREACH(_currentArg)
+ENDMACRO (QT4_EXTRACT_OPTIONS)
+
+
+# macro used to create the names of output files preserving relative dirs
+MACRO (QT4_MAKE_OUTPUT_FILE infile prefix ext outfile )
+ STRING(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength)
+ STRING(LENGTH ${infile} _infileLength)
+ SET(_checkinfile ${CMAKE_CURRENT_SOURCE_DIR})
+ IF(_infileLength GREATER _binlength)
+ STRING(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile)
+ IF(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
+ FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile})
+ ELSE(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
+ FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
+ ENDIF(_checkinfile STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
+ ELSE(_infileLength GREATER _binlength)
+ FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
+ ENDIF(_infileLength GREATER _binlength)
+ IF(WIN32 AND rel MATCHES "^[a-zA-Z]:") # absolute path
+ STRING(REGEX REPLACE "^([a-zA-Z]):(.*)$" "\\1_\\2" rel "${rel}")
+ ENDIF(WIN32 AND rel MATCHES "^[a-zA-Z]:")
+ SET(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
+ STRING(REPLACE ".." "__" _outfile ${_outfile})
+ GET_FILENAME_COMPONENT(outpath ${_outfile} PATH)
+ GET_FILENAME_COMPONENT(_outfile ${_outfile} NAME_WE)
+ FILE(MAKE_DIRECTORY ${outpath})
+ SET(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
+ENDMACRO (QT4_MAKE_OUTPUT_FILE )
+
+
+MACRO (QT4_GET_MOC_FLAGS _moc_flags)
+ SET(${_moc_flags})
+ GET_DIRECTORY_PROPERTY(_inc_DIRS INCLUDE_DIRECTORIES)
+
+ FOREACH(_current ${_inc_DIRS})
+ IF("${_current}" MATCHES ".framework/?$")
+ STRING(REGEX REPLACE "/[^/]+.framework" "" framework_path "${_current}")
+ SET(${_moc_flags} ${${_moc_flags}} "-F${framework_path}")
+ ELSE("${_current}" MATCHES ".framework/?$")
+ SET(${_moc_flags} ${${_moc_flags}} "-I${_current}")
+ ENDIF("${_current}" MATCHES ".framework/?$")
+ ENDFOREACH(_current ${_inc_DIRS})
+
+ GET_DIRECTORY_PROPERTY(_defines COMPILE_DEFINITIONS)
+ FOREACH(_current ${_defines})
+ SET(${_moc_flags} ${${_moc_flags}} "-D${_current}")
+ ENDFOREACH(_current ${_defines})
+
+ IF(Q_WS_WIN)
+ SET(${_moc_flags} ${${_moc_flags}} -DWIN32)
+ ENDIF(Q_WS_WIN)
+
+ENDMACRO(QT4_GET_MOC_FLAGS)
+
+
+# helper macro to set up a moc rule
+MACRO (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options)
+ # For Windows, create a parameters file to work around command line length limit
+ IF (WIN32)
+ # Pass the parameters in a file. Set the working directory to
+ # be that containing the parameters file and reference it by
+ # just the file name. This is necessary because the moc tool on
+ # MinGW builds does not seem to handle spaces in the path to the
+ # file given with the @ syntax.
+ GET_FILENAME_COMPONENT(_moc_outfile_name "${outfile}" NAME)
+ GET_FILENAME_COMPONENT(_moc_outfile_dir "${outfile}" PATH)
+ IF(_moc_outfile_dir)
+ SET(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir})
+ ENDIF(_moc_outfile_dir)
+ SET (_moc_parameters_file ${outfile}_parameters)
+ SET (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}")
+ FILE (REMOVE ${_moc_parameters_file})
+ FOREACH(arg ${_moc_parameters})
+ FILE (APPEND ${_moc_parameters_file} "${arg}\n")
+ ENDFOREACH(arg)
+ ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+ COMMAND ${QT_MOC_EXECUTABLE} @${_moc_outfile_name}_parameters
+ DEPENDS ${infile}
+ ${_moc_working_dir}
+ VERBATIM)
+ ELSE (WIN32)
+ ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+ COMMAND ${QT_MOC_EXECUTABLE}
+ ARGS ${moc_flags} ${moc_options} -o ${outfile} ${infile}
+ DEPENDS ${infile})
+ ENDIF (WIN32)
+ENDMACRO (QT4_CREATE_MOC_COMMAND)
+
+
+MACRO (QT4_GENERATE_MOC infile outfile )
+# get include dirs and flags
+ QT4_GET_MOC_FLAGS(moc_flags)
+ GET_FILENAME_COMPONENT(abs_infile ${infile} ABSOLUTE)
+ QT4_CREATE_MOC_COMMAND(${abs_infile} ${outfile} "${moc_flags}" "")
+ SET_SOURCE_FILES_PROPERTIES(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # dont run automoc on this file
+
+ MACRO_ADD_FILE_DEPENDENCIES(${abs_infile} ${outfile})
+ENDMACRO (QT4_GENERATE_MOC)
+
+
+# QT4_WRAP_CPP(outfiles inputfile ... )
+
+MACRO (QT4_WRAP_CPP outfiles )
+ # get include dirs
+ QT4_GET_MOC_FLAGS(moc_flags)
+ QT4_EXTRACT_OPTIONS(moc_files moc_options ${ARGN})
+
+ FOREACH (it ${moc_files})
+ GET_FILENAME_COMPONENT(it ${it} ABSOLUTE)
+ QT4_MAKE_OUTPUT_FILE(${it} moc_ cxx outfile)
+ QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_flags}" "${moc_options}")
+ SET(${outfiles} ${${outfiles}} ${outfile})
+ ENDFOREACH(it)
+
+ENDMACRO (QT4_WRAP_CPP)
+
+
+# QT4_WRAP_UI(outfiles inputfile ... )
+
+MACRO (QT4_WRAP_UI outfiles )
+ QT4_EXTRACT_OPTIONS(ui_files ui_options ${ARGN})
+
+ FOREACH (it ${ui_files})
+ GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
+ GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
+ SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
+ ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+ COMMAND ${QT_UIC_EXECUTABLE}
+ ARGS ${ui_options} -o ${outfile} ${infile}
+ MAIN_DEPENDENCY ${infile})
+ SET(${outfiles} ${${outfiles}} ${outfile})
+ ENDFOREACH (it)
+
+ENDMACRO (QT4_WRAP_UI)
+
+
+# QT4_ADD_RESOURCES(outfiles inputfile ... )
+
+MACRO (QT4_ADD_RESOURCES outfiles )
+ QT4_EXTRACT_OPTIONS(rcc_files rcc_options ${ARGN})
+
+ FOREACH (it ${rcc_files})
+ GET_FILENAME_COMPONENT(outfilename ${it} NAME_WE)
+ GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
+ GET_FILENAME_COMPONENT(rc_path ${infile} PATH)
+ SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx)
+ # parse file for dependencies
+ # all files are absolute paths or relative to the location of the qrc file
+ FILE(READ "${infile}" _RC_FILE_CONTENTS)
+ STRING(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
+ SET(_RC_DEPENDS)
+ FOREACH(_RC_FILE ${_RC_FILES})
+ STRING(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
+ STRING(REGEX MATCH "^/|([A-Za-z]:/)" _ABS_PATH_INDICATOR "${_RC_FILE}")
+ IF(NOT _ABS_PATH_INDICATOR)
+ SET(_RC_FILE "${rc_path}/${_RC_FILE}")
+ ENDIF(NOT _ABS_PATH_INDICATOR)
+ SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
+ ENDFOREACH(_RC_FILE)
+ ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+ COMMAND ${QT_RCC_EXECUTABLE}
+ ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile}
+ MAIN_DEPENDENCY ${infile}
+ DEPENDS ${_RC_DEPENDS})
+ SET(${outfiles} ${${outfiles}} ${outfile})
+ ENDFOREACH (it)
+
+ENDMACRO (QT4_ADD_RESOURCES)
+
+
+MACRO(QT4_ADD_DBUS_INTERFACE _sources _interface _basename)
+ GET_FILENAME_COMPONENT(_infile ${_interface} ABSOLUTE)
+ SET(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
+ SET(_impl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
+ SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc)
+
+ GET_SOURCE_FILE_PROPERTY(_nonamespace ${_interface} NO_NAMESPACE)
+ IF ( _nonamespace )
+ SET(_params -N -m)
+ ELSE ( _nonamespace )
+ SET(_params -m)
+ ENDIF ( _nonamespace )
+
+ GET_SOURCE_FILE_PROPERTY(_classname ${_interface} CLASSNAME)
+ IF ( _classname )
+ SET(_params ${_params} -c ${_classname})
+ ENDIF ( _classname )
+
+ GET_SOURCE_FILE_PROPERTY(_include ${_interface} INCLUDE)
+ IF ( _include )
+ SET(_params ${_params} -i ${_include})
+ ENDIF ( _include )
+
+ ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header}
+ COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} ${_params} -p ${_basename} ${_infile}
+ DEPENDS ${_infile})
+
+ SET_SOURCE_FILES_PROPERTIES(${_impl} PROPERTIES SKIP_AUTOMOC TRUE)
+
+ QT4_GENERATE_MOC(${_header} ${_moc})
+
+ SET(${_sources} ${${_sources}} ${_impl} ${_header} ${_moc})
+ MACRO_ADD_FILE_DEPENDENCIES(${_impl} ${_moc})
+
+ENDMACRO(QT4_ADD_DBUS_INTERFACE)
+
+
+MACRO(QT4_ADD_DBUS_INTERFACES _sources)
+ FOREACH (_current_FILE ${ARGN})
+ GET_FILENAME_COMPONENT(_infile ${_current_FILE} ABSOLUTE)
+ # get the part before the ".xml" suffix
+ STRING(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2" _basename ${_current_FILE})
+ STRING(TOLOWER ${_basename} _basename)
+ QT4_ADD_DBUS_INTERFACE(${_sources} ${_infile} ${_basename}interface)
+ ENDFOREACH (_current_FILE)
+ENDMACRO(QT4_ADD_DBUS_INTERFACES)
+
+
+MACRO(QT4_GENERATE_DBUS_INTERFACE _header) # _customName OPTIONS -some -options )
+ QT4_EXTRACT_OPTIONS(_customName _qt4_dbus_options ${ARGN})
+
+ GET_FILENAME_COMPONENT(_in_file ${_header} ABSOLUTE)
+ GET_FILENAME_COMPONENT(_basename ${_header} NAME_WE)
+
+ IF (_customName)
+ SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_customName})
+ ELSE (_customName)
+ SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.xml)
+ ENDIF (_customName)
+
+ ADD_CUSTOM_COMMAND(OUTPUT ${_target}
+ COMMAND ${QT_DBUSCPP2XML_EXECUTABLE} ${_qt4_dbus_options} ${_in_file} -o ${_target}
+ DEPENDS ${_in_file}
+ )
+ENDMACRO(QT4_GENERATE_DBUS_INTERFACE)
+
+
+MACRO(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optionalBasename _optionalClassName)
+ GET_FILENAME_COMPONENT(_infile ${_xml_file} ABSOLUTE)
+
+ SET(_optionalBasename "${ARGV4}")
+ IF (_optionalBasename)
+ SET(_basename ${_optionalBasename} )
+ ELSE (_optionalBasename)
+ STRING(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2adaptor" _basename ${_infile})
+ STRING(TOLOWER ${_basename} _basename)
+ ENDIF (_optionalBasename)
+
+ SET(_optionalClassName "${ARGV5}")
+ SET(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
+ SET(_impl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
+ SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc)
+
+ IF(_optionalClassName)
+ ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header}
+ COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -c ${_optionalClassName} -i ${_include} -l ${_parentClass} ${_infile}
+ DEPENDS ${_infile}
+ )
+ ELSE(_optionalClassName)
+ ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header}
+ COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -i ${_include} -l ${_parentClass} ${_infile}
+ DEPENDS ${_infile}
+ )
+ ENDIF(_optionalClassName)
+
+ QT4_GENERATE_MOC(${_header} ${_moc})
+ SET_SOURCE_FILES_PROPERTIES(${_impl} PROPERTIES SKIP_AUTOMOC TRUE)
+ MACRO_ADD_FILE_DEPENDENCIES(${_impl} ${_moc})
+
+ SET(${_sources} ${${_sources}} ${_impl} ${_header} ${_moc})
+ENDMACRO(QT4_ADD_DBUS_ADAPTOR)
+
+
+MACRO(QT4_AUTOMOC)
+ QT4_GET_MOC_FLAGS(_moc_INCS)
+
+ SET(_matching_FILES )
+ FOREACH (_current_FILE ${ARGN})
+
+ GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
+ # if "SKIP_AUTOMOC" is set to true, we will not handle this file here.
+ # This is required to make uic work correctly:
+ # we need to add generated .cpp files to the sources (to compile them),
+ # but we cannot let automoc handle them, as the .cpp files don't exist yet when
+ # cmake is run for the very first time on them -> however the .cpp files might
+ # exist at a later run. at that time we need to skip them, so that we don't add two
+ # different rules for the same moc file
+ GET_SOURCE_FILE_PROPERTY(_skip ${_abs_FILE} SKIP_AUTOMOC)
+
+ IF ( NOT _skip AND EXISTS ${_abs_FILE} )
+
+ FILE(READ ${_abs_FILE} _contents)
+
+ GET_FILENAME_COMPONENT(_abs_PATH ${_abs_FILE} PATH)
+
+ STRING(REGEX MATCHALL "# *include +[^ ]+\\.moc[\">]" _match "${_contents}")
+ IF(_match)
+ FOREACH (_current_MOC_INC ${_match})
+ STRING(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
+
+ GET_FILENAME_COMPONENT(_basename ${_current_MOC} NAME_WE)
+ IF(EXISTS ${_abs_PATH}/${_basename}.hpp)
+ SET(_header ${_abs_PATH}/${_basename}.hpp)
+ ELSE(EXISTS ${_abs_PATH}/${_basename}.hpp)
+ SET(_header ${_abs_PATH}/${_basename}.h)
+ ENDIF(EXISTS ${_abs_PATH}/${_basename}.hpp)
+ SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
+ QT4_CREATE_MOC_COMMAND(${_header} ${_moc} "${_moc_INCS}" "")
+ MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
+ ENDFOREACH (_current_MOC_INC)
+ ENDIF(_match)
+ ENDIF ( NOT _skip AND EXISTS ${_abs_FILE} )
+ ENDFOREACH (_current_FILE)
+ENDMACRO(QT4_AUTOMOC)
+
+
+MACRO(QT4_CREATE_TRANSLATION _qm_files)
+ QT4_EXTRACT_OPTIONS(_lupdate_files _lupdate_options ${ARGN})
+ SET(_my_sources)
+ SET(_my_dirs)
+ SET(_my_tsfiles)
+ SET(_ts_pro)
+ FOREACH (_file ${_lupdate_files})
+ GET_FILENAME_COMPONENT(_ext ${_file} EXT)
+ GET_FILENAME_COMPONENT(_abs_FILE ${_file} ABSOLUTE)
+ IF(_ext MATCHES "ts")
+ LIST(APPEND _my_tsfiles ${_abs_FILE})
+ ELSE(_ext MATCHES "ts")
+ IF(NOT _ext)
+ LIST(APPEND _my_dirs ${_abs_FILE})
+ ELSE(NOT _ext)
+ LIST(APPEND _my_sources ${_abs_FILE})
+ ENDIF(NOT _ext)
+ ENDIF(_ext MATCHES "ts")
+ ENDFOREACH(_file)
+ FOREACH(_ts_file ${_my_tsfiles})
+ IF(_my_sources)
+ # make a .pro file to call lupdate on, so we don't make our commands too
+ # long for some systems
+ GET_FILENAME_COMPONENT(_ts_name ${_ts_file} NAME_WE)
+ SET(_ts_pro ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_ts_name}_lupdate.pro)
+ SET(_pro_srcs)
+ FOREACH(_pro_src ${_my_sources})
+ SET(_pro_srcs "${_pro_srcs} \"${_pro_src}\"")
+ ENDFOREACH(_pro_src ${_my_sources})
+ FILE(WRITE ${_ts_pro} "SOURCES = ${_pro_srcs}")
+ ENDIF(_my_sources)
+ ADD_CUSTOM_COMMAND(OUTPUT ${_ts_file}
+ COMMAND ${QT_LUPDATE_EXECUTABLE}
+ ARGS ${_lupdate_options} ${_ts_pro} ${_my_dirs} -ts ${_ts_file}
+ DEPENDS ${_my_sources} ${_ts_pro})
+ ENDFOREACH(_ts_file)
+ QT4_ADD_TRANSLATION(${_qm_files} ${_my_tsfiles})
+ENDMACRO(QT4_CREATE_TRANSLATION)
+
+
+MACRO(QT4_ADD_TRANSLATION _qm_files)
+ FOREACH (_current_FILE ${ARGN})
+ GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
+ GET_FILENAME_COMPONENT(qm ${_abs_FILE} NAME_WE)
+ GET_SOURCE_FILE_PROPERTY(output_location ${_abs_FILE} OUTPUT_LOCATION)
+ IF(output_location)
+ FILE(MAKE_DIRECTORY "${output_location}")
+ SET(qm "${output_location}/${qm}.qm")
+ ELSE(output_location)
+ SET(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
+ ENDIF(output_location)
+
+ ADD_CUSTOM_COMMAND(OUTPUT ${qm}
+ COMMAND ${QT_LRELEASE_EXECUTABLE}
+ ARGS ${_abs_FILE} -qm ${qm}
+ DEPENDS ${_abs_FILE}
+ )
+ SET(${_qm_files} ${${_qm_files}} ${qm})
+ ENDFOREACH (_current_FILE)
+ENDMACRO(QT4_ADD_TRANSLATION)
diff --git a/kdecore/cmake/modules/README b/kdecore/cmake/modules/README
new file mode 100644
index 0000000..d487a0b
--- /dev/null
+++ b/kdecore/cmake/modules/README
@@ -0,0 +1,19 @@
+these are additional cmake modules required for compiling KDE3 or KDE4
+applications with cmake. Some of them are enhanced versions of the files
+coming with cmake, some of them are NOT yet part of cmake.
+To use them, copy them into the cmake Module directory or
+run "cmake ." followed by "make install"
+
+Changes to any files should follow the
+
+cmake commit policy
+
+ at http://techbase.kde.org/Policies/CMake_Commit_Policy
+
+and the cmake coding style
+
+ at http://techbase.kde.org/Policies/CMake_Coding_Style
+
+
+Alex <neundorf@kde.org>
+
diff --git a/kdecore/cmake/modules/SIPMacros.cmake b/kdecore/cmake/modules/SIPMacros.cmake
new file mode 100644
index 0000000..28c1cf4
--- /dev/null
+++ b/