Skip to content

Commit 967da78

Browse files
authored
AVRO-4167: [C++] Fix install locations (#3434)
Use standard CMake variables for the locations, which can vary depending on platform. (e.g. lib64 instead of lib) Use bin rather than lib directory for runtime, which is expected for Windows DLLs.
1 parent 30c31a5 commit 967da78

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

lang/c++/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ target_compile_definitions(avrocpp_s PRIVATE AVRO_SOURCE)
141141
set_target_properties (avrocpp PROPERTIES VERSION ${AVRO_VERSION})
142142
set_target_properties (avrocpp_s PROPERTIES VERSION ${AVRO_VERSION})
143143

144-
target_link_libraries(avrocpp PUBLIC
144+
target_link_libraries(avrocpp PUBLIC
145145
$<BUILD_INTERFACE:fmt::fmt-header-only>
146146
$<BUILD_INTERFACE:ZLIB::ZLIB>
147147
$<BUILD_INTERFACE:$<TARGET_NAME_IF_EXISTS:Snappy::snappy>>
@@ -258,13 +258,13 @@ include (CPack)
258258

259259
install (TARGETS avrocpp avrocpp_s
260260
EXPORT avrocpp_targets
261-
LIBRARY DESTINATION lib
262-
ARCHIVE DESTINATION lib
263-
RUNTIME DESTINATION lib
261+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
262+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
263+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
264264
INCLUDES DESTINATION include)
265265

266266
if (AVRO_BUILD_EXECUTABLES)
267-
install (TARGETS avrogencpp EXPORT avrocpp_targets RUNTIME DESTINATION bin)
267+
install (TARGETS avrogencpp EXPORT avrocpp_targets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
268268
endif ()
269269

270270
install (DIRECTORY include/avro DESTINATION include

0 commit comments

Comments
 (0)