Skip to content

Commit

Permalink
Merge pull request #20 from F2I-Consulting/dev
Browse files Browse the repository at this point in the history
v0.2.0.0
  • Loading branch information
philippeVerney authored Feb 26, 2024
2 parents f67e350 + e7de2a4 commit 1cbf137
Show file tree
Hide file tree
Showing 37 changed files with 2,100 additions and 624 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
cd ${{ github.workspace }}/..
mkdir build
cd build
cmake -G"Visual Studio 16 2019" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DBoost_INCLUDE_DIR=${{ runner.temp }}\boost-install -DAVRO_INCLUDE_DIR=${{ runner.temp }}/avro-cpp-1.10.2-install/include -DAVRO_LIBRARY_RELEASE=${{ runner.temp }}/avro-cpp-1.10.2-install/lib/avrocpp_s.lib -DWITH_ETP_SSL=FALSE ${{ github.workspace }}
cmake -G"Visual Studio 16 2019" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DBoost_INCLUDE_DIR=${{ runner.temp }}\boost-install -DAVRO_ROOT=${{ runner.temp }}/avro-cpp-1.10.2-install -DWITH_ETP_SSL=FALSE ${{ github.workspace }}
cmake --build . --config Release -j2
windows-2019-with-fesapi:
runs-on: windows-2019
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
cmake --build . --config Release --target INSTALL
- name: FESAPI install
run: |
git clone --branch v2.6.0.0 --single-branch https://github.com/F2I-Consulting/fesapi.git ${{ runner.temp }}/fesapi-src
git clone --branch v2.8.0.0 --single-branch https://github.com/F2I-Consulting/fesapi.git ${{ runner.temp }}/fesapi-src
cd ${{ runner.temp }}
mkdir fesapi-build
cd fesapi-build
Expand All @@ -78,7 +78,7 @@ jobs:
cd ${{ github.workspace }}/..
mkdir build
cd build
cmake -G"Visual Studio 16 2019" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DBoost_INCLUDE_DIR=${{ runner.temp }}\boost-install -DAVRO_INCLUDE_DIR=${{ runner.temp }}/avro-cpp-1.10.2-install/include -DAVRO_LIBRARY_RELEASE=${{ runner.temp }}/avro-cpp-1.10.2-install/lib/avrocpp_s.lib -DWITH_FESAPI=TRUE -DFESAPI_INCLUDE_DIR=${{ runner.temp }}/fesapi-install/include -DFESAPI_LIBRARY_RELEASE=${{ runner.temp }}/fesapi-install/lib/FesapiCpp.2.6.0.0.lib -DWITH_ETP_SSL=FALSE ${{ github.workspace }}
cmake -G"Visual Studio 16 2019" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DBoost_INCLUDE_DIR=${{ runner.temp }}\boost-install -DAVRO_ROOT=${{ runner.temp }}/avro-cpp-1.10.2-install -DWITH_FESAPI=TRUE -DFESAPI_ROOT=${{ runner.temp }}/fesapi-install -DWITH_ETP_SSL=FALSE ${{ github.workspace }}
cmake --build . --config Release -j2
ubuntu-20:
runs-on: ubuntu-20.04
Expand All @@ -105,7 +105,7 @@ jobs:
cd ${{ github.workspace }}/..
mkdir build
cd build
cmake -DAVRO_INCLUDE_DIR=${{ runner.temp }}/avro-cpp-1.11.0-install/include -DAVRO_LIBRARY_RELEASE=${{ runner.temp }}/avro-cpp-1.11.0-install/lib/libavrocpp_s.a ${{ github.workspace }}
cmake -DAVRO_ROOT=${{ runner.temp }}/avro-cpp-1.11.0-install ${{ github.workspace }}
cmake --build . --config Release -j2
ubuntu-20-java8:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -136,7 +136,7 @@ jobs:
cd ${{ github.workspace }}/..
mkdir build
cd build
cmake -DAVRO_INCLUDE_DIR=${{ runner.temp }}/avro-cpp-1.11.0-install/include -DAVRO_LIBRARY_RELEASE=${{ runner.temp }}/avro-cpp-1.11.0-install/lib/libavrocpp_s.a -DWITH_JAVA_WRAPPING=TRUE ${{ github.workspace }}
cmake -DAVRO_ROOT=${{ runner.temp }}/avro-cpp-1.11.0-install -DWITH_JAVA_WRAPPING=TRUE ${{ github.workspace }}
cmake --build . --config Release -j2
ubuntu-20-java8-with-fesapi:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
sudo apt install -y ${{ matrix.xcc_pkg }} libhdf5-dev libminizip-dev libboost-all-dev
- name: FESAPI install
run: |
git clone --branch v2.6.0.0 --single-branch https://github.com/F2I-Consulting/fesapi.git ${{ runner.temp }}/fesapi-src
git clone --branch v2.8.0.0 --single-branch https://github.com/F2I-Consulting/fesapi.git ${{ runner.temp }}/fesapi-src
cd ${{ runner.temp }}
mkdir fesapi-build
cd fesapi-build
Expand All @@ -191,5 +191,5 @@ jobs:
cd ${{ github.workspace }}/..
mkdir build
cd build
cmake -DAVRO_INCLUDE_DIR=${{ runner.temp }}/avro-cpp-1.11.0-install/include -DAVRO_LIBRARY_RELEASE=${{ runner.temp }}/avro-cpp-1.11.0-install/lib/libavrocpp_s.a -DWITH_FESAPI=TRUE -DFESAPI_INCLUDE_DIR=${{ runner.temp }}/fesapi-install/include -DFESAPI_LIBRARY_RELEASE=${{ runner.temp }}/fesapi-install/lib/libFesapiCpp.so -DFESAPI_JAR=${{ runner.temp }}/fesapi-install/lib/fesapiJava-2.6.0.0.jar -DWITH_JAVA_WRAPPING=TRUE ${{ github.workspace }} -DCMAKE_C_COMPILER=${{ matrix.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx }}
cmake -DAVRO_ROOT=${{ runner.temp }}/avro-cpp-1.11.0-install -DWITH_FESAPI=TRUE -DFESAPI_ROOT=${{ runner.temp }}/fesapi-install -DFESAPI_JAR=${{ runner.temp }}/fesapi-install/lib/fesapiJava-2.8.0.0.jar -DWITH_JAVA_WRAPPING=TRUE ${{ github.workspace }} -DCMAKE_C_COMPILER=${{ matrix.cc }} -DCMAKE_CXX_COMPILER=${{ matrix.cxx }}
cmake --build . --config Release -j2
100 changes: 38 additions & 62 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.12)

project(Fetpapi)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules)

set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "DEBUG_POSTFIX property is initialized when the target is created to the value of this variable except for executable targets")

# Allow to have all executables generated in the same binary directory. Otherwise there would be in a directory different for each add_subdirectory cmake commande.
set (FETPAPI_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})

# version mechanism
set (Fetpapi_VERSION_MAJOR 0)
set (Fetpapi_VERSION_MINOR 1)
set (Fetpapi_VERSION_MINOR 2)
set (Fetpapi_VERSION_PATCH 0)
set (Fetpapi_VERSION_TWEAK 0)

set (Fetpapi_VERSION ${Fetpapi_VERSION_MAJOR}.${Fetpapi_VERSION_MINOR}.${Fetpapi_VERSION_PATCH}.${Fetpapi_VERSION_TWEAK})

if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/install CACHE PATH "${PROJECT_NAME} install prefix" FORCE)
endif (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)

IF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set (CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/install CACHE PATH "${PROJECT_NAME} install prefix" FORCE)
ENDIF (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

# required to define CMAKE_INSTALL_BINDIR, CMAKE_INSTALL_LIBDIR and CMAKE_INSTALL_INCLUDEDIR
include(GNUInstallDirs)

Expand Down Expand Up @@ -83,42 +86,30 @@ endif (WIN32)
# some useful variables
# ============================================================================

set (WITH_FESAPI OFF CACHE BOOL "Build Fetpapi with Fesapi support.")
set (WITH_ETP_SSL ON CACHE BOOL "Build Fesapi with ETP SSL support.")
set (WITH_FESAPI OFF CACHE BOOL "Build FETPAPI with FESAPI support.")
set (WITH_ETP_SSL ON CACHE BOOL "Build FETPAPI with ETP SSL support.")

# ============================================================================
# checking for required dependencies
# ============================================================================

find_package (Threads)

# avro DEPENDENCY
set (AVRO_INCLUDE_DIR AVRO_INCLUDE_DIR-NOTFOUND CACHE PATH "Path to the directory which contains the avro header files")
if (NOT IS_DIRECTORY ${AVRO_INCLUDE_DIR})
message(SEND_ERROR "The Avro include dir (AVRO_INCLUDE_DIR variable) does not look to be a valid directory. Please modify it.")
endif ()
set (AVRO_LIBRARY_RELEASE AVRO_LIBRARY_RELEASE-NOTFOUND CACHE FILEPATH "Path to the file which contains the avro library release")
if (NOT EXISTS ${AVRO_LIBRARY_RELEASE})
message(WARNING "The avro library (AVRO_LIBRARY_RELEASE variable) does not look to be a valid file. Please modify it.")
endif ()
set (AVRO_LIBRARY_DEBUG AVRO_LIBRARY_DEBUG-NOTFOUND CACHE FILEPATH "Path to the file which contains the AVRO library DEBUG")
if (NOT EXISTS ${AVRO_LIBRARY_DEBUG})
message(WARNING "The AVRO library (AVRO_LIBRARY_DEBUG variable) does not look to be a valid file. Please modify it.")
# Boost DEPENDENCY
find_package(Boost 1.70)
if (NOT Boost_FOUND)
# Boost system is required for Beast untill version 1.70 : https://www.boost.org/doc/libs/1_69_0/libs/beast/doc/html/beast/introduction.html
find_package(Boost 1.66 REQUIRED system)
endif()
if (WIN32 AND (Boost_VERSION_MAJOR EQUAL 1) AND (Boost_VERSION_MINOR LESS 74) AND (Boost_VERSION_MINOR GREATER 71))
message(WARNING "You may experience min/max issue with this boost version : See https://github.com/boostorg/beast/issues/1980")
endif ()

# avro DEPENDENCY
find_package(AVRO REQUIRED)

if (WITH_FESAPI)
set (FESAPI_INCLUDE_DIR FESAPI_INCLUDE_DIR-NOTFOUND CACHE PATH "Path to the directory which contains the FESAPI header files")
if (NOT IS_DIRECTORY ${FESAPI_INCLUDE_DIR})
message(SEND_ERROR "The FESAPI include dir (FESAPI_INCLUDE_DIR variable) does not look to be a valid directory. Please modify it.")
endif ()
set (FESAPI_LIBRARY_RELEASE FESAPI_LIBRARY_RELEASE-NOTFOUND CACHE FILEPATH "Path to the file which contains the FESAPI library release")
if (NOT EXISTS ${FESAPI_LIBRARY_RELEASE})
message(WARNING "The FESAPI library (FESAPI_LIBRARY_RELEASE variable) does not look to be a valid file. Please modify it.")
endif ()
set (FESAPI_LIBRARY_DEBUG FESAPI_LIBRARY_DEBUG-NOTFOUND CACHE FILEPATH "Path to the file which contains the FESAPI library DEBUG")
if (NOT EXISTS ${FESAPI_LIBRARY_DEBUG})
message(WARNING "The FESAPI library (FESAPI_LIBRARY_DEBUG variable) does not look to be a valid file. Please modify it.")
endif ()
find_package(FESAPI REQUIRED)
if (WITH_JAVA_WRAPPING)
set (FESAPI_JAR FESAPI_JAR-NOTFOUND CACHE FILEPATH "Path to the jar of FESAPI")
if (NOT EXISTS ${FESAPI_JAR})
Expand All @@ -127,27 +118,14 @@ if (WITH_FESAPI)
endif (WITH_JAVA_WRAPPING)
endif (WITH_FESAPI)


# Boost DEPENDENCY
find_package(Boost 1.66.0 REQUIRED system)
if (WIN32 AND (Boost_VERSION_MAJOR EQUAL 1) AND (Boost_VERSION_MINOR LESS 74) AND (Boost_VERSION_MINOR GREATER 71))
message(WARNING "You may experience min/max issue with this boost version : See https://github.com/boostorg/beast/issues/1980")
endif ()

target_compile_definitions(${PROJECT_NAME} PRIVATE BOOST_ALL_NO_LIB)

target_link_libraries (${PROJECT_NAME} PRIVATE ${Boost_SYSTEM_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries (${PROJECT_NAME} PRIVATE AVRO::AVRO ${CMAKE_THREAD_LIBS_INIT})
if (DEFINED Boost_SYSTEM_LIBRARY)
target_link_libraries (${PROJECT_NAME} PRIVATE ${Boost_SYSTEM_LIBRARY})
endif()
if (WIN32)
target_link_libraries (${PROJECT_NAME} PRIVATE bcrypt.lib)

if (EXISTS ${AVRO_LIBRARY_RELEASE} AND EXISTS ${AVRO_LIBRARY_DEBUG})
target_link_libraries (${PROJECT_NAME} PRIVATE optimized ${AVRO_LIBRARY_RELEASE} debug ${AVRO_LIBRARY_DEBUG})
elseif (EXISTS ${AVRO_LIBRARY_RELEASE})
target_link_libraries (${PROJECT_NAME} PRIVATE ${AVRO_LIBRARY_RELEASE})
elseif (EXISTS ${AVRO_LIBRARY_DEBUG})
target_link_libraries (${PROJECT_NAME} PRIVATE ${AVRO_LIBRARY_DEBUG})
endif ()

set_target_properties(${PROJECT_NAME} PROPERTIES
PDB_NAME ${PROJECT_NAME}.${Fetpapi_VERSION}
PDB_NAME_DEBUG ${PROJECT_NAME}${CMAKE_DEBUG_POSTFIX}.${Fetpapi_VERSION}
Expand All @@ -158,8 +136,6 @@ if (WIN32)
VERSION ${Fetpapi_VERSION_MAJOR}.${Fetpapi_VERSION_MINOR}
)
else (WIN32)
target_link_libraries (${PROJECT_NAME} PRIVATE ${AVRO_LIBRARY_RELEASE})

set_target_properties(${PROJECT_NAME} PROPERTIES
VERSION ${Fetpapi_VERSION}
SOVERSION ${Fetpapi_VERSION_MAJOR}.${Fetpapi_VERSION_MINOR})
Expand All @@ -174,17 +150,7 @@ if (WITH_ETP_SSL)
endif ()

if (WITH_FESAPI)
if (WIN32)
if (EXISTS ${FESAPI_LIBRARY_RELEASE} AND EXISTS ${FESAPI_LIBRARY_DEBUG})
target_link_libraries (${PROJECT_NAME} PRIVATE optimized ${FESAPI_LIBRARY_RELEASE} debug ${FESAPI_LIBRARY_DEBUG})
elseif (EXISTS ${FESAPI_LIBRARY_RELEASE})
target_link_libraries (${PROJECT_NAME} PRIVATE ${FESAPI_LIBRARY_RELEASE})
elseif (EXISTS ${FESAPI_LIBRARY_DEBUG})
target_link_libraries (${PROJECT_NAME} PRIVATE ${FESAPI_LIBRARY_DEBUG})
endif ()
else (WIN32)
target_link_libraries (${PROJECT_NAME} PRIVATE ${FESAPI_LIBRARY_RELEASE})
endif (WIN32)
target_link_libraries(${PROJECT_NAME} PRIVATE FESAPI::FESAPI)
endif (WITH_FESAPI)

# Namespaces definitions
Expand Down Expand Up @@ -292,6 +258,16 @@ if (WITH_FESAPI)
endif (WITH_TEST)
endif (WITH_FESAPI)

set (WITH_EXAMPLE OFF CACHE BOOL "Also builds and installs an ETP1.2 client example.")
if (WITH_EXAMPLE)
if (WITH_FESAPI)
add_subdirectory(example/withFesapi)
else ()
add_subdirectory(example/withoutFesapi)
endif (WITH_FESAPI)
endif (WITH_EXAMPLE)


# ============================================================================
# Install Fetpapi library
# ============================================================================
Expand Down
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- dependencies
- The following compilers are known to work (used in CI)
- gcc from version 4.8
- visual studio from version 2017
- visual studio from version 2019
# Prepare the dependencies
Download (build and install if necessary) third party libraries:
- BOOST : All versions from version 1.66 should be ok but you may experience some [min/max build issues](https://github.com/boostorg/beast/issues/1980) using version 1.72 or 1.73.
Expand All @@ -27,10 +27,8 @@ FETPAPI uses cmake as its build tool. A 3.12 version or later of cmake is requir
- give real path and files to the following cmake variables:
- BOOST
- Boost_INCLUDE_DIR : the directory where you can find the directory named "boost" which contain all BOOST headers
- AVRO
- AVRO_INCLUDE_DIR : where the "avro" directory containing all AVRO headers is located
- (ONLY FOR WINDOWS) AVRO_LIBRARY_DEBUG : Optional, only used by Visual studio Debug configuration, the Avro debug library you want to link to.
- AVRO_LIBRARY_RELEASE : the AVRO system library you want to link to.
- AVRO (using [our own cmake find module](./cmake/modules/FindAVRO.cmake))
- (ONLY IF NOT AUTOMATICALLY FOUND) AVRO_ROOT : The path to the folder containing include and lib folders of AVRO
- Click again on "Configure" button. You should no more have errors so you can now click on "Generate" button.
- You can now build your solution with your favorite compiler (and linker) using the generated solution in yourPath/fesapiEnv/build/theNameYouWant
- OPTIONALLY, you can also set the variables WITH_DOTNET_WRAPPING, WITH_PYTHON_WRAPPING to true if you want to also generate wrappers on top of FETPAPI for these two other programming languages. Don't forget to click again on "Configure" button once you changed the value of these two variables.
Expand All @@ -40,10 +38,8 @@ FETPAPI uses cmake as its build tool. A 3.12 version or later of cmake is requir
- OPENSSL_INCLUDE_DIR : the OpenSSL include directory
- LIB_EAY_RELEASE : the OpenSSL crypto library you want to link with.
- SSL_EAY_RELEASE : the OpenSSL ssl library you want to link with.
- OPTIONALLY, for FESAPI (v2.7.0.0 as a minimal version) support (see [here](https://github.com/F2I-Consulting/fesapi) for documentation on how to build fesapi), please enable the WITH_FESAPI variable and set the following variables :
- FESAPI_INCLUDE_DIR : the directory where the FESAPI headers are located (generally the include subdirectory of the fesapi installation directory).
- (ONLY FOR WINDOWS) FESAPI_LIBRARY_DEBUG : Optional, only used by Visual studio Debug configuration, the FESAPI debug library you want to link to.
- FESAPI_LIBRARY_RELEASE : the FESAPI library you want to link to.
- OPTIONALLY, for FESAPI (v2.7.0.0 as a minimal version) support (see [here](https://github.com/F2I-Consulting/fesapi) for documentation on how to build fesapi), please enable the WITH_FESAPI variable and usually set the following variable :
- FESAPI_ROOT : The path to the folder containing include and lib folders of FESAPI (using [our own cmake find module](./cmake/modules/FindFESAPI.cmake))

Remark : you can choose where FETPAPI will be installed (using "make install" on Linux or by generating the "INSTALL" project on Visual Studio) by setting the cmake variable called CMAKE_INSTALL_PREFIX
# How to start
Expand Down
108 changes: 108 additions & 0 deletions cmake/modules/FindAVRO.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

#[=======================================================================[.rst:
AVRO
--------

Find the native AVRO includes and library.
Heavily inspired by the official FindZLIB cmake module v3.27.

IMPORTED Targets
^^^^^^^^^^^^^^^^

This module defines :prop_tgt:`IMPORTED` target ``AVRO::AVRO``, if
AVRO has been found.

Result Variables
^^^^^^^^^^^^^^^^

This module defines the following variables:

::

AVRO_INCLUDE_DIRS - where to find zip.h, unzip.h, etc.
AVRO_LIBRARIES - List of libraries when using avro.
AVRO_FOUND - True if avro found.

Hints
^^^^^

A user may set ``AVRO_ROOT`` to a avro installation root to tell this
module where to look.
#]=======================================================================]
include(SelectLibraryConfigurations)

set(_AVRO_SEARCHES)

# Search AVRO_ROOT first if it is set.
if(AVRO_ROOT)
set(_AVRO_SEARCH_ROOT PATHS ${AVRO_ROOT} NO_DEFAULT_PATH)
list(APPEND _AVRO_SEARCHES _AVRO_SEARCH_ROOT)
endif()

# Normal search.
set(_AVRO_x86 "(x86)")
set(_AVRO_SEARCH_NORMAL
PATHS "$ENV{ProgramFiles}/avro"
"$ENV{ProgramFiles${_AVRO_x86}}/avro")
unset(_AVRO_x86)
list(APPEND _AVRO_SEARCHES _AVRO_SEARCH_NORMAL)

set(AVRO_NAMES avrocpp avrocpp_s)
set(AVRO_NAMES_DEBUG avrod avrocpp_d avrocpp_s_d)

# Try each search configuration.
foreach(search ${_AVRO_SEARCHES})
find_path(AVRO_INCLUDE_DIR NAMES avro/AvroParse.hh ${${search}} PATH_SUFFIXES include)
endforeach()

# Allow AVRO_LIBRARY to be set manually, as the location of the zlib library
if(NOT AVRO_LIBRARY)
foreach(search ${_AVRO_SEARCHES})
find_library(AVRO_LIBRARY_RELEASE NAMES ${AVRO_NAMES} NAMES_PER_DIR ${${search}} PATH_SUFFIXES lib)
find_library(AVRO_LIBRARY_DEBUG NAMES ${AVRO_NAMES_DEBUG} NAMES_PER_DIR ${${search}} PATH_SUFFIXES lib)
endforeach()

select_library_configurations(AVRO)
endif()

unset(AVRO_NAMES)
unset(AVRO_NAMES_DEBUG)

mark_as_advanced(AVRO_INCLUDE_DIR)

FIND_PACKAGE_HANDLE_STANDARD_ARGS(AVRO REQUIRED_VARS AVRO_LIBRARY AVRO_INCLUDE_DIR)

if(AVRO_FOUND)
set(AVRO_INCLUDE_DIRS ${AVRO_INCLUDE_DIR})

if(NOT AVRO_LIBRARIES)
set(AVRO_LIBRARIES ${AVRO_LIBRARY})
endif()

if(NOT TARGET AVRO::AVRO)
add_library(AVRO::AVRO UNKNOWN IMPORTED)
set_target_properties(AVRO::AVRO PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${AVRO_INCLUDE_DIRS}")

if(AVRO_LIBRARY_RELEASE)
set_property(TARGET AVRO::AVRO APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(AVRO::AVRO PROPERTIES
IMPORTED_LOCATION_RELEASE "${AVRO_LIBRARY_RELEASE}")
endif()

if(AVRO_LIBRARY_DEBUG)
set_property(TARGET AVRO::AVRO APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(AVRO::AVRO PROPERTIES
IMPORTED_LOCATION_DEBUG "${AVRO_LIBRARY_DEBUG}")
endif()

if(NOT AVRO_LIBRARY_RELEASE AND NOT AVRO_LIBRARY_DEBUG)
set_property(TARGET AVRO::AVRO APPEND PROPERTY
IMPORTED_LOCATION "${AVRO_LIBRARY}")
endif()
endif()
endif()
Loading

0 comments on commit 1cbf137

Please sign in to comment.