summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-01-19 09:16:36 +0100
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-01-23 18:23:40 +0100
commit88283204c16c745e3aec11bff2409bd5cc903121 (patch)
tree0e9177d2dc85eb8ba5b75204a9569c75b219ba72
parentc1c30cc6ce435021084f30567fa6ec9cd939e0b5 (diff)
build: switch eina to half baked cmake
-rw-r--r--CMakeLists.txt19
-rw-r--r--config.h.cmake16
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/CMakeLists_Eina.txt11
-rw-r--r--src/lib/CMakeLists.txt1
-rw-r--r--src/lib/efl/CMakeLists-Config.txt9
-rw-r--r--src/lib/efl/CMakeLists.txt1
-rw-r--r--src/lib/efl/Efl_Config.h.cmake19
-rw-r--r--src/lib/eina/CMakeLists.txt214
-rw-r--r--src/lib/eina/eina_config.h.cmake145
-rw-r--r--src/modules/eina/CMakeLists.txt20
-rw-r--r--src/tests/eina/CMakeLists.txt69
12 files changed, 526 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000000..12dd0a87dd
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,19 @@
1cmake_minimum_required(VERSION 3.7)
2project(eflgeneric)
3
4ADD_DEFINITIONS("-DHAVE_CONFIG_H")
5
6add_subdirectory(src)
7
8CHECK_INCLUDE_FILE(sys/mman.h HAVE_SYS_MMAN_H)
9
10set(PROJECT_VERSION_MAJOR 1)
11set(PROJECT_VERSION_MINOR 19)
12set(PROJECT_VERSION_PATCH 99)
13set(PROJECT_VERSION_TWEAK 00)
14
15set(VMAJ ${PROJECT_VERSION_MAJOR})
16set(VMIN ${PROJECT_VERSION_MINOR})
17set(VMIC ${PROJECT_VERSION_PATCH})
18set(VREV ${PROJECT_VERSION_TWEAK})
19configure_file(config.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
diff --git a/config.h.cmake b/config.h.cmake
new file mode 100644
index 0000000000..ca8a2bd974
--- /dev/null
+++ b/config.h.cmake
@@ -0,0 +1,16 @@
1#ifndef CONFIG_H
2#define CONFIG_H
3
4#define _GNU_SOURCE
5#cmakedefine HAVE_SYS_MMAN_H 1
6
7#cmakedefine VMAJ @VMAJ@
8#cmakedefine VMIN @VMIN@
9#cmakedefine VMIC @VMIC@
10#cmakedefine VREV @VREV@
11
12#define PACKAGE_LIB_DIR "bla"
13#define MODULE_ARCH "bla"
14#define SHARED_LIB_SUFFIX "bla"
15
16#endif \ No newline at end of file
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000000..3125acd562
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,2 @@
1include(CMakeLists_Eina.txt)
2add_subdirectory(lib/efl/) \ No newline at end of file
diff --git a/src/CMakeLists_Eina.txt b/src/CMakeLists_Eina.txt
new file mode 100644
index 0000000000..f763d675b9
--- /dev/null
+++ b/src/CMakeLists_Eina.txt
@@ -0,0 +1,11 @@
1INCLUDE (FindPkgConfig)
2
3set(EINA_STATIC_BUILD_CHAINED_POOL 1)
4set(EINA_STATIC_BUILD_ONE_BIG 1)
5set(EINA_STATIC_BUILD_PASS_THROUGH 1)
6
7pkg_check_modules(VG REQUIRED valgrind)
8
9add_subdirectory(lib/eina)
10add_subdirectory(modules/eina)
11add_subdirectory(tests/eina) \ No newline at end of file
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
new file mode 100644
index 0000000000..288b6c7b1c
--- /dev/null
+++ b/src/lib/CMakeLists.txt
@@ -0,0 +1 @@
add_subdirectory(eina) \ No newline at end of file
diff --git a/src/lib/efl/CMakeLists-Config.txt b/src/lib/efl/CMakeLists-Config.txt
new file mode 100644
index 0000000000..5518815552
--- /dev/null
+++ b/src/lib/efl/CMakeLists-Config.txt
@@ -0,0 +1,9 @@
1#TODO ask for api mode
2set(EFL_NOLEGACY_API_SUPPORT 1)
3set(EFL_EO_API_SUPPORT 1)
4
5set(EFL_VERSION_MAJOR 1)
6set(EFL_VERSION_MINOR 19)
7set(EFL_BUILD_ID 120)
8
9configure_file(Efl_Config.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/Efl_Config.h) \ No newline at end of file
diff --git a/src/lib/efl/CMakeLists.txt b/src/lib/efl/CMakeLists.txt
new file mode 100644
index 0000000000..3dfdde666f
--- /dev/null
+++ b/src/lib/efl/CMakeLists.txt
@@ -0,0 +1 @@
include(CMakeLists-Config.txt) \ No newline at end of file
diff --git a/src/lib/efl/Efl_Config.h.cmake b/src/lib/efl/Efl_Config.h.cmake
new file mode 100644
index 0000000000..f068588125
--- /dev/null
+++ b/src/lib/efl/Efl_Config.h.cmake
@@ -0,0 +1,19 @@
1#ifndef EFL_CONFIG_H
2#define EFL_CONFIG_H
3
4/* Add -DEFL_API_OVERRIDE ot your CFLAGS to override the default
5 * installed api set and then fter that -DEFL_NOLEGACY_API_SUPPORT
6 * and/or -DEFL_EO_API_SUPPORT as desired
7 */
8#ifndef EFL_API_OVERRIDE
9#cmakedefine EFL_API_LEGACY_DEF
10#cmakedefine EFL_EO_API_SUPPORT
11/* You can't disable Eo API anymore as EFL use it everywhere internally
12 and we don't want to expose it publicly just yet, so keep it hidden
13 and require an explicit request to get it. */
14#endif
15
16#cmakedefine EFL_VERSION_MAJOR @EFL_VERSION_MAJOR@
17#cmakedefine EFL_VERSION_MINOR @EFL_VERSION_MINOR@
18#cmakedefine EFL_BUILD_ID "@EFL_BUILD_ID@"
19#endif
diff --git a/src/lib/eina/CMakeLists.txt b/src/lib/eina/CMakeLists.txt
new file mode 100644
index 0000000000..56b6f6733d
--- /dev/null
+++ b/src/lib/eina/CMakeLists.txt
@@ -0,0 +1,214 @@
1INCLUDE (CheckSymbolExists)
2INCLUDE (CheckIncludeFile)
3INCLUDE (CheckTypeSize)
4INCLUDE (FindPkgConfig)
5find_package(Threads REQUIRED)
6
7#Configure depending on the profile
8set(EINA_SAFETY_CHECKS 1)
9if ("${BUILD_PROFILE}" STREQUAL "dev")
10 set(EINA_STRINGSHARE_USAGE ON)
11 set(CHECK_VALGRIND ON)
12elseif ("${BUILD_PROFILE}" STREQUAL "debug")
13 set(EINA_DEBUG_MALLOC ON)
14 set(EINA_COW_MAGIC_ON ON)
15 set(EINA_DEFAULT_MEMPOOL ON)
16 set(EINA_DEBUG_MALLOC ON)
17 set(EINA_DEBUG_THREADS ON)
18 set(VALGRIND ON)
19elseif ("${BUILD_PROFILE}" STREQUAL "release")
20 set(EINA_LOG_LEVEL_MAXIMUM 3)
21endif ("${BUILD_PROFILE}" STREQUAL "dev")
22
23#options of that submodule
24option(EINA_MAGIC_DEBUG "magic debug of eina structure" ON)
25option(EINA_DEBUG_THREADS "debugging of eina threads" ${EINA_DEBUG_THREADS})
26option(VALGRIND "valgrind support" ${VALGRIND})
27
28#check for symbols in pthread
29#TODO Make the definitions depending on the platform
30set(CMAKE_REQUIRED_FLAGS "${CMAKE_THREAD_LIBS_INIT}")
31set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE=1")
32CHECK_SYMBOL_EXISTS(pthread_barrier_init pthread.h EINA_HAVE_PTHREAD_BARRIER)
33CHECK_SYMBOL_EXISTS(pthread_attr_setaffinity_np pthread.h EINA_HAVE_PTHREAD_AFFINITY)
34CHECK_SYMBOL_EXISTS(pthread_setname_np pthread.h EINA_HAVE_PTHREAD_SETNAME)
35CHECK_SYMBOL_EXISTS(pthread_spin_init pthread.h EINA_HAVE_POSIX_SPINLOCK)
36
37#check for eina header files that are required
38CHECK_INCLUDE_FILE(alloca.h EINA_HAVE_ALLOCA_H)
39CHECK_INCLUDE_FILE(byteswap.h EINA_HAVE_BYTESWAP_H)
40CHECK_INCLUDE_FILE(fnmatch.h EINA_HAVE_FNMATCH_H)
41#only enable log when fnmatch is there
42if (EINA_HAVE_FNMATCH_H)
43 set(EINA_ENABLE_LOG 1)
44endif (EINA_HAVE_FNMATCH_H)
45CHECK_INCLUDE_FILE(dirent.h EINA_HAVE_DIRENT_H)
46
47CHECK_TYPE_SIZE("wchar_t" EINA_SIZEOF_WCHAR_T)
48CHECK_TYPE_SIZE("uintptr_t" EINA_SIZEOF_UINTPTR_T)
49CHECK_TYPE_SIZE("wchar_t" EINA_SIZEOF_WCHAR_T)
50
51#check for swap16/32/64
52CHECK_SYMBOL_EXISTS(bswap_16 byteswap.h EINA_HAVE_BSWAP16)
53CHECK_SYMBOL_EXISTS(bswap_32 byteswap.h EINA_HAVE_BSWAP32)
54CHECK_SYMBOL_EXISTS(bswap_64 byteswap.h EINA_HAVE_BSWAP64)
55
56#TODO really check if we wanted to have valgrind support or not
57pkg_check_modules(VG REQUIRED valgrind)
58
59#Check if there is the alloca header
60
61configure_file(eina_config.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/eina_config.h)
62
63include_directories(
64 ${PROJECT_SOURCE_DIR}/
65 ${VG_INCLUDE_DIRS}
66 ${PROJECT_SOURCE_DIR}/src/lib/efl
67 ${PROJECT_SOURCE_DIR}/src/lib/eina
68)
69
70LIST(APPEND eina_source
71 Eina.h
72 eina_abi.c
73 eina_accessor.c
74 eina_accessor.h
75 eina_alloca.h
76 eina_array.c
77 eina_array.h
78 eina_benchmark.c
79 eina_benchmark.h
80 eina_bezier.c
81 eina_bezier.h
82 eina_binbuf.c
83 eina_binbuf.h
84 eina_binshare.c
85 eina_binshare.h
86 eina_clist.h
87 eina_config.h
88 eina_convert.c
89 eina_convert.h
90 eina_counter.c
91 eina_counter.h
92 eina_cow.c
93 eina_cow.h
94 eina_cpu.c
95 eina_cpu.h
96 eina_crc.c
97 eina_crc.h
98 eina_debug.c
99 eina_debug.h
100 eina_debug_bt.c
101 eina_debug_bt_file.c
102 eina_debug_chunk.c
103 eina_debug_monitor.c
104 eina_debug_proto.c
105 eina_debug_thread.c
106 eina_error.c
107 eina_error.h
108 eina_evlog.c
109 eina_evlog.h
110 eina_file.c
111 eina_file.h
112 eina_file_common.c
113 eina_file_common.h
114 eina_fp.c
115 eina_fp.h
116 eina_freeq.c
117 eina_freeq.h
118 eina_hamster.c
119 eina_hamster.h
120 eina_hash.c
121 eina_hash.h
122 eina_inarray.c
123 eina_inarray.h
124 eina_inline_private.h
125 eina_inlist.c
126 eina_inlist.h
127 eina_iterator.c
128 eina_iterator.h
129 eina_lalloc.c
130 eina_lalloc.h
131 eina_list.c
132 eina_list.h
133 eina_lock.c
134 eina_lock.h
135 eina_log.c
136 eina_log.h
137 eina_magic.c
138 eina_magic.h
139 eina_main.c
140 eina_main.h
141 eina_matrix.c
142 eina_matrix.h
143 eina_matrixsparse.c
144 eina_matrixsparse.h
145 eina_mempool.c
146 eina_mempool.h
147 eina_mmap.c
148 eina_mmap.h
149 eina_module.c
150 eina_module.h
151 eina_prefix.c
152 eina_prefix.h
153 eina_private.h
154 eina_quad.c
155 eina_quad.h
156 eina_quadtree.c
157 eina_quadtree.h
158 eina_quaternion.c
159 eina_quaternion.h
160 eina_rbtree.c
161 eina_rbtree.h
162 eina_rectangle.c
163 eina_rectangle.h
164 eina_refcount.h
165 eina_safepointer.c
166 eina_safepointer.h
167 eina_safety_checks.c
168 eina_safety_checks.h
169 eina_sched.c
170 eina_sched.h
171 eina_share_common.c
172 eina_share_common.h
173 eina_simple_xml_parser.c
174 eina_simple_xml_parser.h
175 eina_slice.h
176 eina_slstr.c
177 eina_slstr.h
178 eina_str.c
179 eina_str.h
180 eina_strbuf.c
181 eina_strbuf.h
182 eina_strbuf_common.c
183 eina_strbuf_common.h
184 eina_strbuf_template_c.x
185 eina_stringshare.c
186 eina_stringshare.h
187 eina_thread.c
188 eina_thread.h
189 eina_thread_queue.c
190 eina_thread_queue.h
191 eina_tiler.c
192 eina_tiler.h
193 eina_tmpstr.c
194 eina_tmpstr.h
195 eina_trash.h
196 eina_types.h
197 eina_unicode.c
198 eina_unicode.h
199 eina_ustrbuf.c
200 eina_ustrbuf.h
201 eina_ustringshare.c
202 eina_ustringshare.h
203 eina_util.c
204 eina_util.h
205 eina_value.c
206 eina_value.h
207 eina_value_util.c
208 eina_value_util.h
209 eina_vector.h
210 eina_xattr.c
211 eina_xattr.h
212)
213
214add_library(eina SHARED ${eina_source}) \ No newline at end of file
diff --git a/src/lib/eina/eina_config.h.cmake b/src/lib/eina/eina_config.h.cmake
new file mode 100644
index 0000000000..a4aac7d99f
--- /dev/null
+++ b/src/lib/eina/eina_config.h.cmake
@@ -0,0 +1,145 @@
1/* EINA - EFL data type library
2 * Copyright (C) 2008 Cedric Bail
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library;
16 * if not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef EINA_CONFIG_H_
20#define EINA_CONFIG_H_
21
22#ifdef HAVE_EXOTIC
23# include <Exotic.h>
24#endif
25
26#ifdef EINA_MAGIC_DEBUG
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
125#include <limits.h>
126
127#ifndef __WORDSIZE
128# if defined(__OPENBSD__) && (INTPTR_MAX == INT32_MAX)
129# define __WORDSIZE 32
130# else
131# define __WORDSIZE 64
132# endif
133#endif
134
135/* Do not turn the following #define as meaning EFL64. We are only
136 interested to know if sizeof (void*) == 64bits or not. Those means
137 something else.
138
139 defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) || defined(__amd64)
140 */
141#if defined(_WIN64) || defined(__LP64__) || defined(_LP64) || defined(__ppc64__)
142# define EFL64
143#endif
144
145#endif /* EINA_CONFIG_H_ */
diff --git a/src/modules/eina/CMakeLists.txt b/src/modules/eina/CMakeLists.txt
new file mode 100644
index 0000000000..493816291e
--- /dev/null
+++ b/src/modules/eina/CMakeLists.txt
@@ -0,0 +1,20 @@
1include_directories(
2${PROJECT_SOURCE_DIR}/
3${PROJECT_SOURCE_DIR}/src/lib/eina
4${PROJECT_SOURCE_DIR}/src/lib/efl
5${VG_INCLUDE_DIRS}
6)
7
8if (EINA_STATIC_BUILD_PASS_THROUGH)
9 add_library(pass_through MODULE "mp/pass_through/eina_pass_through.c")
10endif(EINA_STATIC_BUILD_PASS_THROUGH)
11
12
13if (EINA_STATIC_BUILD_ONE_BIG)
14 add_library(one_big MODULE mp/one_big/eina_one_big.c)
15endif(EINA_STATIC_BUILD_ONE_BIG)
16
17
18if (EINA_STATIC_BUILD_CHAINED_POOL)
19 add_library(chained_pool MODULE mp/chained_pool/eina_chained_mempool.c)
20endif(EINA_STATIC_BUILD_CHAINED_POOL) \ No newline at end of file
diff --git a/src/tests/eina/CMakeLists.txt b/src/tests/eina/CMakeLists.txt
new file mode 100644
index 0000000000..358f13ed83
--- /dev/null
+++ b/src/tests/eina/CMakeLists.txt
@@ -0,0 +1,69 @@
1include_directories(
2 ${PROJECT_SOURCE_DIR}/
3 ${PROJECT_SOURCE_DIR}/src/lib/eina/
4 ${PROJECT_SOURCE_DIR}/src/lib/efl/
5)
6
7add_definitions("-DTESTS_BUILD_DIR=\"1\"")
8add_definitions("-DPACKAGE_BUILD_DIR=\"1\"")
9
10list(APPEND eina_test_source
11 eina_suite.c
12 eina_suite.h
13 eina_test_abi.c
14 eina_test_accessor.c
15 eina_test_array.c
16 eina_test_barrier.c
17 eina_test_benchmark.c
18 eina_test_bezier.c
19 eina_test_binbuf.c
20 eina_test_binshare.c
21 eina_test_clist.c
22 eina_test_convert.c
23 eina_test_counter.c
24 eina_test_cow.c
25 eina_test_crc.c
26 eina_test_error.c
27 eina_test_file.c
28 eina_test_fp.c
29 eina_test_freeq.c
30 eina_test_hash.c
31 eina_test_inarray.c
32 eina_test_inlist.c
33 eina_test_iterator.c
34 eina_test_lalloc.c
35 eina_test_list.c
36 eina_test_lock.c
37 eina_test_log.c
38 eina_test_magic.c
39 eina_test_main.c
40 eina_test_matrix.c
41 eina_test_matrixsparse.c
42 eina_test_mempool.c
43 eina_test_module.c
44 eina_test_module_dummy.c
45 eina_test_quad.c
46 eina_test_quadtree.c
47 eina_test_quaternion.c
48 eina_test_rbtree.c
49 eina_test_rectangle.c
50 eina_test_safepointer.c
51 eina_test_sched.c
52 eina_test_simple_xml_parser.c
53 eina_test_slice.c
54 eina_test_slstr.c
55 eina_test_str.c
56 eina_test_strbuf.c
57 eina_test_stringshare.c
58 eina_test_tiler.c
59 eina_test_tmpstr.c
60 eina_test_trash.c
61 eina_test_ustr.c
62 eina_test_ustringshare.c
63 eina_test_util.c
64 eina_test_value.c
65 eina_test_vector.c
66 eina_test_xattr.c
67)
68
69add_executable(eina_suite "${eina_test_source}") \ No newline at end of file