blob: 5ad88370ec10901f320db252ba8b2d2f308f47a2 [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
set(AVRO_SRC
allocation.h
allocation.c
avro.h
avro/consumer.h
avro_errors.h
avro_private.h
consumer.c
datafile.c
datum.c
datum.h
datum_equal.c
datum_json.c
datum_read.c
datum_size.c
datum_skip.c
datum_validate.c
datum_write.c
dump.c
dump.h
encoding.h
encoding_binary.c
errors.c
io.c
resolver.c
schema.c
schema.h
schema_equal.c
st.c
st.h
)
set(JANSSON_SRC
../jansson/src/dump.c
../jansson/src/hashtable.c
../jansson/src/hashtable.h
../jansson/src/jansson.h
../jansson/src/jansson_private.h
../jansson/src/load.c
../jansson/src/strbuffer.c
../jansson/src/strbuffer.h
../jansson/src/utf.c
../jansson/src/utf.h
../jansson/src/util.h
../jansson/src/value.c
)
source_group(Avro FILES ${AVRO_SRC})
source_group(Jansson FILES ${JANSSON_SRC})
add_library(avro-static STATIC ${AVRO_SRC} ${JANSSON_SRC})
set_target_properties(avro-static PROPERTIES OUTPUT_NAME avro)
add_library(avro-shared SHARED ${AVRO_SRC} ${JANSSON_SRC})
set_target_properties(avro-shared PROPERTIES
OUTPUT_NAME avro
SOVERSION ${AVRO_VERSION})
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/avro.h
DESTINATION include)
install(FILES
${CMAKE_CURRENT_SOURCE_DIR}/avro/consumer.h
DESTINATION include/avro)
install(TARGETS avro-static avro-shared
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
# Install pkg-config file
set(prefix ${CMAKE_INSTALL_PREFIX})
set(VERSION ${AVRO_VERSION})
configure_file(avro-c.pc.in avro-c.pc)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/avro-c.pc
DESTINATION lib/pkgconfig)