summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2012-04-21 12:48:58 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2012-04-21 12:48:58 (GMT)
commitc2880670c83a33bd25831810a61970247429a2ac (patch)
tree1ecf8dc857a50676f60403d5004b0379be413b19 /cmake
parentc3cdfb654602c6da172171338ac794bd219706ce (diff)
downloadlibkolab-c2880670c83a33bd25831810a61970247429a2ac.tar.gz
Buildsystem overhaul to use cmake config files.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/modules/CMakeLists.txt1
-rw-r--r--cmake/modules/FindKolabLibraries.cmake44
-rw-r--r--cmake/modules/LibkolabConfig.cmake.in18
-rw-r--r--cmake/modules/LibkolabConfigVersion.cmake.in14
4 files changed, 54 insertions, 23 deletions
diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
deleted file mode 100644
index a5a6018..0000000
--- a/cmake/modules/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-install(FILES FindKolabKDELibraries.cmake FindKolabLibraries.cmake DESTINATION ${KOLAB_CMAKE_MODULE_INSTALL_DIR} )
diff --git a/cmake/modules/FindKolabLibraries.cmake b/cmake/modules/FindKolabLibraries.cmake
index 1852b24..7604722 100644
--- a/cmake/modules/FindKolabLibraries.cmake
+++ b/cmake/modules/FindKolabLibraries.cmake
@@ -1,22 +1,22 @@
-# Kolab_FOUND
-# Kolab_LIBRARIES
-# Kolab_INCLUDE_DIRS
-#
-include(FindKolabInternal)
-
-find_library(KOLABXML_LIBRARY NAMES kolabxml)
-find_library(KOLAB_LIBRARY NAMES kolab)
-
-find_path(KOLAB_INCLUDE_DIR_private kolab/kolab_export.h)
-
-set(KOLAB_INCLUDE_DIR "${KOLAB_INCLUDE_DIR_private}/kolab")
-set(Kolab_INCLUDE_DIRS ${KOLAB_INCLUDE_DIR})
-set(Kolab_LIBRARIES ${KOLAB_LIBRARY} ${KOLABXML_LIBRARY})
-
-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(Kolab DEFAULT_MSG
- KOLAB_LIBRARY KOLABXML_LIBRARY KOLAB_INCLUDE_DIR)
-
-mark_as_advanced(KOLAB_INCLUDE_DIR KOLAB_LIBRARY KOLABXML_LIBRARY)
+# # Kolab_FOUND
+# # Kolab_LIBRARIES
+# # Kolab_INCLUDE_DIRS
+# #
+# include(FindKolabInternal)
+#
+# find_library(KOLABXML_LIBRARY NAMES kolabxml)
+# find_library(KOLAB_LIBRARY NAMES kolab)
+#
+# find_path(KOLAB_INCLUDE_DIR_private kolab/kolab_export.h)
+#
+# set(KOLAB_INCLUDE_DIR "${KOLAB_INCLUDE_DIR_private}/kolab")
+# set(Kolab_INCLUDE_DIRS ${KOLAB_INCLUDE_DIR})
+# set(Kolab_LIBRARIES ${KOLAB_LIBRARY} ${KOLABXML_LIBRARY})
+#
+# 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(Kolab DEFAULT_MSG
+# KOLAB_LIBRARY KOLABXML_LIBRARY KOLAB_INCLUDE_DIR)
+#
+# mark_as_advanced(KOLAB_INCLUDE_DIR KOLAB_LIBRARY KOLABXML_LIBRARY)
diff --git a/cmake/modules/LibkolabConfig.cmake.in b/cmake/modules/LibkolabConfig.cmake.in
new file mode 100644
index 0000000..cf0555b
--- /dev/null
+++ b/cmake/modules/LibkolabConfig.cmake.in
@@ -0,0 +1,18 @@
+get_filename_component(myDir ${CMAKE_CURRENT_LIST_FILE} PATH) # get the directory where I myself am
+get_filename_component(rootDir ${myDir}/@relInstallDir@ ABSOLUTE) # get the chosen install prefix
+
+# set the version of myself
+set(Libkolab_VERSION_MAJOR @Libkolab_VERSION_MAJOR@)
+set(Libkolab_VERSION_MINOR @Libkolab_VERSION_MINOR@)
+set(Libkolab_VERSION_PATCH @Libkolab_VERSION_PATCH@)
+set(Libkolab_VERSION ${Libkolab_VERSION_MAJOR}.${Libkolab_VERSION_MINOR}.${Libkolab_VERSION_PATCH} )
+
+# what is my include directory
+set(Libkolab_INSTALL_PREFIX "${rootDir}")
+set(Libkolab_INCLUDES "${rootDir}/@INCLUDE_INSTALL_DIR@")
+
+# import the exported targets
+include(${myDir}/LibkolabTargets.cmake)
+
+# set the expected library variable
+set(Libkolab_LIBRARIES kolab )
diff --git a/cmake/modules/LibkolabConfigVersion.cmake.in b/cmake/modules/LibkolabConfigVersion.cmake.in
new file mode 100644
index 0000000..fbd4d77
--- /dev/null
+++ b/cmake/modules/LibkolabConfigVersion.cmake.in
@@ -0,0 +1,14 @@
+# 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.
+
+set(PACKAGE_VERSION @Libkolab_VERSION_MAJOR@.@Libkolab_VERSION_MINOR@.@Libkolab_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}" )