Commit Graph

79 Commits

Author SHA1 Message Date
Marcel Hollerbach bcdde959e6 cmake: add ecore_x 2017-02-07 09:24:52 +01:00
Gustavo Sverzut Barbieri 3cc60ce5f3 cmake: sync EFL_EO_API_SUPPORT definition with autotools.
in autotools we always define that symbol in config.h (thus now done
in common.cmake), while the Efl_Config.h that is generated never have
it, what's left is to enable/disable the legacy and beta APIs.

This fixes building eldbus_suite with cmake.
2017-02-03 12:36:50 -02:00
Marcel Hollerbach 3c0fe3ca3c cmake: add eeze
there is currently a bug in the testsuite which needs to change,
otherwise modules cannot be loaded. The code acutally runs when its
installed and EFL_RUN_IN_TREE is not set.
2017-02-03 10:59:04 +01:00
Gustavo Sverzut Barbieri a679c4a322 cmake: add ecore_file. 2017-02-02 17:15:31 -02:00
Gustavo Sverzut Barbieri 364c5c4cd8 cmake: handle 'FindXXX.cmake' standard with 'find-XXX' libraries.
One can use virtual 'find-XXX' entries in LIBRARIES or
PUBLIC_LIBRARIES to use XXX_LIBRARIES and XXX_INCLUDE_DIR.
2017-02-01 12:25:43 -02:00
Gustavo Sverzut Barbieri b6ded79240 cmake: handle support libraries in .pc
support libraries (src/static_libs), such as rg_etc, must not be
handled as a regular target, after all these are usually not shared
library and if they are, they have no .pc associated, then we use "-l"
as for system libraries, but using the installation path.
2017-02-01 12:25:08 -02:00
Marcel Hollerbach 8dc1166eaa cmake: use the jpeg module of cmake to find the library
finding libjpeg can be a bit more complex, there are systems that are
not delivering a .pc for it. So we should just use the cmake module to
find it.
2017-02-01 12:18:33 +01:00
Gustavo Sverzut Barbieri f6cac7ed9a cmake: add ecore_con. 2017-01-27 17:26:05 -02:00
Gustavo Sverzut Barbieri de67f772bb cmake: pkg-config names uses dashes and are not uniform.
ecore_con provides ecore-con, but ethumb_client provides
ethumb_client. That means we need replace '_' with '-' and allow to
override that, so ethumb_client will work.
2017-01-27 17:26:05 -02:00
Gustavo Sverzut Barbieri 0f4a50c4ba cmake: create and install 'checkme' files for libraries. 2017-01-27 17:26:05 -02:00
Gustavo Sverzut Barbieri 5449deba47 cmake: use CMAKE_INSTALL_LIBDIR instead of 'lib'
this matches the platform preference whenever lib, lib32 or lib64.
2017-01-27 17:26:05 -02:00
Gustavo Sverzut Barbieri 0ba52770bd cmake: EFL_BIN() now checks for EFL_UTILITY and installs to proper location.
utility binaries shouldn't be in bin ($PATH), but in a
library-specific directory (lib/${libname}/utils/v-${maj}.${min})
2017-01-27 17:26:05 -02:00
Gustavo Sverzut Barbieri f5e6b06298 cmake/eo: expose HAVE_EO_ID to build via config_gen.h 2017-01-27 17:26:05 -02:00
Gustavo Sverzut Barbieri 2aeccd16f3 cmake: remove comment, it was my misunderstanding, not a bug. 2017-01-27 13:57:10 -02:00
Gustavo Sverzut Barbieri adc9bbfbdc cmake/eolian: generate source, headers and legacy in one command.
actually wasn't a bug, I need to specify -gchl to generate legacy as
well.
2017-01-27 13:53:15 -02:00
Gustavo Sverzut Barbieri 525d1e0629 cmake: add EFL_SUPPORT_LIB() and simplify/speedup its usage.
generate a static library for src/static_libs and use that as
LIBRARIES for the actual library, for those such as rg_etc that are
used multiple times will even speed up the final build by compiling
only once.

Although not used, they can be made into shared libraries that would
go inside /usr/lib/efl/support/v-1.19/libname.so
2017-01-27 12:52:14 -02:00
Gustavo Sverzut Barbieri aea33c274a cmake/tests: improve naming and add missing include directories.
Some tests were relocated to subdirectory but need shared files, or
may need files from src/tests by including them relatively (../) as
done in ector.

With subdirectories we may end with src/test/libname/suite, to make it
more user friendly and backward compatible call these libname_suite.
2017-01-27 10:34:58 -02:00
Gustavo Sverzut Barbieri 361fe9603f cmake: auto-include subdirectories with generated .eo.* 2017-01-27 10:13:34 -02:00
Gustavo Sverzut Barbieri 10c3736c87 cmake: if path is absolute, include as-is. 2017-01-27 10:03:44 -02:00
Gustavo Sverzut Barbieri a87ba1d6ad cmake: add embryo. 2017-01-26 16:36:21 -02:00
Gustavo Sverzut Barbieri f1959acadd cmake: enable systemd/upower ecore modules.
eldbus was a dependency.
2017-01-26 16:21:17 -02:00
Gustavo Sverzut Barbieri 2ba33b8ff0 cmake: add eldbus. 2017-01-26 16:16:15 -02:00
Gustavo Sverzut Barbieri ba9938b950 cmake: improve options summary with per-library values.
segment the options based on libraries, makes it easier to read.
2017-01-26 15:53:14 -02:00
Gustavo Sverzut Barbieri 85a095f0a8 cmake: fix strlcpy() detection and usage.
Linux usually ship with strlcpy(), but it's inside bsd/string.h and
needs -lbsd.

On BSD it's inside string.h and libc.
2017-01-26 15:53:14 -02:00
Gustavo Sverzut Barbieri 4ed139a49c cmake: more headers and function checks. 2017-01-26 15:53:14 -02:00
Gustavo Sverzut Barbieri ebab91182c cmake/eolian: fix EOLIAN_BIN type.
So EOLIAN_BIN had no type, which resulted in BOOL and thus ON/OFF. It
should be labeled as FILEPATH and then we can remove the special case
in EflMacros.cmake.
2017-01-26 14:48:20 -02:00
Gustavo Sverzut Barbieri e1937739a2 cmake: define EFL_{LIB}_BUILD and DLL_EXPORT.
These are used on Windows builds to force dllexport/dllimport.
2017-01-26 14:23:24 -02:00
Gustavo Sverzut Barbieri 18af6422a0 cmake: auto-detect binaries in src/bin/libname if no CMakeLists.txt
similar to tests, binaries should also follow the same rule and allow
single-binaries with single-source.
2017-01-26 14:23:24 -02:00
Gustavo Sverzut Barbieri f4744e1d2a cmake: auto-detect tests in src/tests/libname if no CMakeLists.txt
previously we were only auto-detecting sources in src/tests/libname/
subdirectories, but we should also check the parent directory if no
subdirectories were processed.
2017-01-26 14:23:24 -02:00
Gustavo Sverzut Barbieri 51307b7cdc cmake: fix test include and defines.
TESTS_WD is prefixed to TESTS_SRC_DIR and should be empty (no idea why
it's like that, maybe to allow relative paths).

TESTS_SRC_DIR must be defined to test source directory and a typo was
preventing that.
2017-01-26 14:23:24 -02:00
Gustavo Sverzut Barbieri b67acda0d6 cmake: add emile and EFL_OPTION_BACKEND()
Add emile and with that EFL_OPTION_BACKEND() to support choosing among
different backends for something, in emile's case it's crypto backend
(gnutls, openssl or none).
2017-01-26 14:23:24 -02:00
Gustavo Sverzut Barbieri 8de264f597 cmake: pkg-config can have version and needs HAVE/ENABLED defines.
pkg-config names can be encoded with a version requirement, such as
zlib>=1.2.3, thus we need to remove that from the variable.

with autotools we used HAVE_XXX and ENABLED_XXX to instruct such
optional library was present, then define that just for the user
target by adding that to its CFLAGS.

This allows us to remove some defines that matches the name, only
leave those that translate from original pkg-config name, such as
libsystemd->systemd.
2017-01-26 14:23:24 -02:00
Gustavo Sverzut Barbieri f958921177 cmake: add ecore.
no tests or modules (which depend on eldbus).
2017-01-25 19:29:20 -02:00
Gustavo Sverzut Barbieri c1b2701770 cmake: check for variable defined, not if it evaluates to false.
otherwise we can't have modules off by default.
2017-01-25 19:29:20 -02:00
Gustavo Sverzut Barbieri f74ca08be9 cmake/eina: check more required functions and link with unwind if found.
unwind is needed for debug, thus link to that.
2017-01-25 19:29:20 -02:00
Gustavo Sverzut Barbieri a2bc5ee130 cmake: improvements to eolian handling.
- fix doc and state SOURCES shouldn't get any EO_FILES, these should
   go to the specific PUBLIC_EO_FILES or EO_FILES.

 - generate eolian files in relative directories, required by
   efl/interfaces

 - .eot files fail if you give -o c:..., they need an explicit "-gh"
   followed by "-o i:..."

 - .legacy.h are generated automatically, but needs an extra pass (q66
   was informed about it)

 - if EOLIAN_BIN=on, then use in-tree binary, depending on such target
   only if it's the case. This allow cross-compiling and also bypass
   regenerate all .eo files if eina/eolian changed (as requested by
   Raster), simply reconfigure with EOLIAN_BIN=path, which can be
   EOLIAN_BIN=bin/eolian_gen if you wish ;-)

 - use COMMENT keyword to change the eolian summary (output)
2017-01-25 19:29:20 -02:00
Gustavo Sverzut Barbieri e4d0f78682 cmake: if EOLIAN_BIN=ON, use built eolian_gen. 2017-01-25 19:29:20 -02:00
Gustavo Sverzut Barbieri fd8865d0d0 cmake: EFL_OPTION() now supports DEPENDS to handle conditionals.
This is now used by ENABLE_SYSTEMD and ENABLE_VALGRIND, which moves to
"common.cmake" since they are shared among multiple libraries.

With that I found that LINK_FLAGS is indeed a string, not a CMake List
(space separated, not ";"), then fix that so compilation actually works.
2017-01-25 19:29:20 -02:00
Gustavo Sverzut Barbieri 4d21d6c56a cmake/common: add missing checks for eina, simplify to one file.
Since the macros were moved to EflMacros.cmake, there is no reason to
keep CommonHeaderChecks.cmake anymore, put them all in
config/common.cmake

Keep the checks sorted so they're easy to organize.

Add missing check for prctl() and iconv() (which we were checking
iconv.h, but the code used '#if HAVE_ICONV').
2017-01-25 19:29:20 -02:00
Gustavo Sverzut Barbieri fa92926469 cmake: major rework of check and pkg-config dependencies.
make FUNC_CHECK(), TYPE_CHECK() and HEADER_CHECK() more general and
they can be set to a scope, like "eina", then all symbols are prefixed
with that. The scope is created with CHECK_INIT(), and
EFL_HEADER_CHECKS_FINALIZE() will finish that.

This makes it possible for cmake/config/eina.cmake +
cmake/post/eina.cmake to add stuff to the generated file, better than
hand edit the template.

CHECK_APPEND_DEFINE(name val) is now the base to add symbols to the
generated file in the current scope.

Then convert cmake/config/eina.cmake to use that and match the
autotools values (were a bit off).

This exposed enabling valgrind was broken due incorrect pkg-config
usage with cmake (it's not obvious), it was using just the libraries,
while LDFLAGS are needed to get -L/usr/lib/valgrind. Then also convert
to CFLAGS provided by pkg-config and make that automatic for
PKG_CONFIG_REQUIRES and PKG_CONFIG_REQUIRES_PRIVATE.

Also, eina-mempool modules use valgrind and must use that now that's
propagating correctly.
2017-01-23 23:55:33 -02:00
Gustavo Sverzut Barbieri ff0d88b7ba cmake/eina: match configure.ac and build all modules statically by default. 2017-01-23 19:50:04 -02:00
Gustavo Sverzut Barbieri d30059bd66 cmake/eo: simplifies eo handling and generate eolian info in .pc.
added 2 cmake target properties to collect private and public eo
files, then that is used by EFL_CREATE_EO_RULES() instead of filtering
SOURCES and also EFL_PKG_CONFIG_LIB_WRITE() to know if eolian entries
should be generated.
2017-01-23 19:35:51 -02:00
Gustavo Sverzut Barbieri ce97fc1dd3 cmake: also process non-public eo files.
the only difference is they do not get installed, but may be used to
generate internal .eo.c
2017-01-23 19:04:30 -02:00
Gustavo Sverzut Barbieri 62ec4c8aa2 cmake: cleanup EFL_CREATE_EO_RULES().
it wasn't using the given generation_dir parameter, it was reseting
the loop variable (which worked, but is nasty).
2017-01-23 18:59:36 -02:00
Gustavo Sverzut Barbieri c178d681f0 cmake: minor simplification of eo files, do not leak vars.
unset the eo variables before we go process modules, tests and
binaries.
2017-01-23 18:59:36 -02:00
Gustavo Sverzut Barbieri 5e294031de cmake: fix module define translation.
we can't check the options in config/eina.cmake as they were not
created at that point, instead we must have a "post" file that is
included after everything else is processed, options/targets all
exist and can be modified.
2017-01-23 18:25:22 -02:00
Gustavo Sverzut Barbieri 0f8a6d04ab cmake: always use test target name, not simple name.
simple name may repeat, like 'suite'.
2017-01-23 18:19:29 -02:00
Gustavo Sverzut Barbieri 8ae1e02f05 cmake: be smart on internal libraries in the generated .pc files.
For internal libraries (those we have a target), generate a pkg-config
one instead of going with the -lNAME route.
2017-01-23 17:28:48 -02:00
Marcel Hollerbach 5b56f3a79d cmake: add that dependency to the right target
we need the eolian-bin for ${target}-eo not ${target}
2017-01-23 20:03:03 +01:00
Marcel Hollerbach 27504d7db0 cmake: add eo 2017-01-23 20:02:06 +01:00