summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt15
-rw-r--r--cmake/config/common.cmake19
-rw-r--r--cmake/config/eina.cmake109
-rw-r--r--cmake/helpers/EflMacros.cmake186
-rw-r--r--cmake/post/eina.cmake26
-rw-r--r--src/lib/efl/Efl_Config.h.cmake6
-rw-r--r--src/lib/efl/config.h.cmake24
-rw-r--r--src/lib/eina/CMakeLists.txt3
-rw-r--r--src/lib/eina/eina_config.h.cmake99
-rw-r--r--src/modules/eina/mp/chained_pool/CMakeLists.txt5
-rw-r--r--src/modules/eina/mp/one_big/CMakeLists.txt5
-rw-r--r--src/modules/eina/mp/pass_through/CMakeLists.txt5
12 files changed, 281 insertions, 221 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 09479ba..a1d5dba 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,10 +7,6 @@ include(EflMacros)
7 7
8EFL_PROJECT(1.19.99) 8EFL_PROJECT(1.19.99)
9 9
10if (NOT EFL_BUILD_ID)
11 set(EFL_BUILD_ID 120)
12endif()
13
14if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) 10if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
15 message(FATAL_ERROR "In-source builds not allowed. Use: mkdir -p build && cmake -H. -Bbuild") 11 message(FATAL_ERROR "In-source builds not allowed. Use: mkdir -p build && cmake -H. -Bbuild")
16endif() 12endif()
@@ -41,11 +37,14 @@ EFL_LIB(eo)
41 37
42EFL_OPTIONS_SUMMARY() 38EFL_OPTIONS_SUMMARY()
43 39
44configure_file( 40# TODO: when autotools is gone, rename this file in repository
45 ${PROJECT_SOURCE_DIR}/src/lib/efl/config.h.cmake 41# and remove this copy (using generate to skip @-subst)
46 ${PROJECT_BINARY_DIR}/src/lib/efl/config.h) 42file(GENERATE
43 OUTPUT ${PROJECT_BINARY_DIR}/src/lib/efl/config.h
44 INPUT ${PROJECT_SOURCE_DIR}/src/lib/efl/config.h.cmake)
45EFL_HEADER_CHECKS_FINALIZE(${PROJECT_BINARY_DIR}/src/lib/efl/config_gen.h)
46
47configure_file( 47configure_file(
48 ${PROJECT_SOURCE_DIR}/src/lib/efl/Efl_Config.h.cmake 48 ${PROJECT_SOURCE_DIR}/src/lib/efl/Efl_Config.h.cmake
49 ${PROJECT_BINARY_DIR}/src/lib/efl/Efl_Config.h) 49 ${PROJECT_BINARY_DIR}/src/lib/efl/Efl_Config.h)
50EFL_HEADER_CHECKS_FINALIZE(${PROJECT_BINARY_DIR}/src/lib/efl/config_headers.h)
51EFL_FINALIZE() 50EFL_FINALIZE()
diff --git a/cmake/config/common.cmake b/cmake/config/common.cmake
index 11e45b0..b544ec5 100644
--- a/cmake/config/common.cmake
+++ b/cmake/config/common.cmake
@@ -18,12 +18,19 @@ endif()
18#define all our header / function checks 18#define all our header / function checks
19include(./CommonHeaderChecks) 19include(./CommonHeaderChecks)
20 20
21CHECK_APPEND_DEFINE(EFL_BETA_API_SUPPORT 1)
22if(CMAKE_THREAD_LIBS_INIT)
23 set(EFL_HAVE_THREADS 1)
24endif()
25CHECK_APPEND_DEFINE(EFL_HAVE_THREADS "${EFL_HAVE_THREADS}")
21 26
22#this is needed to build efl 27CHECK_APPEND_DEFINE(MODULE_ARCH "\"v-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}\"")
23set(EFL_BETA_API_SUPPORT 1) 28CHECK_APPEND_DEFINE(SHARED_LIB_SUFFIX "\"${CMAKE_SHARED_LIBRARY_SUFFIX}\"")
29CHECK_APPEND_DEFINE(EXEEXT "\"${CMAKE_EXECUTABLE_SUFFIX}\"")
24 30
25#if there are thread init support from cmake then efl has threads 31# TODO: change code and remove:
32CHECK_APPEND_DEFINE(VMAJ ${PROJECT_VERSION_MAJOR})
33CHECK_APPEND_DEFINE(VMIN ${PROJECT_VERSION_MINOR})
34CHECK_APPEND_DEFINE(VMIC ${PROJECT_VERSION_PATCH})
35CHECK_APPEND_DEFINE(VREV ${PROJECT_VERSION_TWEAK})
26 36
27if (CMAKE_THREAD_LIBS_INIT)
28 set(EFL_HAVE_THREADS 1)
29endif()
diff --git a/cmake/config/eina.cmake b/cmake/config/eina.cmake
index b7da9ae..4091361 100644
--- a/cmake/config/eina.cmake
+++ b/cmake/config/eina.cmake
@@ -1,61 +1,88 @@
1SET_GLOBAL(EINA_SAFETY_CHECKS 1) 1pkg_check_modules(VALGRIND valgrind)
2SET_GLOBAL(EINA_DEBUG_THREADS OFF) 2
3SET_GLOBAL(ENABLE_VALGRIND OFF) 3# set default option values based on BUILD_PROFILE
4set(EINA_DEBUG_THREADS OFF)
5set(ENABLE_VALGRIND OFF)
4if("${BUILD_PROFILE}" STREQUAL "dev") 6if("${BUILD_PROFILE}" STREQUAL "dev")
5 SET_GLOBAL(EINA_STRINGSHARE_USAGE ON) 7 set(ENABLE_VALGRIND ${VALGRIND_FOUND})
6 SET_GLOBAL(CHECK_VALGRIND ON)
7elseif("${BUILD_PROFILE}" STREQUAL "debug") 8elseif("${BUILD_PROFILE}" STREQUAL "debug")
8 SET_GLOBAL(EINA_DEBUG_MALLOC ON) 9 set(EINA_DEBUG_THREADS ON)
9 SET_GLOBAL(EINA_COW_MAGIC_ON ON) 10 set(ENABLE_VALGRIND ${VALGRIND_FOUND})
10 SET_GLOBAL(EINA_DEFAULT_MEMPOOL ON)
11 SET_GLOBAL(EINA_DEBUG_MALLOC ON)
12 SET_GLOBAL(EINA_DEBUG_THREADS ON)
13 SET_GLOBAL(ENABLE_VALGRIND ON)
14elseif("${BUILD_PROFILE}" STREQUAL "release") 11elseif("${BUILD_PROFILE}" STREQUAL "release")
15 SET_GLOBAL(EINA_LOG_LEVEL_MAXIMUM 3)
16endif() 12endif()
17 13
18EFL_OPTION(EINA_MAGIC_DEBUG "magic debug of eina structure" ON) 14EFL_OPTION(EINA_MAGIC_DEBUG "magic debug of eina structure" ON)
19EFL_OPTION(EINA_DEBUG_THREADS "debugging of eina threads" ${EINA_DEBUG_THREADS}) 15EFL_OPTION(EINA_DEBUG_THREADS "debugging of eina threads" ${EINA_DEBUG_THREADS})
20EFL_OPTION(ENABLE_VALGRIND "valgrind support" ${ENABLE_VALGRIND}) 16EFL_OPTION(ENABLE_VALGRIND "valgrind support" ${ENABLE_VALGRIND})
21 17
22SET_GLOBAL(EINA_MODULE_TYPE_MP_CHAINED_POOL_DEFAULT "STATIC") 18set(EINA_MODULE_TYPE_MP_CHAINED_POOL_DEFAULT "STATIC")
23SET_GLOBAL(EINA_MODULE_TYPE_MP_ONE_BIG_DEFAULT "STATIC") 19set(EINA_MODULE_TYPE_MP_ONE_BIG_DEFAULT "STATIC")
24SET_GLOBAL(EINA_MODULE_TYPE_MP_PASS_THROUGH_DEFAULT "STATIC") 20set(EINA_MODULE_TYPE_MP_PASS_THROUGH_DEFAULT "STATIC")
21
22# no CHECK_INIT() yet, all CHECK_APPEND_DEFINE(), FUNC_CHECK(),
23# HEADER_CHECK() and TYPE_CHECK() goes to src/lib/efl/config_gen.h
24
25if(ENABLE_VALGRIND)
26 if(NOT VALGRIND_FOUND)
27 message(FATAL_ERROR "Valgrind was required but not found!")
28 endif()
29 CHECK_APPEND_DEFINE(NVALGRIND "")
30else()
31 CHECK_APPEND_DEFINE(NVALGRIND 1)
32endif()
33
34
35# we want the following checks inside src/lib/eina/eina_config.h to be
36# generated from cmake/post/eina.cmake.
37#
38# By default all symbols are prefixed with EINA_
39CHECK_INIT(eina)
40
41if("${BUILD_PROFILE}" STREQUAL "dev")
42elseif("${BUILD_PROFILE}" STREQUAL "debug")
43 set(EINA_STRINGSHARE_USAGE ON)
44 set(EINA_DEBUG_MALLOC ON)
45 set(EINA_COW_MAGIC_ON ON)
46 set(EINA_DEFAULT_MEMPOOL ON)
47 set(EINA_DEBUG_MALLOC ON)
48elseif("${BUILD_PROFILE}" STREQUAL "release")
49 set(EINA_LOG_LEVEL_MAXIMUM 3)
50endif()
51
52CHECK_APPEND_DEFINE(EINA_MAGIC_DEBUG ${EINA_MAGIC_DEBUG})
53CHECK_APPEND_DEFINE(EINA_SAFETY_CHECKS 1)
54CHECK_APPEND_DEFINE(EINA_DEBUG_THREADS "${EINA_DEBUG_THREADS}")
55CHECK_APPEND_DEFINE(EINA_STRINGSHARE_USAGE "${EINA_STRINGSHARE_USAGE}")
56CHECK_APPEND_DEFINE(EINA_DEBUG_MALLOC "${EINA_DEBUG_MALLOC}")
57CHECK_APPEND_DEFINE(EINA_COW_MAGIC_ON "${EINA_COW_MAGIC_ON}")
58CHECK_APPEND_DEFINE(EINA_DEFAULT_MEMPOOL "${EINA_DEFAULT_MEMPOOL}")
59CHECK_APPEND_DEFINE(EINA_DEBUG_MALLOC "${EINA_DEBUG_MALLOC}")
60CHECK_APPEND_DEFINE(EINA_LOG_LEVEL_MAXIMUM "${EINA_LOG_LEVEL_MAXIMUM}")
61CHECK_APPEND_DEFINE(EINA_HAVE_THREADS "${EFL_HAVE_THREADS}")
25 62
26#check for symbols in pthread 63#check for symbols in pthread
27#TODO Make the definitions depending on the platform 64#TODO Make the definitions depending on the platform
28set(CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}") 65FUNC_CHECK(pthread_barrier_init NAME EINA_HAVE_PTHREAD_BARRIER INCLUDE_FILES pthread.h FLAGS ${CMAKE_THREAD_LIBS_INIT} DEFINITIONS "-D_GNU_SOURCE=1")
29set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE=1") 66FUNC_CHECK(pthread_attr_setaffinity_np NAME EINA_HAVE_PTHREAD_AFFINITY INCLUDE_FILES pthread.h FLAGS ${CMAKE_THREAD_LIBS_INIT} DEFINITIONS "-D_GNU_SOURCE=1")
30CHECK_SYMBOL_EXISTS(pthread_barrier_init pthread.h EINA_HAVE_PTHREAD_BARRIER) 67FUNC_CHECK(pthread_setname_np NAME EINA_HAVE_PTHREAD_SETNAME INCLUDE_FILES pthread.h FLAGS ${CMAKE_THREAD_LIBS_INIT} DEFINITIONS "-D_GNU_SOURCE=1")
31CHECK_SYMBOL_EXISTS(pthread_attr_setaffinity_np pthread.h EINA_HAVE_PTHREAD_AFFINITY) 68FUNC_CHECK(pthread_spin_init NAME EINA_HAVE_POSIX_SPINLOCK INCLUDE_FILES pthread.h FLAGS ${CMAKE_THREAD_LIBS_INIT} DEFINITIONS "-D_GNU_SOURCE=1")
32CHECK_SYMBOL_EXISTS(pthread_setname_np pthread.h EINA_HAVE_PTHREAD_SETNAME)
33CHECK_SYMBOL_EXISTS(pthread_spin_init pthread.h EINA_HAVE_POSIX_SPINLOCK)
34 69
35#check for eina header files that are required 70#check for eina header files that are required
36CHECK_INCLUDE_FILE(alloca.h EINA_HAVE_ALLOCA_H) 71HEADER_CHECK(alloca.h)
37CHECK_INCLUDE_FILE(byteswap.h EINA_HAVE_BYTESWAP_H) 72HEADER_CHECK(byteswap.h)
38CHECK_INCLUDE_FILE(fnmatch.h EINA_HAVE_FNMATCH_H) 73HEADER_CHECK(fnmatch.h)
39#only enable log when fnmatch is there 74#only enable log when fnmatch is there
40if (EINA_HAVE_FNMATCH_H) 75CHECK_APPEND_DEFINE(EINA_ENABLE_LOG ${EINA_HAVE_FNMATCH_H})
41 SET_GLOBAL(EINA_ENABLE_LOG 1) 76HEADER_CHECK(dirent.h)
42endif (EINA_HAVE_FNMATCH_H)
43CHECK_INCLUDE_FILE(dirent.h EINA_HAVE_DIRENT_H)
44 77
45CHECK_TYPE_SIZE("wchar_t" EINA_SIZEOF_WCHAR_T) 78TYPE_CHECK(wchar_t)
46CHECK_TYPE_SIZE("uintptr_t" EINA_SIZEOF_UINTPTR_T) 79TYPE_CHECK(uintptr_t)
47CHECK_TYPE_SIZE("wchar_t" EINA_SIZEOF_WCHAR_T) 80TYPE_CHECK(wchar_t)
48 81
82# TODO: fix define name to not need a name!
49#check for swap16/32/64 83#check for swap16/32/64
50CHECK_SYMBOL_EXISTS(bswap_16 byteswap.h EINA_HAVE_BSWAP16) 84FUNC_CHECK(bswap_16 NAME EINA_HAVE_BSWAP16 INCLUDE_FILES byteswap.h)
51CHECK_SYMBOL_EXISTS(bswap_32 byteswap.h EINA_HAVE_BSWAP32) 85FUNC_CHECK(bswap_32 NAME EINA_HAVE_BSWAP32 INCLUDE_FILES byteswap.h)
52CHECK_SYMBOL_EXISTS(bswap_64 byteswap.h EINA_HAVE_BSWAP64) 86FUNC_CHECK(bswap_64 NAME EINA_HAVE_BSWAP64 INCLUDE_FILES byteswap.h)
53
54if(ENABLE_VALGRIND)
55 pkg_check_modules(VG REQUIRED valgrind)
56 SET_GLOBAL(NVALGRIND OFF)
57else()
58 SET_GLOBAL(NVALGRIND ON)
59endif()
60 87
61#Check if there is the alloca header 88#Check if there is the alloca header
diff --git a/cmake/helpers/EflMacros.cmake b/cmake/helpers/EflMacros.cmake
index e320fb5..2f91e8a 100644
--- a/cmake/helpers/EflMacros.cmake
+++ b/cmake/helpers/EflMacros.cmake
@@ -132,7 +132,66 @@ function(EFL_FINALIZE)
132 add_custom_target(all-tests DEPENDS ${EFL_ALL_TESTS}) 132 add_custom_target(all-tests DEPENDS ${EFL_ALL_TESTS})
133endfunction() 133endfunction()
134 134
135unset(HEADER_FILE_CONTENT CACHE) 135set(VAR_HEADER_FILE_CONTENT HEADER_FILE_CONTENT CACHE INTERNAL "")
136unset(${VAR_HEADER_FILE_CONTENT} CACHE)
137unset(CHECK_SCOPE CACHE)
138unset(CHECK_SCOPE_UPPERCASE CACHE)
139
140# CHECK_INIT(scope)
141#
142# Initialize the scope for the following FUNC_CHECK, TYPE_CHECK,
143# HEADER_CHECK... calls.
144function(CHECK_INIT scope)
145 set(CHECK_SCOPE scope CACHE INTERNAL "Scope of current *_CHECK functions")
146 if(scope)
147 string(TOUPPER ${scope} scope_uc)
148 SET_GLOBAL(CHECK_SCOPE_UPPERCASE ${scope_uc})
149 set(_suffix "_${scope_uc}")
150 else()
151 set(_suffix "")
152 endif()
153 SET_GLOBAL(VAR_HEADER_FILE_CONTENT HEADER_FILE_CONTENT${_suffix})
154 SET_GLOBAL(${VAR_HEADER_FILE_CONTENT} "")
155endfunction()
156
157# CHECK_APPEND_DEFINE(name value)
158#
159# If value evaluates to true:
160# #define ${name} ${value}
161# otherwise:
162# /* #undef ${name} */
163#
164# NOTE: ${name} is not modified at all, if it must include
165# CHECK_SCOPE_UPPERCASE or CHECK_SCOPE, do it yourself.
166function(CHECK_APPEND_DEFINE name value)
167 SET_GLOBAL(${VAR_HEADER_FILE_CONTENT} "${${VAR_HEADER_FILE_CONTENT}}#ifdef ${name}\n#undef ${name}\n#endif\n")
168 if(value)
169 if(value STREQUAL ON OR value STREQUAL TRUE)
170 set(value 1)
171 endif()
172 SET_GLOBAL(${VAR_HEADER_FILE_CONTENT} "${${VAR_HEADER_FILE_CONTENT}}#define ${name} ${value}\n\n")
173 else()
174 SET_GLOBAL(${VAR_HEADER_FILE_CONTENT} "${${VAR_HEADER_FILE_CONTENT}}/* #undef ${name} */\n\n")
175 endif()
176endfunction()
177
178# CHECK_NAME_DEFAULT(name variable)
179#
180# Create the default name based on ${name}
181# and stores in ${variable}.
182#
183# This will automatically prepend ${CHECK_SCOPE_UPPERCASE} if it's
184# defined, will translate everything to uppercase and fix it to be a
185# valid C-symbol.
186function(CHECK_NAME_DEFAULT name var)
187 string(TOUPPER ${name} v)
188 string(REGEX REPLACE "[^a-zA-Z0-9]" "_" v "${v}")
189 string(REGEX REPLACE "_{2,}" "_" v "${v}")
190 if(CHECK_SCOPE_UPPERCASE)
191 set(v "${CHECK_SCOPE_UPPERCASE}_${v}")
192 endif()
193 set(${var} ${v} PARENT_SCOPE)
194endfunction()
136 195
137# HEADER_CHECK(header [NAME variable] [INCLUDE_FILES extra1.h .. extraN.h]) 196# HEADER_CHECK(header [NAME variable] [INCLUDE_FILES extra1.h .. extraN.h])
138# 197#
@@ -145,9 +204,7 @@ unset(HEADER_FILE_CONTENT CACHE)
145# 204#
146# To include extra files, then use INCLUDE_FILES keyword. 205# To include extra files, then use INCLUDE_FILES keyword.
147function(HEADER_CHECK header) 206function(HEADER_CHECK header)
148 string(TOUPPER HAVE_${header} var) 207 CHECK_NAME_DEFAULT(HAVE_${header} var)
149 string(REGEX REPLACE "[^a-zA-Z0-9]" "_" var "${var}")
150 string(REGEX REPLACE "_{2,}" "_" var "${var}")
151 208
152 cmake_parse_arguments(PARAMS "" "NAME" "INCLUDE_FILES" ${ARGN}) 209 cmake_parse_arguments(PARAMS "" "NAME" "INCLUDE_FILES" ${ARGN})
153 210
@@ -158,12 +215,7 @@ function(HEADER_CHECK header)
158 set(CMAKE_EXTRA_INCLUDE_FILES "${PARAMS_INCLUDE_FILES}") 215 set(CMAKE_EXTRA_INCLUDE_FILES "${PARAMS_INCLUDE_FILES}")
159 216
160 CHECK_INCLUDE_FILE(${header} ${var}) 217 CHECK_INCLUDE_FILE(${header} ${var})
161 218 CHECK_APPEND_DEFINE(${var} "${${var}}")
162 if(${${var}})
163 SET_GLOBAL(HEADER_FILE_CONTENT "${HEADER_FILE_CONTENT}#define ${var} 1\n")
164 else()
165 SET_GLOBAL(HEADER_FILE_CONTENT "${HEADER_FILE_CONTENT}#undef ${var}\n")
166 endif()
167endfunction() 219endfunction()
168 220
169# FUNC_CHECK(func [NAME variable] 221# FUNC_CHECK(func [NAME variable]
@@ -184,8 +236,7 @@ endfunction()
184# 236#
185# To use C++ compiler, use CXX keyword 237# To use C++ compiler, use CXX keyword
186function(FUNC_CHECK func) 238function(FUNC_CHECK func)
187 string(TOUPPER HAVE_${func} var) 239 CHECK_NAME_DEFAULT(HAVE_${func} var)
188 string(REGEX REPLACE "_{2,}" "_" var "${var}")
189 240
190 cmake_parse_arguments(PARAMS "CXX" "NAME" "INCLUDE_FILES;LIBRARIES;DEFINITIONS;FLAGS" ${ARGN}) 241 cmake_parse_arguments(PARAMS "CXX" "NAME" "INCLUDE_FILES;LIBRARIES;DEFINITIONS;FLAGS" ${ARGN})
191 242
@@ -193,20 +244,20 @@ function(FUNC_CHECK func)
193 set(CMAKE_REQUIRED_DEFINITIONS "${PARAMS_DEFINITIONS}") 244 set(CMAKE_REQUIRED_DEFINITIONS "${PARAMS_DEFINITIONS}")
194 set(CMAKE_REQUIRED_FLAGS "${PARAMS_FLAGS}") 245 set(CMAKE_REQUIRED_FLAGS "${PARAMS_FLAGS}")
195 246
247 if(PARAMS_NAME)
248 set(var ${PARAMS_NAME})
249 endif()
250
196 if(PARAMS_CXX) 251 if(PARAMS_CXX)
197 check_cxx_symbol_exists(${func} "${PARAMS_INCLUDE_FILES}" ${var}) 252 check_cxx_symbol_exists(${func} "${PARAMS_INCLUDE_FILES}" ${var})
198 else() 253 else()
199 check_symbol_exists(${func} "${PARAMS_INCLUDE_FILES}" ${var}) 254 check_symbol_exists(${func} "${PARAMS_INCLUDE_FILES}" ${var})
200 endif() 255 endif()
201 256
202 if(${${var}} ) 257 CHECK_APPEND_DEFINE(${var} "${${var}}")
203 SET_GLOBAL(HEADER_FILE_CONTENT "${HEADER_FILE_CONTENT}#define ${var} 1\n")
204 else()
205 SET_GLOBAL(HEADER_FILE_CONTENT "${HEADER_FILE_CONTENT}#undef ${var}\n")
206 endif()
207endfunction() 258endfunction()
208 259
209# TYPE_CHECK(type [NAME variable] 260# TYPE_CHECK(type [NAME variable] [SIZEOF variable]
210# [INCLUDE_FILES file1.h ... fileN.h] 261# [INCLUDE_FILES file1.h ... fileN.h]
211# [LIBRARIES lib1 ... libN] 262# [LIBRARIES lib1 ... libN]
212# [DEFINITIONS -DA=1 .. -DN=123] 263# [DEFINITIONS -DA=1 .. -DN=123]
@@ -224,16 +275,24 @@ endfunction()
224# 275#
225# To use C++ compiler, use CXX keyword 276# To use C++ compiler, use CXX keyword
226function(TYPE_CHECK type) 277function(TYPE_CHECK type)
227 string(TOUPPER HAVE_${type} var) 278 CHECK_NAME_DEFAULT(HAVE_${type} var)
228 string(REGEX REPLACE "_{2,}" "_" var "${var}") 279 CHECK_NAME_DEFAULT(SIZEOF_${type} sizeof)
229 280
230 cmake_parse_arguments(PARAMS "CXX" "NAME" "INCLUDE_FILES;LIBRARIES;DEFINITIONS;FLAGS" ${ARGN}) 281 cmake_parse_arguments(PARAMS "CXX" "NAME;SIZEOF" "INCLUDE_FILES;LIBRARIES;DEFINITIONS;FLAGS" ${ARGN})
231 282
232 set(CMAKE_REQUIRED_LIBRARIES "${PARAMS_LIBRARIES}") 283 set(CMAKE_REQUIRED_LIBRARIES "${PARAMS_LIBRARIES}")
233 set(CMAKE_REQUIRED_DEFINITIONS "${PARAMS_DEFINITIONS}") 284 set(CMAKE_REQUIRED_DEFINITIONS "${PARAMS_DEFINITIONS}")
234 set(CMAKE_REQUIRED_FLAGS "${PARAMS_FLAGS}") 285 set(CMAKE_REQUIRED_FLAGS "${PARAMS_FLAGS}")
235 set(CMAKE_EXTRA_INCLUDE_FILES "${PARAMS_INCLUDE_FILES}") 286 set(CMAKE_EXTRA_INCLUDE_FILES "${PARAMS_INCLUDE_FILES}")
236 287
288 if(PARAMS_NAME)
289 set(var ${PARAMS_NAME})
290 endif()
291
292 if(PARAMS_SIZEOF)
293 set(sizeof ${PARAMS_SIZEOF})
294 endif()
295
237 if(PARAMS_CXX) 296 if(PARAMS_CXX)
238 set(lang CXX) 297 set(lang CXX)
239 else() 298 else()
@@ -241,12 +300,8 @@ function(TYPE_CHECK type)
241 endif() 300 endif()
242 301
243 CHECK_TYPE_SIZE(${type} ${var} LANGUAGE ${lang}) 302 CHECK_TYPE_SIZE(${type} ${var} LANGUAGE ${lang})
244 303 CHECK_APPEND_DEFINE(${var} "${HAVE_${var}}")
245 if(HAVE_${var}) 304 CHECK_APPEND_DEFINE(${sizeof} "${${var}}")
246 SET_GLOBAL(HEADER_FILE_CONTENT "${HEADER_FILE_CONTENT}#define ${var} 1\n")
247 else()
248 SET_GLOBAL(HEADER_FILE_CONTENT "${HEADER_FILE_CONTENT}#undef ${var}\n")
249 endif()
250endfunction() 305endfunction()
251 306
252# EFL_HEADER_CHECKS_FINALIZE(file) 307# EFL_HEADER_CHECKS_FINALIZE(file)
@@ -254,7 +309,11 @@ endfunction()
254# Write the configuration gathered with HEADER_CHECK(), TYPE_CHECK() 309# Write the configuration gathered with HEADER_CHECK(), TYPE_CHECK()
255# and FUNC_CHECK() to the given file. 310# and FUNC_CHECK() to the given file.
256function(EFL_HEADER_CHECKS_FINALIZE file) 311function(EFL_HEADER_CHECKS_FINALIZE file)
257 file(WRITE ${file}.new ${HEADER_FILE_CONTENT}) 312 get_filename_component(filename ${file} NAME)
313 string(TOUPPER _${filename}_ file_sym)
314 string(REGEX REPLACE "[^a-zA-Z0-9]" "_" file_sym "${file_sym}")
315
316 file(WRITE ${file}.new "#ifndef ${file_sym}\n#define ${file_sym} 1\n\n${${VAR_HEADER_FILE_CONTENT}}\n#endif /* ${file_sym} */\n")
258 if (NOT EXISTS ${file}) 317 if (NOT EXISTS ${file})
259 file(RENAME ${file}.new ${file}) 318 file(RENAME ${file}.new ${file})
260 message(STATUS "${file} was generated.") 319 message(STATUS "${file} was generated.")
@@ -269,7 +328,10 @@ function(EFL_HEADER_CHECKS_FINALIZE file)
269 message(STATUS "${file} was updated.") 328 message(STATUS "${file} was updated.")
270 endif() 329 endif()
271 endif() 330 endif()
272 unset(HEADER_FILE_CONTENT CACHE) # allow to reuse with an empty contents 331 unset(${VAR_HEADER_FILE_CONTENT} CACHE) # allow to reuse with an empty contents
332 unset(CHECK_SCOPE CACHE)
333 unset(CHECK_SCOPE_UPPERCASE CACHE)
334 set(VAR_HEADER_FILE_CONTENT HEADER_FILE_CONTENT CACHE INTERNAL "")
273endfunction() 335endfunction()
274 336
275# EFL_FILES_TO_ABSOLUTE(Var Source_Dir Binary_Dir [file1 ... fileN]) 337# EFL_FILES_TO_ABSOLUTE(Var Source_Dir Binary_Dir [file1 ... fileN])
@@ -322,6 +384,12 @@ function(EFL_PKG_CONFIG_EVAL_TO _var _name)
322 if(NOT _missing) 384 if(NOT _missing)
323 SET_GLOBAL(${_var} "${_found}") 385 SET_GLOBAL(${_var} "${_found}")
324 SET_GLOBAL(${_var}_MISSING "${_missing_optional}") 386 SET_GLOBAL(${_var}_MISSING "${_missing_optional}")
387
388 if(_found)
389 pkg_check_modules(PKG_CONFIG_${_var} ${_found})
390 SET_GLOBAL(${_var}_CFLAGS "${PKG_CONFIG_${_var}_CFLAGS}")
391 SET_GLOBAL(${_var}_LDFLAGS "${PKG_CONFIG_${_var}_LDFLAGS}")
392 endif()
325 else() 393 else()
326 message(FATAL_ERROR "${_name} missing required pkg-config modules: ${_missing}") 394 message(FATAL_ERROR "${_name} missing required pkg-config modules: ${_missing}")
327 endif() 395 endif()
@@ -669,6 +737,13 @@ function(EFL_LIB _target)
669 737
670 EFL_PKG_CONFIG_EVAL(${_target} "${PKG_CONFIG_REQUIRES_PRIVATE}" "${PKG_CONFIG_REQUIRES}") 738 EFL_PKG_CONFIG_EVAL(${_target} "${PKG_CONFIG_REQUIRES_PRIVATE}" "${PKG_CONFIG_REQUIRES}")
671 739
740 set(_link_flags ${${_target}_PKG_CONFIG_REQUIRES_PRIVATE_LDFLAGS} ${${_target}_PKG_CONFIG_REQUIRES_LDFLAGS})
741 set(__compile_flags ${${_target}_PKG_CONFIG_REQUIRES_PRIVATE_CFLAGS} ${${_target}_PKG_CONFIG_REQUIRES_CFLAGS} -DPACKAGE_DATA_DIR=\\"${CMAKE_INSTALL_FULL_DATADIR}/${_target}/\\")
742 set(_compile_flags)
743 # CMake uses string for COMPILE_FLAGS but list for LINK_FLAGS... :-/
744 foreach(_c ${__compile_flags})
745 set(_compile_flags "${_compile_flags} ${_c}")
746 endforeach()
672 747
673 add_library(${_target} ${LIBRARY_TYPE} ${_sources} ${_headers}) 748 add_library(${_target} ${LIBRARY_TYPE} ${_sources} ${_headers})
674 set_target_properties(${_target} PROPERTIES 749 set_target_properties(${_target} PROPERTIES
@@ -677,7 +752,8 @@ function(EFL_LIB _target)
677 OBJECT_DEPENDS "${_obj_deps}" 752 OBJECT_DEPENDS "${_obj_deps}"
678 EFL_EO_PRIVATE "${_eo_files}" 753 EFL_EO_PRIVATE "${_eo_files}"
679 EFL_EO_PUBLIC "${_public_eo_files}" 754 EFL_EO_PUBLIC "${_public_eo_files}"
680 COMPILE_FLAGS -DPACKAGE_DATA_DIR=\\"${CMAKE_INSTALL_FULL_DATADIR}/${_target}/\\") 755 LINK_FLAGS "${_link_flags}"
756 COMPILE_FLAGS "${_compile_flags}")
681 757
682 if(DEPENDENCIES) 758 if(DEPENDENCIES)
683 add_dependencies(${_target} ${DEPENDENCIES}) 759 add_dependencies(${_target} ${DEPENDENCIES})
@@ -793,6 +869,8 @@ function(EFL_BIN _binname)
793 set(DEFINITIONS) 869 set(DEFINITIONS)
794 set(INSTALL ON) 870 set(INSTALL ON)
795 set(INSTALL_DIR bin) 871 set(INSTALL_DIR bin)
872 set(PKG_CONFIG_REQUIRES)
873 set(PKG_CONFIG_REQUIRES_PRIVATE)
796 874
797 if(_binname STREQUAL ${EFL_LIB_CURRENT}) 875 if(_binname STREQUAL ${EFL_LIB_CURRENT})
798 set(_binsrcdir "${EFL_BIN_SOURCE_DIR}") 876 set(_binsrcdir "${EFL_BIN_SOURCE_DIR}")
@@ -813,10 +891,15 @@ function(EFL_BIN _binname)
813 if(PUBLIC_HEADERS) 891 if(PUBLIC_HEADERS)
814 message(WARNING "${_binsrcdir}/CMakeLists.txt should not define PUBLIC_HEADERS, it's not to be installed.") 892 message(WARNING "${_binsrcdir}/CMakeLists.txt should not define PUBLIC_HEADERS, it's not to be installed.")
815 endif() 893 endif()
894 if(PKG_CONFIG_REQUIRES)
895 message(WARNING "${_binsrcdir}/CMakeLists.txt should not define PKG_CONFIG_REQUIRES. Use PKG_CONFIG_REQUIRES_PRIVATE instead")
896 endif()
816 897
817 EFL_FILES_TO_ABSOLUTE(_sources ${_binsrcdir} ${_binbindir} ${SOURCES}) 898 EFL_FILES_TO_ABSOLUTE(_sources ${_binsrcdir} ${_binbindir} ${SOURCES})
818 EFL_FILES_TO_ABSOLUTE(_obj_deps ${_binsrcdir} ${_binbindir} ${OBJECT_DEPENDS}) 899 EFL_FILES_TO_ABSOLUTE(_obj_deps ${_binsrcdir} ${_binbindir} ${OBJECT_DEPENDS})
819 900
901 EFL_PKG_CONFIG_EVAL(${_bintarget} "${PKG_CONFIG_REQUIRES_PRIVATE}" "")
902
820 add_executable(${_bintarget} ${_sources}) 903 add_executable(${_bintarget} ${_sources})
821 904
822 if(_obj_deps) 905 if(_obj_deps)
@@ -848,6 +931,16 @@ function(EFL_BIN _binname)
848 set_target_properties(${_bintarget} PROPERTIES OUTPUT_NAME ${OUTPUT_NAME}) 931 set_target_properties(${_bintarget} PROPERTIES OUTPUT_NAME ${OUTPUT_NAME})
849 endif() 932 endif()
850 933
934 # CMake uses string for COMPILE_FLAGS but list for LINK_FLAGS... :-/
935 set(_compile_flags)
936 foreach(_c ${${_bintarget}_PKG_CONFIG_REQUIRES_PRIVATE_CFLAGS})
937 set(_compile_flags "${_compile_flags} ${_c}")
938 endforeach()
939
940 set_target_properties(${_bintarget} PROPERTIES
941 LINK_FLAGS "${${_bintarget}_PKG_CONFIG_REQUIRES_PRIVATE_LDFLAGS}"
942 COMPILE_FLAGS "${_compile_flags}")
943
851 if(INSTALL_DIR) 944 if(INSTALL_DIR)
852 install(TARGETS ${_bintarget} RUNTIME DESTINATION ${INSTALL_DIR}) 945 install(TARGETS ${_bintarget} RUNTIME DESTINATION ${INSTALL_DIR})
853 endif() 946 endif()
@@ -889,6 +982,8 @@ function(EFL_TEST _testname)
889 endif() 982 endif()
890 set(LIBRARIES) 983 set(LIBRARIES)
891 set(DEFINITIONS) 984 set(DEFINITIONS)
985 set(PKG_CONFIG_REQUIRES)
986 set(PKG_CONFIG_REQUIRES_PRIVATE)
892 987
893 if(_testname STREQUAL ${EFL_LIB_CURRENT}) 988 if(_testname STREQUAL ${EFL_LIB_CURRENT})
894 set(_testsrcdir "${EFL_TESTS_SOURCE_DIR}") 989 set(_testsrcdir "${EFL_TESTS_SOURCE_DIR}")
@@ -910,10 +1005,15 @@ function(EFL_TEST _testname)
910 if(PUBLIC_HEADERS) 1005 if(PUBLIC_HEADERS)
911 message(WARNING "${_testsrcdir}/CMakeLists.txt should not define PUBLIC_HEADERS, it's not to be installed.") 1006 message(WARNING "${_testsrcdir}/CMakeLists.txt should not define PUBLIC_HEADERS, it's not to be installed.")
912 endif() 1007 endif()
1008 if(PKG_CONFIG_REQUIRES)
1009 message(WARNING "${_testsrcdir}/CMakeLists.txt should not define PKG_CONFIG_REQUIRES. Use PKG_CONFIG_REQUIRES_PRIVATE instead")
1010 endif()
913 1011
914 EFL_FILES_TO_ABSOLUTE(_sources ${_testsrcdir} ${_testbindir} ${SOURCES}) 1012 EFL_FILES_TO_ABSOLUTE(_sources ${_testsrcdir} ${_testbindir} ${SOURCES})
915 EFL_FILES_TO_ABSOLUTE(_obj_deps ${_testsrcdir} ${_testbindir} ${OBJECT_DEPENDS}) 1013 EFL_FILES_TO_ABSOLUTE(_obj_deps ${_testsrcdir} ${_testbindir} ${OBJECT_DEPENDS})
916 1014
1015 EFL_PKG_CONFIG_EVAL(${_testtarget} "${PKG_CONFIG_REQUIRES_PRIVATE}" "")
1016
917 add_executable(${_testtarget} EXCLUDE_FROM_ALL ${_sources}) 1017 add_executable(${_testtarget} EXCLUDE_FROM_ALL ${_sources})
918 1018
919 if(_obj_deps) 1019 if(_obj_deps)
@@ -949,7 +1049,15 @@ function(EFL_TEST _testname)
949 set_target_properties(${_testtarget} PROPERTIES OUTPUT_NAME ${OUTPUT_NAME}) 1049 set_target_properties(${_testtarget} PROPERTIES OUTPUT_NAME ${OUTPUT_NAME})
950 endif() 1050 endif()
951 1051
1052 # CMake uses string for COMPILE_FLAGS but list for LINK_FLAGS... :-/
1053 set(_compile_flags)
1054 foreach(_c ${${_testtarget}_PKG_CONFIG_REQUIRES_PRIVATE_CFLAGS})
1055 set(_compile_flags "${_compile_flags} ${_c}")
1056 endforeach()
1057
952 set_target_properties(${_testtarget} PROPERTIES 1058 set_target_properties(${_testtarget} PROPERTIES
1059 LINK_FLAGS "${${_testtarget}_PKG_CONFIG_REQUIRES_PRIVATE_LDFLAGS}"
1060 COMPILE_FLAGS "${_compile_flags}"
953 LIBRARY_OUTPUT_DIRECTORY "${_testbindir}" 1061 LIBRARY_OUTPUT_DIRECTORY "${_testbindir}"
954 RUNTIME_OUTPUT_DIRECTORY "${_testbindir}") 1062 RUNTIME_OUTPUT_DIRECTORY "${_testbindir}")
955 1063
@@ -978,6 +1086,9 @@ endfunction()
978# - INSTALL_DIR: defaults to 1086# - INSTALL_DIR: defaults to
979# lib/${EFL_LIB_CURRENT}/modules/${EFL_MODULE_SCOPE}/${Name}/v-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}/. 1087# lib/${EFL_LIB_CURRENT}/modules/${EFL_MODULE_SCOPE}/${Name}/v-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}/.
980# If empty, won't install. 1088# If empty, won't install.
1089# - PKG_CONFIG_REQUIRES_PRIVATE: results in
1090# ${Name}_PKG_CONFIG_REQUIRES_PRIVATE. Elements after 'OPTIONAL'
1091# keyword are optional.
981# 1092#
982# NOTE: since the file will be included it shouldn't mess with global variables! 1093# NOTE: since the file will be included it shouldn't mess with global variables!
983function(EFL_MODULE _modname) 1094function(EFL_MODULE _modname)
@@ -1011,6 +1122,8 @@ function(EFL_MODULE _modname)
1011 set(DEFINITIONS) 1122 set(DEFINITIONS)
1012 set(MODULE_TYPE "${${_modoptionname}}") 1123 set(MODULE_TYPE "${${_modoptionname}}")
1013 set(INSTALL_DIR ${_modoutdir}) 1124 set(INSTALL_DIR ${_modoutdir})
1125 set(PKG_CONFIG_REQUIRES)
1126 set(PKG_CONFIG_REQUIRES_PRIVATE)
1014 1127
1015 _EFL_INCLUDE_OR_DETECT("Module ${_modtarget}" ${_modsrcdir}) 1128 _EFL_INCLUDE_OR_DETECT("Module ${_modtarget}" ${_modsrcdir})
1016 1129
@@ -1021,6 +1134,9 @@ function(EFL_MODULE _modname)
1021 if(PUBLIC_HEADERS) 1134 if(PUBLIC_HEADERS)
1022 message(WARNING "${_modsrcdir}/CMakeLists.txt should not define PUBLIC_HEADERS, it's not to be installed.") 1135 message(WARNING "${_modsrcdir}/CMakeLists.txt should not define PUBLIC_HEADERS, it's not to be installed.")
1023 endif() 1136 endif()
1137 if(PKG_CONFIG_REQUIRES)
1138 message(WARNING "${_modsrcdir}/CMakeLists.txt should not define PKG_CONFIG_REQUIRES. Use PKG_CONFIG_REQUIRES_PRIVATE instead")
1139 endif()
1024 1140
1025 if("${MODULE_TYPE}" STREQUAL "OFF") 1141 if("${MODULE_TYPE}" STREQUAL "OFF")
1026 return() 1142 return()
@@ -1033,6 +1149,8 @@ function(EFL_MODULE _modname)
1033 EFL_FILES_TO_ABSOLUTE(_sources ${_modsrcdir} ${_modbindir} ${SOURCES}) 1149 EFL_FILES_TO_ABSOLUTE(_sources ${_modsrcdir} ${_modbindir} ${SOURCES})
1034 EFL_FILES_TO_ABSOLUTE(_obj_deps ${_modsrcdir} ${_modbindir} ${OBJECT_DEPENDS}) 1150 EFL_FILES_TO_ABSOLUTE(_obj_deps ${_modsrcdir} ${_modbindir} ${OBJECT_DEPENDS})
1035 1151
1152 EFL_PKG_CONFIG_EVAL(${_modtarget} "${PKG_CONFIG_REQUIRES_PRIVATE}" "")
1153
1036 add_library(${_modtarget} ${_modtype} ${_sources}) 1154 add_library(${_modtarget} ${_modtype} ${_sources})
1037 set_target_properties(${_modtarget} PROPERTIES 1155 set_target_properties(${_modtarget} PROPERTIES
1038 OBJECT_DEPENDS "${_obj_deps}" 1156 OBJECT_DEPENDS "${_obj_deps}"
@@ -1049,7 +1167,15 @@ function(EFL_MODULE _modname)
1049 1167
1050 target_compile_definitions(${_modtarget} PRIVATE ${DEFINITIONS}) 1168 target_compile_definitions(${_modtarget} PRIVATE ${DEFINITIONS})
1051 1169
1170 # CMake uses string for COMPILE_FLAGS but list for LINK_FLAGS... :-/
1171 set(_compile_flags)
1172 foreach(_c ${${_modtarget}_PKG_CONFIG_REQUIRES_PRIVATE_CFLAGS})
1173 set(_compile_flags "${_compile_flags} ${_c}")
1174 endforeach()
1175
1052 set_target_properties(${_modtarget} PROPERTIES 1176 set_target_properties(${_modtarget} PROPERTIES
1177 LINK_FLAGS "${${_modtarget}_PKG_CONFIG_REQUIRES_PRIVATE_LDFLAGS}"
1178 COMPILE_FLAGS "${_compile_flags}"
1053 LIBRARY_OUTPUT_DIRECTORY "${_modoutdir}" 1179 LIBRARY_OUTPUT_DIRECTORY "${_modoutdir}"
1054 ARCHIVE_OUTPUT_DIRECTORY "${_modoutdir}" 1180 ARCHIVE_OUTPUT_DIRECTORY "${_modoutdir}"
1055 RUNTIME_OUTPUT_DIRECTORY "${_modoutdir}") 1181 RUNTIME_OUTPUT_DIRECTORY "${_modoutdir}")
diff --git a/cmake/post/eina.cmake b/cmake/post/eina.cmake
index 37be34d..72088d7 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)
diff --git a/src/lib/efl/Efl_Config.h.cmake b/src/lib/efl/Efl_Config.h.cmake
index e1c199c..a99d153 100644
--- a/src/lib/efl/Efl_Config.h.cmake
+++ b/src/lib/efl/Efl_Config.h.cmake
@@ -15,7 +15,7 @@
15 and require an explicit request to get it. */ 15 and require an explicit request to get it. */
16#endif 16#endif
17 17
18#define EFL_VERSION_MAJOR @EFL_VERSION_MAJOR@ 18#define EFL_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
19#define EFL_VERSION_MINOR @EFL_VERSION_MINOR@ 19#define EFL_VERSION_MINOR @PROJECT_VERSION_MINOR@
20#define EFL_BUILD_ID "@EFL_BUILD_ID@" 20#define EFL_BUILD_ID "@PROJECT_VERSION_TWEAK@"
21#endif 21#endif
diff --git a/src/lib/efl/config.h.cmake b/src/lib/efl/config.h.cmake
index 47ceb53..35ab3c3 100644
--- a/src/lib/efl/config.h.cmake
+++ b/src/lib/efl/config.h.cmake
@@ -3,22 +3,7 @@
3 3
4#define _GNU_SOURCE 4#define _GNU_SOURCE
5 5
6#include "config_headers.h" 6#include "config_gen.h"
7
8#define VMAJ @PROJECT_VERSION_MAJOR@
9#define VMIN @PROJECT_VERSION_MINOR@
10#define VMIC @PROJECT_VERSION_PATCH@
11#define VREV @PROJECT_VERSION_TWEAK@
12
13#cmakedefine NVALGRIND 1
14
15#cmakedefine EINA_STATIC_BUILD_CHAINED_POOL 1
16#cmakedefine EINA_STATIC_BUILD_ONE_BIG 1
17#cmakedefine EINA_STATIC_BUILD_PASS_THROUGH 1
18
19#define MODULE_ARCH "v-@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@"
20#define SHARED_LIB_SUFFIX "@CMAKE_SHARED_LIBRARY_SUFFIX@"
21#define EXEEXT "@CMAKE_EXECUTABLE_SUFFIX@"
22 7
23#if defined (HAVE_LISTXATTR) && defined (HAVE_SETXATTR) && defined (HAVE_GETXATTR) 8#if defined (HAVE_LISTXATTR) && defined (HAVE_SETXATTR) && defined (HAVE_GETXATTR)
24#define HAVE_XATTR 9#define HAVE_XATTR
@@ -27,11 +12,4 @@
27//for now statically define that to one 12//for now statically define that to one
28#define STRERROR_R_CHAR_P 1 13#define STRERROR_R_CHAR_P 1
29 14
30#cmakedefine EFL_ALWAYS_INLINE @EFL_ALWAYS_INLINE@
31#cmakedefine EFL_HAVE_OSX_SPINLOCK 1
32#cmakedefine EFL_HAVE_POSIX_THREADS_SPINLOCK 1
33#cmakedefine EFL_HAVE_THREADS 1
34
35#cmakedefine HAVE_EO_ID
36
37#endif 15#endif
diff --git a/src/lib/eina/CMakeLists.txt b/src/lib/eina/CMakeLists.txt
index 6c16016..dabbabf 100644
--- a/src/lib/eina/CMakeLists.txt
+++ b/src/lib/eina/CMakeLists.txt
@@ -13,8 +13,6 @@ set(LIBRARIES
13 13
14if(ENABLE_VALGRIND) 14if(ENABLE_VALGRIND)
15 list(APPEND PKG_CONFIG_REQUIRES_PRIVATE valgrind) 15 list(APPEND PKG_CONFIG_REQUIRES_PRIVATE valgrind)
16 list(APPEND INCLUDE_DIRECTORIES ${VG_INCLUDE_DIRS})
17 list(APPEND LIBRARIES ${VG_LIBRARIES})
18endif() 16endif()
19 17
20set(PUBLIC_HEADERS 18set(PUBLIC_HEADERS
@@ -28,6 +26,7 @@ set(PUBLIC_HEADERS
28 eina_binshare.h 26 eina_binshare.h
29 eina_clist.h 27 eina_clist.h
30 eina_config.h 28 eina_config.h
29 eina_config_gen.h
31 eina_convert.h 30 eina_convert.h
32 eina_counter.h 31 eina_counter.h
33 eina_cow.h 32 eina_cow.h
diff --git a/src/lib/eina/eina_config.h.cmake b/src/lib/eina/eina_config.h.cmake
index a4aac7d..6db7c81 100644
--- a/src/lib/eina/eina_config.h.cmake
+++ b/src/lib/eina/eina_config.h.cmake
@@ -23,104 +23,7 @@
23# include <Exotic.h> 23# include <Exotic.h>
24#endif 24#endif
25 25
26#ifdef EINA_MAGIC_DEBUG 26#include "eina_config_gen.h"
27# undef EINA_MAGIC_DEBUG
28#endif
29#cmakedefine EINA_MAGIC_DEBUG
30
31#ifndef EINA_DEFAULT_MEMPOOL
32# undef EINA_DEFAULT_MEMPOOL
33#endif
34#cmakedefine EINA_DEFAULT_MEMPOOL
35
36#ifdef EINA_SAFETY_CHECKS
37# undef EINA_SAFETY_CHECKS
38#endif
39#cmakedefine EINA_SAFETY_CHECKS
40
41#ifndef EINA_HAVE_THREADS
42#define EINA_HAVE_THREADS
43#endif
44
45#ifdef EINA_HAVE_PTHREAD_AFFINITY
46# undef EINA_HAVE_PTHREAD_AFFINITY
47#endif
48#cmakedefine EINA_HAVE_PTHREAD_AFFINITY
49
50#ifdef EINA_HAVE_PTHREAD_BARRIER
51# undef EINA_HAVE_PTHREAD_BARRIER
52#endif
53#cmakedefine EINA_HAVE_PTHREAD_BARRIER
54
55#ifdef EINA_HAVE_PTHREAD_SETNAME
56# undef EINA_HAVE_PTHREAD_SETNAME
57#endif
58#cmakedefine EINA_HAVE_PTHREAD_SETNAME
59
60#ifdef EINA_HAVE_DEBUG_THREADS
61# undef EINA_HAVE_DEBUG_THREADS
62#endif
63#cmakedefine EINA_HAVE_DEBUG_THREADS
64
65#ifdef EINA_SIZEOF_WCHAR_T
66# undef EINA_SIZEOF_WCHAR_T
67#endif
68#cmakedefine EINA_SIZEOF_WCHAR_T @EINA_SIZEOF_WCHAR_T@
69
70#ifdef EINA_SIZEOF_UINTPTR_T
71# undef EINA_SIZEOF_UINTPTR_T
72#endif
73#cmakedefine EINA_SIZEOF_UINTPTR_T @EINA_SIZEOF_UINTPTR_T@
74
75#ifdef EINA_CONFIGURE_HAVE_DIRENT_H
76# undef EINA_CONFIGURE_HAVE_DIRENT_H
77#endif
78#cmakedefine EINA_HAVE_DIRENT_H
79
80#ifdef EINA_CONFIGURE_ENABLE_LOG
81# undef EINA_CONFIGURE_ENABLE_LOG
82#endif
83#cmakedefine EINA_ENABLE_LOG
84
85#ifdef EINA_HAVE_ALLOCA_H
86# undef EINA_HAVE_ALLOCA_H
87#endif
88#cmakedefine EINA_HAVE_ALLOCA_H
89
90#ifdef EINA_HAVE_BSWAP16
91# undef EINA_HAVE_BSWAP16
92#endif
93#cmakedefine EINA_HAVE_BSWAP16
94
95#ifdef EINA_HAVE_BSWAP32
96# undef EINA_HAVE_BSWAP32
97#endif
98#cmakedefine EINA_HAVE_BSWAP32
99
100#ifdef EINA_HAVE_BSWAP64
101# undef EINA_HAVE_BSWAP64
102#endif
103#cmakedefine EINA_HAVE_BSWAP64
104
105#ifdef EINA_HAVE_BYTESWAP_H
106# undef EINA_HAVE_BYTESWAP_H
107#endif
108#cmakedefine EINA_HAVE_BYTESWAP_H
109
110#ifdef EINA_HAVE_POSIX_SPINLOCK
111# undef EINA_HAVE_POSIX_SPINLOCK
112#endif
113#cmakedefine EINA_HAVE_POSIX_SPINLOCK
114
115#ifndef EINA_HAVE_OSX_SPINLOCK
116# undef EINA_HAVE_OSX_SPINLOCK
117#endif
118@EINA_CONFIGURE_HAVE_OSX_SPINLOCK@
119
120#ifndef EINA_HAVE_OSX_SEMAPHORE
121# undef EINA_HAVE_OSX_SEMAPHORE
122#endif
123@EINA_CONFIGURE_HAVE_OSX_SEMAPHORE@
124 27
125#include <limits.h> 28#include <limits.h>
126 29
diff --git a/src/modules/eina/mp/chained_pool/CMakeLists.txt b/src/modules/eina/mp/chained_pool/CMakeLists.txt
new file mode 100644
index 0000000..fd564b7
--- /dev/null
+++ b/src/modules/eina/mp/chained_pool/CMakeLists.txt
@@ -0,0 +1,5 @@
1if(ENABLE_VALGRIND)
2 list(APPEND PKG_CONFIG_REQUIRES_PRIVATE valgrind)
3endif()
4
5set(SOURCES eina_chained_mempool.c)
diff --git a/src/modules/eina/mp/one_big/CMakeLists.txt b/src/modules/eina/mp/one_big/CMakeLists.txt
new file mode 100644
index 0000000..49e758f
--- /dev/null
+++ b/src/modules/eina/mp/one_big/CMakeLists.txt
@@ -0,0 +1,5 @@
1if(ENABLE_VALGRIND)
2 list(APPEND PKG_CONFIG_REQUIRES_PRIVATE valgrind)
3endif()
4
5set(SOURCES eina_one_big.c)
diff --git a/src/modules/eina/mp/pass_through/CMakeLists.txt b/src/modules/eina/mp/pass_through/CMakeLists.txt
new file mode 100644
index 0000000..0ab1349
--- /dev/null
+++ b/src/modules/eina/mp/pass_through/CMakeLists.txt
@@ -0,0 +1,5 @@
1if(ENABLE_VALGRIND)
2 list(APPEND PKG_CONFIG_REQUIRES_PRIVATE valgrind)
3endif()
4
5set(SOURCES eina_pass_through.c)