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)
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 @@
1# - Try to find elementary
2# Once done this will define
3# ELEMENTARY_FOUND - System has elementary
4# ELEMENTARY_INCLUDE_DIRS - The elementary include directories
5# ELEMENTARY_LIBRARIES - The libraries needed to use elementary
6# ELEMENTARY_DEFINITIONS - Compiler switches required for using elementary
7
8set(MY_PKG elementary)
9
10find_package(PkgConfig)
11if ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER "2.8.1")
12 # "QUIET" was introduced in 2.8.2
13 set(_QUIET QUIET)
14endif ()
15pkg_check_modules(PC_LIBELEMENTARY ${_QUIET} ${MY_PKG})
16
17find_library(ELEMENTARY_LIBRARY
18 NAMES ${PC_LIBELEMENTARY_LIBRARIES}
19 HINTS ${PC_LIBELEMENTARY_LIBDIR} ${PC_LIBELEMENTARY_LIBRARY_DIRS} )
20
21set(ELEMENTARY_DEFINITIONS ${PC_LIBELEMENTARY_CFLAGS_OTHER})
22set(ELEMENTARY_LIBRARIES ${ELEMENTARY_LIBRARY})
23set(ELEMENTARY_INCLUDE_DIRS ${PC_LIBELEMENTARY_INCLUDE_DIRS})
24
25include(FindPackageHandleStandardArgs)
26# handle the QUIETLY and REQUIRED arguments and set ELEMENTARY_FOUND to TRUE
27# if all listed variables are TRUE
28find_package_handle_standard_args(${MY_PKG} DEFAULT_MSG
29 ELEMENTARY_LIBRARIES ELEMENTARY_INCLUDE_DIRS)
30
31mark_as_advanced(ELEMENTARY_INCLUDE_DIRS ELEMENTARY_LIBRARY ELEMENTARY_LIBRARIES ELEMENTARY_DEFINITIONS)
32
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 @@
1set(PACKAGE_VERSION "@VERSION@")
2
3# Check whether the requested PACKAGE_FIND_VERSION is compatible
4if ("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
5 set(PACKAGE_VERSION_COMPATIBLE FALSE)
6else ()
7 set(PACKAGE_VERSION_COMPATIBLE TRUE)
8 if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
9 set(PACKAGE_VERSION_EXACT TRUE)
10 endif ()
11endif ()