From 0f3d5509bc8b6d437e74483b4a69e91811c737ad Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 5 Feb 2013 16:19:37 +0000 Subject: [PATCH] Efl: 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: 83637 --- Makefile.am | 10 +++++++ cmakeconfig/EcoreConfig.cmake.in | 49 +++++++++++++++++++++++++++++++ cmakeconfig/EdjeConfig.cmake.in | 32 ++++++++++++++++++++ cmakeconfig/EetConfig.cmake.in | 32 ++++++++++++++++++++ cmakeconfig/EfreetConfig.cmake.in | 32 ++++++++++++++++++++ cmakeconfig/EinaConfig.cmake.in | 32 ++++++++++++++++++++ cmakeconfig/EoConfig.cmake.in | 32 ++++++++++++++++++++ cmakeconfig/EvasConfig.cmake.in | 32 ++++++++++++++++++++ configure.ac | 7 +++++ 9 files changed, 258 insertions(+) create mode 100644 cmakeconfig/EcoreConfig.cmake.in create mode 100644 cmakeconfig/EdjeConfig.cmake.in create mode 100644 cmakeconfig/EetConfig.cmake.in create mode 100644 cmakeconfig/EfreetConfig.cmake.in create mode 100644 cmakeconfig/EinaConfig.cmake.in create mode 100644 cmakeconfig/EoConfig.cmake.in create mode 100644 cmakeconfig/EvasConfig.cmake.in diff --git a/Makefile.am b/Makefile.am index a0924be285..4a6d8eb075 100644 --- a/Makefile.am +++ b/Makefile.am @@ -227,6 +227,16 @@ if HAVE_ECORE_AUDIO pkgconfig_DATA += pc/ecore-audio.pc endif +# Cmake configs: +cmakeconfigdir = ${prefix}/share/cmake/Modules/ +cmakeconfig_DATA = cmakeconfig/EinaConfig.cmake \ + cmakeconfig/EoConfig.cmake \ + cmakeconfig/EetConfig.cmake \ + cmakeconfig/EvasConfig.cmake \ + cmakeconfig/EcoreConfig.cmake \ + cmakeconfig/EdjeConfig.cmake \ + cmakeconfig/EfreetConfig.cmake + # D-Bus services: servicedir = @dbusservicedir@ diff --git a/cmakeconfig/EcoreConfig.cmake.in b/cmakeconfig/EcoreConfig.cmake.in new file mode 100644 index 0000000000..3f3cbd38a6 --- /dev/null +++ b/cmakeconfig/EcoreConfig.cmake.in @@ -0,0 +1,49 @@ +# - Try to find ecore +# Once done this will define +# ECORE_FOUND - System has ecore +# ECORE_INCLUDE_DIRS - The ecore include directories +# ECORE_LIBRARIES - The libraries needed to use ecore +# ECORE_DEFINITIONS - Compiler switches required for using ecore + +set(MY_PKG ecore) + +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_LIBECORE ${_QUIET} ${MY_PKG}) + +find_library(ECORE_LIBRARY + NAMES ${PC_LIBECORE_LIBRARIES} + HINTS ${PC_LIBECORE_LIBDIR} ${PC_LIBECORE_LIBRARY_DIRS} ) + +set(ECORE_DEFINITIONS ${PC_LIBECORE_CFLAGS_OTHER}) +set(ECORE_LIBRARIES ${ECORE_LIBRARY}) +set(ECORE_INCLUDE_DIRS ${PC_LIBECORE_INCLUDE_DIRS}) + +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set ECORE_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(${MY_PKG} DEFAULT_MSG + ECORE_LIBRARIES ECORE_INCLUDE_DIRS) + +mark_as_advanced(ECORE_INCLUDE_DIRS ECORE_LIBRARY ECORE_LIBRARIES ECORE_DEFINITIONS) + +if (ECORE_USE_ECORE-X) + pkg_check_modules(PC_LIBECORE_X ${_QUIET} ecore-x) + + find_library(ECORE_X_LIBRARY + NAMES ${PC_LIBECORE_X_LIBRARIES} + HINTS ${PC_LIBECORE_X_LIBDIR} ${PC_LIBECORE_LIBRARY_DIRS} ) + + set(ECORE_X_DEFINITIONS ${PC_LIBECORE_CFLAGS_OTHER}) + set(ECORE_X_LIBRARIES ${ECORE_LIBRARY}) + set(ECORE_X_INCLUDE_DIRS ${PC_LIBECORE_INCLUDE_DIRS}) + + include(FindPackageHandleStandardArgs) + # handle the QUIETLY and REQUIRED arguments and set ECORE_X_FOUND to TRUE + # if all listed variables are TRUE + find_package_handle_standard_args(ecore_x DEFAULT_MSG + ECORE_X_LIBRARIES ECORE_INCLUDE_DIRS) +endif (ECORE_USE_ECORE-X) diff --git a/cmakeconfig/EdjeConfig.cmake.in b/cmakeconfig/EdjeConfig.cmake.in new file mode 100644 index 0000000000..895b61d07c --- /dev/null +++ b/cmakeconfig/EdjeConfig.cmake.in @@ -0,0 +1,32 @@ +# - Try to find edje +# Once done this will define +# EDJE_FOUND - System has edje +# EDJE_INCLUDE_DIRS - The edje include directories +# EDJE_LIBRARIES - The libraries needed to use edje +# EDJE_DEFINITIONS - Compiler switches required for using edje + +set(MY_PKG edje) + +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_LIBEDJE ${_QUIET} ${MY_PKG}) + +find_library(EDJE_LIBRARY + NAMES ${PC_LIBEDJE_LIBRARIES} + HINTS ${PC_LIBEDJE_LIBDIR} ${PC_LIBEDJE_LIBRARY_DIRS} ) + +set(EDJE_DEFINITIONS ${PC_LIBEDJE_CFLAGS_OTHER}) +set(EDJE_LIBRARIES ${EDJE_LIBRARY}) +set(EDJE_INCLUDE_DIRS ${PC_LIBEDJE_INCLUDE_DIRS}) + +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set EDJE_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(${MY_PKG} DEFAULT_MSG + EDJE_LIBRARIES EDJE_INCLUDE_DIRS) + +mark_as_advanced(EDJE_INCLUDE_DIRS EDJE_LIBRARY EDJE_LIBRARIES EDJE_DEFINITIONS) + diff --git a/cmakeconfig/EetConfig.cmake.in b/cmakeconfig/EetConfig.cmake.in new file mode 100644 index 0000000000..479e1f06b8 --- /dev/null +++ b/cmakeconfig/EetConfig.cmake.in @@ -0,0 +1,32 @@ +# - Try to find eet +# Once done this will define +# EET_FOUND - System has eet +# EET_INCLUDE_DIRS - The eet include directories +# EET_LIBRARIES - The libraries needed to use eet +# EET_DEFINITIONS - Compiler switches required for using eet + +set(MY_PKG eet) + +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_LIBEET ${_QUIET} ${MY_PKG}) + +find_library(EET_LIBRARY + NAMES ${PC_LIBEET_LIBRARIES} + HINTS ${PC_LIBEET_LIBDIR} ${PC_LIBEET_LIBRARY_DIRS} ) + +set(EET_DEFINITIONS ${PC_LIBEET_CFLAGS_OTHER}) +set(EET_LIBRARIES ${EET_LIBRARY}) +set(EET_INCLUDE_DIRS ${PC_LIBEET_INCLUDE_DIRS}) + +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set EET_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(${MY_PKG} DEFAULT_MSG + EET_LIBRARIES EET_INCLUDE_DIRS) + +mark_as_advanced(EET_INCLUDE_DIRS EET_LIBRARY EET_LIBRARIES EET_DEFINITIONS) + diff --git a/cmakeconfig/EfreetConfig.cmake.in b/cmakeconfig/EfreetConfig.cmake.in new file mode 100644 index 0000000000..cb39d97d41 --- /dev/null +++ b/cmakeconfig/EfreetConfig.cmake.in @@ -0,0 +1,32 @@ +# - Try to find efreet +# Once done this will define +# EFREET_FOUND - System has efreet +# EFREET_INCLUDE_DIRS - The efreet include directories +# EFREET_LIBRARIES - The libraries needed to use efreet +# EFREET_DEFINITIONS - Compiler switches required for using efreet + +set(MY_PKG efreet) + +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_LIBEFREET ${_QUIET} ${MY_PKG}) + +find_library(EFREET_LIBRARY + NAMES ${PC_LIBEFREET_LIBRARIES} + HINTS ${PC_LIBEFREET_LIBDIR} ${PC_LIBEFREET_LIBRARY_DIRS} ) + +set(EFREET_DEFINITIONS ${PC_LIBEFREET_CFLAGS_OTHER}) +set(EFREET_LIBRARIES ${EFREET_LIBRARY}) +set(EFREET_INCLUDE_DIRS ${PC_LIBEFREET_INCLUDE_DIRS}) + +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set EFREET_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(${MY_PKG} DEFAULT_MSG + EFREET_LIBRARIES EFREET_INCLUDE_DIRS) + +mark_as_advanced(EFREET_INCLUDE_DIRS EFREET_LIBRARY EFREET_LIBRARIES EFREET_DEFINITIONS) + diff --git a/cmakeconfig/EinaConfig.cmake.in b/cmakeconfig/EinaConfig.cmake.in new file mode 100644 index 0000000000..5fa8a5a4b5 --- /dev/null +++ b/cmakeconfig/EinaConfig.cmake.in @@ -0,0 +1,32 @@ +# - Try to find eina +# Once done this will define +# EINA_FOUND - System has eina +# EINA_INCLUDE_DIRS - The eina include directories +# EINA_LIBRARIES - The libraries needed to use eina +# EINA_DEFINITIONS - Compiler switches required for using eina + +set(MY_PKG eina) + +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_LIBEINA ${_QUIET} ${MY_PKG}) + +find_library(EINA_LIBRARY + NAMES ${PC_LIBEINA_LIBRARIES} + HINTS ${PC_LIBEINA_LIBDIR} ${PC_LIBEINA_LIBRARY_DIRS} ) + +set(EINA_DEFINITIONS ${PC_LIBEINA_CFLAGS_OTHER}) +set(EINA_LIBRARIES ${EINA_LIBRARY}) +set(EINA_INCLUDE_DIRS ${PC_LIBEINA_INCLUDE_DIRS}) + +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set EINA_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(${MY_PKG} DEFAULT_MSG + EINA_LIBRARIES EINA_INCLUDE_DIRS) + +mark_as_advanced(EINA_INCLUDE_DIRS EINA_LIBRARY EINA_LIBRARIES EINA_DEFINITIONS) + diff --git a/cmakeconfig/EoConfig.cmake.in b/cmakeconfig/EoConfig.cmake.in new file mode 100644 index 0000000000..268528f598 --- /dev/null +++ b/cmakeconfig/EoConfig.cmake.in @@ -0,0 +1,32 @@ +# - Try to find eo +# Once done this will define +# EO_FOUND - System has eo +# EO_INCLUDE_DIRS - The eo include directories +# EO_LIBRARIES - The libraries needed to use eo +# EO_DEFINITIONS - Compiler switches required for using eo + +set(MY_PKG eo) + +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_LIBEO ${_QUIET} ${MY_PKG}) + +find_library(EO_LIBRARY + NAMES ${PC_LIBEO_LIBRARIES} + HINTS ${PC_LIBEO_LIBDIR} ${PC_LIBEO_LIBRARY_DIRS} ) + +set(EO_DEFINITIONS ${PC_LIBEO_CFLAGS_OTHER}) +set(EO_LIBRARIES ${EO_LIBRARY}) +set(EO_INCLUDE_DIRS ${PC_LIBEO_INCLUDE_DIRS}) + +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set EO_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(${MY_PKG} DEFAULT_MSG + EO_LIBRARIES EO_INCLUDE_DIRS) + +mark_as_advanced(EO_INCLUDE_DIRS EO_LIBRARY EO_LIBRARIES EO_DEFINITIONS) + diff --git a/cmakeconfig/EvasConfig.cmake.in b/cmakeconfig/EvasConfig.cmake.in new file mode 100644 index 0000000000..11510f126c --- /dev/null +++ b/cmakeconfig/EvasConfig.cmake.in @@ -0,0 +1,32 @@ +# - Try to find evas +# Once done this will define +# EVAS_FOUND - System has evas +# EVAS_INCLUDE_DIRS - The evas include directories +# EVAS_LIBRARIES - The libraries needed to use evas +# EVAS_DEFINITIONS - Compiler switches required for using evas + +set(MY_PKG evas) + +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_LIBEVAS ${_QUIET} ${MY_PKG}) + +find_library(EVAS_LIBRARY + NAMES ${PC_LIBEVAS_LIBRARIES} + HINTS ${PC_LIBEVAS_LIBDIR} ${PC_LIBEVAS_LIBRARY_DIRS} ) + +set(EVAS_DEFINITIONS ${PC_LIBEVAS_CFLAGS_OTHER}) +set(EVAS_LIBRARIES ${EVAS_LIBRARY}) +set(EVAS_INCLUDE_DIRS ${PC_LIBEVAS_INCLUDE_DIRS}) + +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set EVAS_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(${MY_PKG} DEFAULT_MSG + EVAS_LIBRARIES EVAS_INCLUDE_DIRS) + +mark_as_advanced(EVAS_INCLUDE_DIRS EVAS_LIBRARY EVAS_LIBRARIES EVAS_DEFINITIONS) + diff --git a/configure.ac b/configure.ac index 856c037e7c..2ab49caf8c 100644 --- a/configure.ac +++ b/configure.ac @@ -3484,6 +3484,13 @@ pc/ethumb_client.pc dbus-services/org.enlightenment.Efreet.service dbus-services/org.enlightenment.Ethumb.service $po_makefile_in +cmakeconfig/EinaConfig.cmake +cmakeconfig/EoConfig.cmake +cmakeconfig/EetConfig.cmake +cmakeconfig/EvasConfig.cmake +cmakeconfig/EcoreConfig.cmake +cmakeconfig/EdjeConfig.cmake +cmakeconfig/EfreetConfig.cmake ]) AC_OUTPUT