summaryrefslogtreecommitdiff
path: root/cmakeconfig
diff options
context:
space:
mode:
authorRyuan Choi <ryuan.choi@gmail.com>2013-04-17 17:38:59 +0100
committerTom Hacohen <tom@stosb.com>2013-04-17 17:40:51 +0100
commit08aa4222e678f0ce035dad6c5ecdb0a912e756de (patch)
treea7f20c04870d30c854a867ad1ad5d7eabc2d7389 /cmakeconfig
parent6ccae99bd1efb013c3401857405e0b65fe9102f1 (diff)
cmake : EcoreConfig.cmake should be able to find ecore sub modules.
Diffstat (limited to 'cmakeconfig')
-rw-r--r--cmakeconfig/EcoreConfig.cmake.in45
1 files changed, 31 insertions, 14 deletions
diff --git a/cmakeconfig/EcoreConfig.cmake.in b/cmakeconfig/EcoreConfig.cmake.in
index 3f3cbd38a6..26822d3e30 100644
--- a/cmakeconfig/EcoreConfig.cmake.in
+++ b/cmakeconfig/EcoreConfig.cmake.in
@@ -1,9 +1,19 @@
1# - Try to find ecore 1# - Try to find ecore
2# Once done this will define 2# Once done this will define
3#
3# ECORE_FOUND - System has ecore 4# ECORE_FOUND - System has ecore
4# ECORE_INCLUDE_DIRS - The ecore include directories 5# ECORE_INCLUDE_DIRS - The ecore include directories
5# ECORE_LIBRARIES - The libraries needed to use ecore 6# ECORE_LIBRARIES - The libraries needed to use ecore
6# ECORE_DEFINITIONS - Compiler switches required for using ecore 7# ECORE_DEFINITIONS - Compiler switches required for using ecore
8#
9# When the COMPONENTS keyword was passed to find_package(),
10# the following variables are defined for additional Ecore modules
11# such as Evas, X, Imf.
12#
13# ECORE_*_FOUND - System has ecore *
14# ECORE_*_INCLUDE_DIRS - The ecore include directories
15# ECORE_*_LIBRARIES - The libraries needed to use ecore
16# ECORE_*_DEFINITIONS - Compiler switches required for using ecore * module.
7 17
8set(MY_PKG ecore) 18set(MY_PKG ecore)
9 19
@@ -30,20 +40,27 @@ find_package_handle_standard_args(${MY_PKG} DEFAULT_MSG
30 40
31mark_as_advanced(ECORE_INCLUDE_DIRS ECORE_LIBRARY ECORE_LIBRARIES ECORE_DEFINITIONS) 41mark_as_advanced(ECORE_INCLUDE_DIRS ECORE_LIBRARY ECORE_LIBRARIES ECORE_DEFINITIONS)
32 42
33if (ECORE_USE_ECORE-X) 43if (Ecore_FIND_COMPONENTS)
34 pkg_check_modules(PC_LIBECORE_X ${_QUIET} ecore-x) 44 foreach(_component ${Ecore_FIND_COMPONENTS})
45 string(TOUPPER ${_component} _COMPONENT)
46 string(TOLOWER ${_component} _component)
47 set(_MODULE_PKGNAME ecore-${_component})
35 48
36 find_library(ECORE_X_LIBRARY 49 pkg_check_modules(PC_LIBECORE_${_COMPONENT} ${_QUIET} ${_MODULE_PKGNAME})
37 NAMES ${PC_LIBECORE_X_LIBRARIES}
38 HINTS ${PC_LIBECORE_X_LIBDIR} ${PC_LIBECORE_LIBRARY_DIRS} )
39 50
40 set(ECORE_X_DEFINITIONS ${PC_LIBECORE_CFLAGS_OTHER}) 51 find_library(ECORE_${_COMPONENT}_LIBRARY
41 set(ECORE_X_LIBRARIES ${ECORE_LIBRARY}) 52 NAMES ${PC_LIBECORE_${_COMPONENT}_LIBRARIES}
42 set(ECORE_X_INCLUDE_DIRS ${PC_LIBECORE_INCLUDE_DIRS}) 53 HINTS ${PC_LIBECORE_${_COMPONENT}_LIBDIR}
54 ${PC_LIBECORE_${_COMPONENT}_LIBRARY_DIRS})
43 55
44 include(FindPackageHandleStandardArgs) 56 set(ECORE_${_COMPONENT}_DEFINITIONS ${PC_LIBECORE_${_COMPONENT}_CFLAGS_OTHER})
45 # handle the QUIETLY and REQUIRED arguments and set ECORE_X_FOUND to TRUE 57 set(ECORE_${_COMPONENT}_LIBRARIES ${ECORE_${_COMPONENT}_LIBRARY})
46 # if all listed variables are TRUE 58 set(ECORE_${_COMPONENT}_INCLUDE_DIRS ${PC_LIBECORE_${_COMPONENT}_INCLUDE_DIRS})
47 find_package_handle_standard_args(ecore_x DEFAULT_MSG 59
48 ECORE_X_LIBRARIES ECORE_INCLUDE_DIRS) 60 include(FindPackageHandleStandardArgs)
49endif (ECORE_USE_ECORE-X) 61 # handle the QUIETLY and REQUIRED arguments and set ECORE_*_FOUND to TRUE
62 # if all listed variables are TRUE
63 find_package_handle_standard_args(ecore_${_component} DEFAULT_MSG
64 ECORE_${_COMPONENT}_LIBRARIES ECORE_${_COMPONENT}_INCLUDE_DIRS)
65 endforeach(_component)
66endif(Ecore_FIND_COMPONENTS)