summaryrefslogtreecommitdiff
path: root/cmakeconfig
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2013-02-05 16:40:12 +0000
committerTom Hacohen <tom@stosb.com>2013-02-05 16:40:12 +0000
commit0dd36a0d78c53aa565d653d7ee5c2fe86f7a56a5 (patch)
treedf7edca0d0b0dadfe8563bd9529e53fe5cefd3a9 /cmakeconfig
parent893bcc598618cf622c6855726367de42d42f2409 (diff)
Elementary: Ship cmake configs (like pkg-config).
This should make it easier for applications to use efl with cmake. It seems to work with my tests. It's ugly and redundant but it's the first step. Not all the components are supported at the moment. SVN revision: 83639
Diffstat (limited to 'cmakeconfig')
-rw-r--r--cmakeconfig/ElementaryConfig.cmake.in32
1 files changed, 32 insertions, 0 deletions
diff --git a/cmakeconfig/ElementaryConfig.cmake.in b/cmakeconfig/ElementaryConfig.cmake.in
new file mode 100644
index 000000000..e41759dcb
--- /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