~stub/ubuntu/trusty/avro-c/trunk

« back to all changes in this revision

Viewing changes to src/CMakeLists.txt

  • Committer: Stuart Bishop
  • Date: 2015-05-14 11:53:53 UTC
  • Revision ID: stuart@stuartbishop.net-20150514115353-0cvnrcyohcq5l7yj
Tags: upstream-1.7.7
ImportĀ upstreamĀ versionĀ 1.7.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Licensed to the Apache Software Foundation (ASF) under one
 
3
# or more contributor license agreements.  See the NOTICE file
 
4
# distributed with this work for additional information
 
5
# regarding copyright ownership.  The ASF licenses this file
 
6
# to you under the Apache License, Version 2.0 (the
 
7
# "License"); you may not use this file except in compliance
 
8
# with the License.  You may obtain a copy of the License at
 
9
#
 
10
#   http://www.apache.org/licenses/LICENSE-2.0
 
11
#
 
12
# Unless required by applicable law or agreed to in writing,
 
13
# software distributed under the License is distributed on an
 
14
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 
15
# KIND, either express or implied.  See the License for the
 
16
# specific language governing permissions and limitations
 
17
# under the License.
 
18
#
 
19
 
 
20
set(AVRO_SRC
 
21
    allocation.c
 
22
    array.c
 
23
    avro.h
 
24
    avro/allocation.h
 
25
    avro/basics.h
 
26
    avro/consumer.h
 
27
    avro/data.h
 
28
    avro/errors.h
 
29
    avro/generic.h
 
30
    avro/io.h
 
31
    avro/legacy.h
 
32
    avro/refcount.h
 
33
    avro/resolver.h
 
34
    avro/schema.h
 
35
    avro/value.h
 
36
    avro_generic_internal.h
 
37
    avro_private.h
 
38
    codec.c
 
39
    codec.h
 
40
    consumer.c
 
41
    consume-binary.c
 
42
    datafile.c
 
43
    datum.c
 
44
    datum.h
 
45
    datum_equal.c
 
46
    datum_read.c
 
47
    datum_size.c
 
48
    datum_skip.c
 
49
    datum_validate.c
 
50
    datum_value.c
 
51
    datum_write.c
 
52
    dump.c
 
53
    dump.h
 
54
    encoding.h
 
55
    encoding_binary.c
 
56
    errors.c
 
57
    generic.c
 
58
    io.c
 
59
    map.c
 
60
    memoize.c
 
61
    resolved-reader.c
 
62
    resolved-writer.c
 
63
    resolver.c
 
64
    schema.c
 
65
    schema.h
 
66
    schema_equal.c
 
67
    st.c
 
68
    st.h
 
69
    string.c
 
70
    value.c
 
71
    value-hash.c
 
72
    value-json.c
 
73
    value-read.c
 
74
    value-sizeof.c
 
75
    value-write.c
 
76
    wrapped-buffer.c
 
77
)
 
78
 
 
79
set(JANSSON_SRC
 
80
    ../jansson/src/dump.c
 
81
    ../jansson/src/error.c
 
82
    ../jansson/src/hashtable.c
 
83
    ../jansson/src/hashtable.h
 
84
    ../jansson/src/jansson.h
 
85
    ../jansson/src/jansson_private.h
 
86
    ../jansson/src/load.c
 
87
    ../jansson/src/memory.c
 
88
    ../jansson/src/pack_unpack.c
 
89
    ../jansson/src/strbuffer.c
 
90
    ../jansson/src/strbuffer.h
 
91
    ../jansson/src/utf.c
 
92
    ../jansson/src/utf.h
 
93
    ../jansson/src/value.c
 
94
)
 
95
 
 
96
source_group(Avro FILES ${AVRO_SRC})
 
97
source_group(Jansson FILES ${JANSSON_SRC})
 
98
 
 
99
# The version.sh script gives us a SOVERSION that uses colon as a
 
100
# separator; we need periods.
 
101
 
 
102
string(REPLACE ":" "." LIBAVRO_DOT_VERSION ${LIBAVRO_VERSION})
 
103
 
 
104
add_library(avro-static STATIC ${AVRO_SRC} ${JANSSON_SRC})
 
105
target_link_libraries(avro-static ${CODEC_LIBRARIES} ${THREADS_LIBRARIES})
 
106
set_target_properties(avro-static PROPERTIES OUTPUT_NAME avro)
 
107
 
 
108
if (NOT WIN32)
 
109
# TODO: Create Windows DLLs. See http://www.cmake.org/Wiki/BuildingWinDLL
 
110
add_library(avro-shared SHARED ${AVRO_SRC} ${JANSSON_SRC})
 
111
target_link_libraries(avro-shared ${CODEC_LIBRARIES} ${THREADS_LIBRARIES})
 
112
set_target_properties(avro-shared PROPERTIES
 
113
        OUTPUT_NAME avro
 
114
        SOVERSION ${LIBAVRO_DOT_VERSION})
 
115
endif(NOT WIN32)
 
116
 
 
117
install(FILES
 
118
        ${CMAKE_CURRENT_SOURCE_DIR}/avro.h
 
119
        DESTINATION include)
 
120
install(DIRECTORY
 
121
        ${CMAKE_CURRENT_SOURCE_DIR}/avro
 
122
        DESTINATION include
 
123
        FILES_MATCHING PATTERN "*.h")
 
124
 
 
125
if (WIN32)
 
126
install(TARGETS avro-static
 
127
        RUNTIME DESTINATION bin
 
128
        LIBRARY DESTINATION lib
 
129
        ARCHIVE DESTINATION lib
 
130
       )
 
131
else(WIN32)
 
132
install(TARGETS avro-static avro-shared
 
133
        RUNTIME DESTINATION bin
 
134
        LIBRARY DESTINATION lib
 
135
        ARCHIVE DESTINATION lib
 
136
       )
 
137
endif(WIN32)
 
138
 
 
139
# Install pkg-config file
 
140
 
 
141
set(prefix ${CMAKE_INSTALL_PREFIX})
 
142
set(VERSION ${AVRO_VERSION})
 
143
configure_file(avro-c.pc.in avro-c.pc)
 
144
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/avro-c.pc
 
145
        DESTINATION lib/pkgconfig)
 
146
 
 
147
add_executable(avrocat avrocat.c)
 
148
target_link_libraries(avrocat avro-static)
 
149
install(TARGETS avrocat RUNTIME DESTINATION bin)
 
150
 
 
151
add_executable(avroappend avroappend.c)
 
152
target_link_libraries(avroappend avro-static)
 
153
install(TARGETS avroappend RUNTIME DESTINATION bin)
 
154
 
 
155
if (NOT WIN32)
 
156
#TODO: Port getopt() to Windows to compile avropipe.c and avromod.c
 
157
add_executable(avropipe avropipe.c)
 
158
target_link_libraries(avropipe avro-static)
 
159
install(TARGETS avropipe RUNTIME DESTINATION bin)
 
160
 
 
161
add_executable(avromod avromod.c)
 
162
target_link_libraries(avromod avro-static)
 
163
install(TARGETS avromod RUNTIME DESTINATION bin)
 
164
endif(NOT WIN32)