|
| 1 | +# |
| 2 | +# Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | +# contributor license agreements. See the NOTICE file distributed with |
| 4 | +# this work for additional information regarding copyright ownership. |
| 5 | +# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | +# (the "License"); you may not use this file except in compliance with |
| 7 | +# the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | +# |
| 17 | + |
| 18 | +project(ignite-binary) |
| 19 | + |
| 20 | +include_directories(include) |
| 21 | + |
| 22 | +set(TARGET ${PROJECT_NAME}) |
| 23 | + |
| 24 | +set(SOURCES src/binary/binary_containers.cpp |
| 25 | + src/binary/binary_raw_writer.cpp |
| 26 | + src/binary/binary_writer.cpp |
| 27 | + src/binary/binary_reader.cpp |
| 28 | + src/binary/binary_type.cpp |
| 29 | + src/binary/binary_raw_reader.cpp |
| 30 | + src/impl/binary/binary_type_manager.cpp |
| 31 | + src/impl/binary/binary_type_impl.cpp |
| 32 | + src/impl/binary/binary_utils.cpp |
| 33 | + src/impl/binary/binary_reader_impl.cpp |
| 34 | + src/impl/binary/binary_type_handler.cpp |
| 35 | + src/impl/binary/binary_writer_impl.cpp |
| 36 | + src/impl/binary/binary_schema.cpp |
| 37 | + src/impl/binary/binary_type_snapshot.cpp |
| 38 | + src/impl/binary/binary_object_header.cpp |
| 39 | + src/impl/binary/binary_object_impl.cpp |
| 40 | + src/impl/binary/binary_field_meta.cpp |
| 41 | + src/impl/interop/interop_memory.cpp |
| 42 | + src/impl/interop/interop_output_stream.cpp |
| 43 | + src/impl/interop/interop_input_stream.cpp) |
| 44 | + |
| 45 | +list(APPEND _target_libs ${TARGET}) |
| 46 | + |
| 47 | +if (WIN32) |
| 48 | + add_library(${TARGET}-objlib OBJECT ${SOURCES}) |
| 49 | + |
| 50 | + add_library(${TARGET} SHARED $<TARGET_OBJECTS:${TARGET}-objlib>) |
| 51 | + |
| 52 | + list(APPEND _target_libs ${TARGET}-objlib) |
| 53 | +else() |
| 54 | + add_library(${TARGET} SHARED ${SOURCES}) |
| 55 | +endif() |
| 56 | + |
| 57 | +foreach(_target_lib IN LISTS _target_libs) |
| 58 | + set_target_properties(${_target_lib} PROPERTIES VERSION ${CMAKE_PROJECT_VERSION}) |
| 59 | + |
| 60 | + if (${_target_lib} STREQUAL ${TARGET}-objlib) |
| 61 | + set_target_properties(${_target_lib} PROPERTIES POSITION_INDEPENDENT_CODE 1) |
| 62 | + |
| 63 | + target_link_libraries(${_target_lib} ignite-common-objlib) |
| 64 | + else() |
| 65 | + target_link_libraries(${_target_lib} ignite-common) |
| 66 | + endif() |
| 67 | + |
| 68 | + target_include_directories(${_target_lib} INTERFACE include) |
| 69 | +endforeach() |
| 70 | +unset(_target_libs) |
| 71 | + |
| 72 | +install(TARGETS ${TARGET} LIBRARY DESTINATION lib) |
| 73 | +install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include FILES_MATCHING PATTERN "*.h*") |
0 commit comments