diff --git a/Makefile.am b/Makefile.am index d7c830600b..56576982ae 100644 --- a/Makefile.am +++ b/Makefile.am @@ -361,6 +361,12 @@ emotion_cmakeconfig_DATA = \ cmakeconfig/EmotionConfig.cmake \ cmakeconfig/EmotionConfigVersion.cmake +if HAVE_ELUA +elua_cmakeconfigdir = $(libdir)/cmake/Elua +elua_cmakeconfig_DATA = \ +cmakeconfig/EluaConfig.cmake \ +cmakeconfig/EluaConfigVersion.cmake +endif # D-Bus services: diff --git a/cmakeconfig/EluaConfig.cmake.in b/cmakeconfig/EluaConfig.cmake.in new file mode 100644 index 0000000000..0d48224d32 --- /dev/null +++ b/cmakeconfig/EluaConfig.cmake.in @@ -0,0 +1,36 @@ +# - Try to find elua +# Once done this will define +# ELUA_FOUND - System has elua +# ELUA_INCLUDE_DIRS - The elua include directories +# ELUA_LIBRARIES - The libraries needed to use elua +# ELUA_DEFINITIONS - Compiler switches required for using elua +# ELUA_EXECUTABLE - full path to the `elua' program. + +set(MY_PKG elua) + +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_LIBELUA ${_QUIET} ${MY_PKG}) + +find_library(ELUA_LIBRARY + NAMES ${PC_LIBELUA_LIBRARIES} + HINTS ${PC_LIBELUA_LIBDIR} ${PC_LIBELUA_LIBRARY_DIRS}) + +find_program(ELUA_EXECUTABLE + NAMES elua) + +set(ELUA_DEFINITIONS ${PC_LIBELUA_CFLAGS_OTHER}) +set(ELUA_LIBRARIES ${ELUA_LIBRARY}) +set(ELUA_INCLUDE_DIRS ${PC_LIBELUA_INCLUDE_DIRS}) + +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set ELUA_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(${MY_PKG} DEFAULT_MSG + ELUA_LIBRARIES ELUA_INCLUDE_DIRS) + +mark_as_advanced(ELUA_INCLUDE_DIRS ELUA_LIBRARY ELUA_LIBRARIES ELUA_DEFINITIONS ELUA_EXECUTABLE) + diff --git a/configure.ac b/configure.ac index 4e3252d2ba..e09213d417 100644 --- a/configure.ac +++ b/configure.ac @@ -4557,6 +4557,7 @@ pc/emotion.pc pc/ethumb.pc pc/ethumb_client.pc pc/elocation.pc +pc/elua.pc dbus-services/org.enlightenment.Efreet.service dbus-services/org.enlightenment.Ethumb.service systemd-services/efreet.service @@ -4602,6 +4603,8 @@ cmakeconfig/EthumbClientConfig.cmake cmakeconfig/EthumbClientConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in cmakeconfig/EmotionConfig.cmake cmakeconfig/EmotionConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in +cmakeconfig/EluaConfig.cmake +cmakeconfig/EluaConfigVersion.cmake:cmakeconfig/EFLConfigVersion.cmake.in ]) AC_OUTPUT