summaryrefslogtreecommitdiff
path: root/cmakeconfig/EcoreCxxConfig.cmake.in
diff options
context:
space:
mode:
authorSavio Sena <savio@expertisesolutions.com.br>2014-05-03 00:55:51 +0200
committerCedric Bail <cedric.bail@free.fr>2014-05-03 00:56:32 +0200
commit46b6e8a563bd429690e7bffba4e98d06aa40798d (patch)
treeb7a2aebfc32bcc6d7a2600072a00d69a9f68d9a1 /cmakeconfig/EcoreCxxConfig.cmake.in
parent64c6c63725d96f03baf34b660ca71e13b29078c1 (diff)
downloadefl-46b6e8a563bd429690e7bffba4e98d06aa40798d.tar.gz
eolian_cxx: initial version of the EFL C++ Bindings Generator.
Summary: This patch adds 'eolian_cxx' -- a C++ bindings generator -- to the EFL tree. Eolian Cxx uses Eolian API to read .eo files and generate .eo.hh. It relies/depends on Eo Cxx and Eina Cxx (both non-generated bindings). src/bin/eolian_cxx: The eolian_cxx program. src/lib/eolian_cxx: A header-only library that implements the C++ code generation that binds the .eo classes. =Examples= src/examples/eolian_cxx/eolian_cxx_simple_01.cc: The simplest example, it just uses some "dummy" generated C++ classes. src/examples/eolian_cxx/eolian_cxx_inherit_01.cc: Illustrates how pure C++ classes inherit from .eo generated classes. src/examples/evas/evas_cxx_rectangle.cc: More realistic example using the generated bindings Evas Cxx. Still a bit shallow because we don't have full fledged .eo descriptions yet, but will be improved. =Important= The generated code is not supported and not a stable API/ABI. It is here to gather people interest and get review before we set things in stone for release 1.11. @feature Reviewers: cedric, smohanty, raster, stefan_schmidt CC: felipealmeida, JackDanielZ, cedric, stefan Differential Revision: https://phab.enlightenment.org/D805 Signed-off-by: Cedric Bail <cedric.bail@free.fr>
Diffstat (limited to 'cmakeconfig/EcoreCxxConfig.cmake.in')
-rw-r--r--cmakeconfig/EcoreCxxConfig.cmake.in66
1 files changed, 66 insertions, 0 deletions
diff --git a/cmakeconfig/EcoreCxxConfig.cmake.in b/cmakeconfig/EcoreCxxConfig.cmake.in
new file mode 100644
index 0000000000..4dcd580286
--- /dev/null
+++ b/cmakeconfig/EcoreCxxConfig.cmake.in
@@ -0,0 +1,66 @@
+# - Try to find ecore_cxx
+# Once done this will define
+#
+# ECORE_CXX_FOUND - System has ecore_cxx
+# ECORE_CXX_INCLUDE_DIRS - The ecore_cxx include directories
+# ECORE_CXX_LIBRARIES - The libraries needed to use ecore_cxx
+# ECORE_CXX_DEFINITIONS - Compiler switches required for using ecore_cxx
+#
+# When the COMPONENTS keyword was passed to find_package(),
+# the following variables are defined for additional Ecore_Cxx modules
+# such as Evas, X, Imf, Imf_Evas.
+#
+# ECORE_CXX_*_FOUND - System has ecore_cxx *
+# ECORE_CXX_*_INCLUDE_DIRS - The ecore_cxx include directories
+# ECORE_CXX_*_LIBRARIES - The libraries needed to use ecore_cxx
+# ECORE_CXX_*_DEFINITIONS - Compiler switches required for using ecore_cxx * module.
+
+set(MY_PKG ecore_cxx)
+
+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_CXX ${_QUIET} ${MY_PKG})
+
+find_library(ECORE_CXX_LIBRARY
+ NAMES ${PC_LIBECORE_CXX_LIBRARIES}
+ HINTS ${PC_LIBECORE_CXX_LIBDIR} ${PC_LIBECORE_CXX_LIBRARY_DIRS} )
+
+set(ECORE_CXX_DEFINITIONS ${PC_LIBECORE_CXX_CFLAGS_OTHER})
+set(ECORE_CXX_LIBRARIES ${ECORE_CXX_LIBRARY})
+set(ECORE_CXX_INCLUDE_DIRS ${PC_LIBECORE_CXX_INCLUDE_DIRS})
+
+include(FindPackageHandleStandardArgs)
+# handle the QUIETLY and REQUIRED arguments and set ECORE_CXX_FOUND to TRUE
+# if all listed variables are TRUE
+find_package_handle_standard_args(${MY_PKG} DEFAULT_MSG
+ ECORE_CXX_LIBRARIES ECORE_CXX_INCLUDE_DIRS)
+
+mark_as_advanced(ECORE_CXX_INCLUDE_DIRS ECORE_CXX_LIBRARY ECORE_CXX_LIBRARIES ECORE_CXX_DEFINITIONS)
+
+if (Ecore_Cxx_FIND_COMPONENTS)
+ foreach(_component ${Ecore_Cxx_FIND_COMPONENTS})
+ string(TOUPPER ${_component} _COMPONENT)
+ string(TOLOWER ${_component} _component)
+ string(REGEX REPLACE "_" "-" _MODULE_PKGNAME "ecore_cxx-${_component}")
+
+ pkg_check_modules(PC_LIBECORE_CXX_${_COMPONENT} ${_QUIET} ${_MODULE_PKGNAME})
+
+ find_library(ECORE_CXX_${_COMPONENT}_LIBRARY
+ NAMES ${PC_LIBECORE_CXX_${_COMPONENT}_LIBRARIES}
+ HINTS ${PC_LIBECORE_CXX_${_COMPONENT}_LIBDIR}
+ ${PC_LIBECORE_CXX_${_COMPONENT}_LIBRARY_DIRS})
+
+ set(ECORE_CXX_${_COMPONENT}_DEFINITIONS ${PC_LIBECORE_CXX_${_COMPONENT}_CFLAGS_OTHER})
+ set(ECORE_CXX_${_COMPONENT}_LIBRARIES ${ECORE_CXX_${_COMPONENT}_LIBRARY})
+ set(ECORE_CXX_${_COMPONENT}_INCLUDE_DIRS ${PC_LIBECORE_CXX_${_COMPONENT}_INCLUDE_DIRS})
+
+ include(FindPackageHandleStandardArgs)
+ # handle the QUIETLY and REQUIRED arguments and set ECORE_CXX_*_FOUND to TRUE
+ # if all listed variables are TRUE
+ find_package_handle_standard_args(ecore_cxx_${_component} DEFAULT_MSG
+ ECORE_CXX_${_COMPONENT}_LIBRARIES ECORE_CXX_${_COMPONENT}_INCLUDE_DIRS)
+ endforeach(_component)
+endif(Ecore_Cxx_FIND_COMPONENTS)