@@ -101,7 +101,7 @@ if(ENABLE_DEV_FTDI)
101
101
# Pass LibUSB include directory and library location to LibFTDI
102
102
get_build_interface_include_directory(TARGET usb-1.0 OUTPUT LIBUSB_INCLUDE_DIR)
103
103
set (LIBUSB_INCLUDE_DIR ${LIBUSB_INCLUDE_DIR} CACHE INTERNAL "" )
104
- get_target_property (LIBUSB_LIBRARIES usb-1.0 IMPORTED_LOCATION )
104
+ getTargetImportedLocation (LIBUSB_LIBRARIES usb-1.0)
105
105
set (LIBUSB_LIBRARIES ${LIBUSB_LIBRARIES} CACHE INTERNAL "" )
106
106
107
107
find_package (Git REQUIRED)
@@ -273,7 +273,7 @@ if(ENABLE_FLATBUF_SERVER OR ENABLE_FLATBUF_CONNECT)
273
273
)
274
274
elseif (TARGET flatbuffers::flatc)
275
275
add_executable (flatc IMPORTED GLOBAL )
276
- get_target_property (FLATC_EXECUTABLE flatbuffers::flatc IMPORTED_LOCATION_RELEASE )
276
+ getTargetImportedLocation (FLATC_EXECUTABLE flatbuffers::flatc)
277
277
set_target_properties (flatc PROPERTIES IMPORTED_LOCATION ${FLATC_EXECUTABLE} )
278
278
endif ()
279
279
endif ()
@@ -332,19 +332,24 @@ if(ENABLE_FLATBUF_SERVER OR ENABLE_FLATBUF_CONNECT)
332
332
endif ()
333
333
endif ()
334
334
335
- if (TARGET flatbuffers::flatbuffers OR TARGET FlatBuffers::FlatBuffers)
335
+ if (TARGET flatbuffers::flatbuffers OR TARGET flatbuffers::flatbuffers_shared OR TARGET FlatBuffers::FlatBuffers)
336
336
if (NOT TARGET FlatBuffers)
337
337
add_library (FlatBuffers INTERFACE IMPORTED GLOBAL )
338
338
if (TARGET flatbuffers::flatbuffers)
339
339
target_link_libraries (FlatBuffers INTERFACE flatbuffers::flatbuffers)
340
340
get_build_interface_include_directory(TARGET flatbuffers::flatbuffers OUTPUT FLATBUFFERS_INCLUDE_DIR)
341
+ elseif (TARGET flatbuffers::flatbuffers_shared)
342
+ target_link_libraries (FlatBuffers INTERFACE flatbuffers::flatbuffers_shared)
343
+ get_build_interface_include_directory(TARGET flatbuffers::flatbuffers_shared OUTPUT FLATBUFFERS_INCLUDE_DIR)
341
344
else ()
342
345
target_link_libraries (FlatBuffers INTERFACE FlatBuffers::FlatBuffers)
343
346
get_build_interface_include_directory(TARGET FlatBuffers::FlatBuffers OUTPUT FLATBUFFERS_INCLUDE_DIR)
344
347
endif ()
348
+ else ()
349
+ get_build_interface_include_directory(TARGET FlatBuffers OUTPUT FLATBUFFERS_INCLUDE_DIR)
345
350
endif ()
346
351
347
- # static flatbuffers version detection from: https://github.com/hyperledger-archives/iroha-ametsuchi/blob/master/cmake/Modules/Findflatbuffers.cmake
352
+ # flatbuffers version detection from: https://github.com/hyperledger-archives/iroha-ametsuchi/blob/master/cmake/Modules/Findflatbuffers.cmake
348
353
if (FLATBUFFERS_INCLUDE_DIR AND EXISTS "${FLATBUFFERS_INCLUDE_DIR} /flatbuffers/base.h" )
349
354
file (STRINGS "${FLATBUFFERS_INCLUDE_DIR} /flatbuffers/base.h" flatbuffers_version_str REGEX "#define FLATBUFFERS_VERSION_[A-Z]+ " )
350
355
string (REGEX REPLACE ".*#define FLATBUFFERS_VERSION_MAJOR ([0-9]+).*" "\\ 1" flatbuffers_MAJOR_VERSION "${flatbuffers_version_str} " )
@@ -405,7 +410,7 @@ if(ENABLE_PROTOBUF_SERVER)
405
410
)
406
411
elseif (TARGET protobuf::protoc)
407
412
add_executable (protoc IMPORTED GLOBAL )
408
- get_target_property (PROTOC_EXECUTABLE protobuf::protoc IMPORTED_LOCATION_RELEASE )
413
+ getTargetImportedLocation (PROTOC_EXECUTABLE protobuf::protoc)
409
414
set_target_properties (protoc PROPERTIES IMPORTED_LOCATION ${PROTOC_EXECUTABLE} )
410
415
endif ()
411
416
endif ()
0 commit comments