summaryrefslogtreecommitdiff
path: root/cmake/post/eina.cmake
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-01-23 23:55:33 -0200
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-01-23 23:55:33 -0200
commitfa92926469881cdff7eda4627747fc964c2fa1a4 (patch)
tree9f2b5f016bef28ea01a1eabf05b127c899086eac /cmake/post/eina.cmake
parentff0d88b7bae8fa14140210c5161beb944828bab5 (diff)
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.
Diffstat (limited to '')
-rw-r--r--cmake/post/eina.cmake26
1 files changed, 16 insertions, 10 deletions
diff --git a/cmake/post/eina.cmake b/cmake/post/eina.cmake
index 37be34d0b1..72088d7ce4 100644
--- a/cmake/post/eina.cmake
+++ b/cmake/post/eina.cmake
@@ -1,21 +1,27 @@
1 1
2# TODO: change code to avoid these 2# TODO: change code to avoid these
3if(EINA_MODULE_TYPE_MP_CHAINED STREQUAL "STATIC") 3if(EINA_MODULE_TYPE_MP_CHAINED_POOL STREQUAL "STATIC")
4 SET_GLOBAL(EINA_STATIC_BUILD_CHAINED_POOL 1) 4 CHECK_APPEND_DEFINE(EINA_STATIC_BUILD_CHAINED_POOL 1)
5else() 5else()
6 unset(EINA_STATIC_BUILD_CHAINED_POOL CACHE) 6 CHECK_APPEND_DEFINE(EINA_STATIC_BUILD_CHAINED_POOL "")
7endif() 7endif()
8if(EINA_MODULE_TYPE_MP_ONE_BIG STREQUAL "STATIC") 8if(EINA_MODULE_TYPE_MP_ONE_BIG STREQUAL "STATIC")
9 SET_GLOBAL(EINA_STATIC_BUILD_ONE_BIG 1) 9 CHECK_APPEND_DEFINE(EINA_STATIC_BUILD_ONE_BIG 1)
10else() 10else()
11 unset(EINA_STATIC_BUILD_ONE_BIG CACHE) 11 CHECK_APPEND_DEFINE(EINA_STATIC_BUILD_ONE_BIG "")
12endif() 12endif()
13if(EINA_MODULE_TYPE_MP_PASS_THROUGH STREQUAL "STATIC") 13if(EINA_MODULE_TYPE_MP_PASS_THROUGH STREQUAL "STATIC")
14 SET_GLOBAL(EINA_STATIC_BUILD_PASS_THROUGH 1) 14 CHECK_APPEND_DEFINE(EINA_STATIC_BUILD_PASS_THROUGH 1)
15else() 15else()
16 unset(EINA_STATIC_BUILD_PASS_THROUGH CACHE) 16 CHECK_APPEND_DEFINE(EINA_STATIC_BUILD_PASS_THROUGH "")
17endif() 17endif()
18 18
19configure_file( 19# generate the file and close the scope started with CHECK_INIT(eina):
20 ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/eina/eina_config.h.cmake 20EFL_HEADER_CHECKS_FINALIZE(${CMAKE_CURRENT_BINARY_DIR}/src/lib/eina/eina_config_gen.h)
21 ${CMAKE_CURRENT_BINARY_DIR}/src/lib/eina/eina_config.h) 21
22# TODO: when autotools is gone, rename this file in repository
23# and remove this copy (using generate to skip @-subst)
24file(GENERATE
25 OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/src/lib/eina/eina_config.h
26 INPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/eina/eina_config.h.cmake
27)