summaryrefslogtreecommitdiff
path: root/cmakeconfig
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-03-23 12:56:14 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-03-23 13:24:41 -0700
commitc2a1c49ab2042f559b28e840e54feb8494888e0e (patch)
treec6eb110b7c479499854eede9d0c3ab0a80c9a11a /cmakeconfig
parent9340855597e7e465435c69b6278650346688da14 (diff)
downloadefl-c2a1c49ab2042f559b28e840e54feb8494888e0e.tar.gz
elementary: move all legacy files to their expected new location.
Diffstat (limited to 'cmakeconfig')
-rw-r--r--cmakeconfig/ElementaryConfig.cmake.in32
-rw-r--r--cmakeconfig/ElementaryConfigVersion.cmake.in11
2 files changed, 43 insertions, 0 deletions
diff --git a/cmakeconfig/ElementaryConfig.cmake.in b/cmakeconfig/ElementaryConfig.cmake.in
new file mode 100644
index 0000000000..e41759dcb3
--- /dev/null
+++ b/cmakeconfig/ElementaryConfig.cmake.in
@@ -0,0 +1,32 @@
+# - Try to find elementary
+# Once done this will define
+# ELEMENTARY_FOUND - System has elementary
+# ELEMENTARY_INCLUDE_DIRS - The elementary include directories
+# ELEMENTARY_LIBRARIES - The libraries needed to use elementary
+# ELEMENTARY_DEFINITIONS - Compiler switches required for using elementary
+
+set(MY_PKG elementary)
+
+find_package(PkgConfig)
+if ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER "2.8.1")
+ # "QUIET" was introduced in 2.8.2
+ set(_QUIET QUIET)
+endif ()
+pkg_check_modules(PC_LIBELEMENTARY ${_QUIET} ${MY_PKG})
+
+find_library(ELEMENTARY_LIBRARY
+ NAMES ${PC_LIBELEMENTARY_LIBRARIES}
+ HINTS ${PC_LIBELEMENTARY_LIBDIR} ${PC_LIBELEMENTARY_LIBRARY_DIRS} )
+
+set(ELEMENTARY_DEFINITIONS ${PC_LIBELEMENTARY_CFLAGS_OTHER})
+set(ELEMENTARY_LIBRARIES ${ELEMENTARY_LIBRARY})
+set(ELEMENTARY_INCLUDE_DIRS ${PC_LIBELEMENTARY_INCLUDE_DIRS})
+
+include(FindPackageHandleStandardArgs)
+# handle the QUIETLY and REQUIRED arguments and set ELEMENTARY_FOUND to TRUE
+# if all listed variables are TRUE
+find_package_handle_standard_args(${MY_PKG} DEFAULT_MSG
+ ELEMENTARY_LIBRARIES ELEMENTARY_INCLUDE_DIRS)
+
+mark_as_advanced(ELEMENTARY_INCLUDE_DIRS ELEMENTARY_LIBRARY ELEMENTARY_LIBRARIES ELEMENTARY_DEFINITIONS)
+
diff --git a/cmakeconfig/ElementaryConfigVersion.cmake.in b/cmakeconfig/ElementaryConfigVersion.cmake.in
new file mode 100644
index 0000000000..f99fba11a4
--- /dev/null
+++ b/cmakeconfig/ElementaryConfigVersion.cmake.in
@@ -0,0 +1,11 @@
+set(PACKAGE_VERSION "@VERSION@")
+
+# Check whether the requested PACKAGE_FIND_VERSION is compatible
+if ("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
+else ()
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
+ if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
+ set(PACKAGE_VERSION_EXACT TRUE)
+ endif ()
+endif ()