forked from msgpack/msgpack-c
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_file_list.sh
More file actions
executable file
·48 lines (40 loc) · 1.48 KB
/
make_file_list.sh
File metadata and controls
executable file
·48 lines (40 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
c_headers=(
include/msgpack.h
include/msgpack/gcc_atomic.h
include/msgpack/pack.h
include/msgpack/pack_define.h
include/msgpack/pack_template.h
include/msgpack/sbuffer.h
include/msgpack/timestamp.h
include/msgpack/unpack.h
include/msgpack/unpack_template.h
include/msgpack/util.h
include/msgpack/version.h
include/msgpack/vrefbuffer.h
)
rm -f c_headers.tmp
for hdr in ${c_headers[@]}; do
echo $hdr >> c_headers.tmp
done
find src -name "*.c" | sed -e 's/\s\+/\n/g' | sort > srcs.tmp
find include -name "*.h" | grep -vFf c_headers.tmp | sed -e 's/\s\+/\n/g' | sort > c_cpp_headers.tmp
find include -name "*.hpp" | sed -e 's/\s\+/\n/g' | sort > cpp_headers.tmp
echo 'LIST (APPEND msgpackc_SOURCES' > Files.cmake
cat srcs.tmp | sed -e 's/^/ /g' >> Files.cmake
echo -e ')\n' >> Files.cmake
echo '# For both C and C++ libraries
LIST (APPEND msgpackc_HEADERS' >> Files.cmake
cat c_cpp_headers.tmp | sed -e 's/^/ /g' >> Files.cmake
echo -e ')\n' >> Files.cmake
echo 'IF (NOT MSGPACK_CXX_ONLY)
# Only for C library
LIST (APPEND msgpackc_HEADERS' >> Files.cmake
cat c_headers.tmp | sed -e 's/^/ /g' >> Files.cmake
echo -e ' )\nENDIF ()\n' >> Files.cmake
echo 'IF (MSGPACK_ENABLE_CXX)
# Only for C++ library
LIST (APPEND msgpackc_HEADERS' >> Files.cmake
cat cpp_headers.tmp | sed -e 's/^/ /g' >> Files.cmake
echo -e ' )\nENDIF ()' >> Files.cmake
rm -f srcs.tmp c_headers.tmp cpp_headers.tmp c_cpp_headers.tmp