Skip to content

Commit c866d1e

Browse files
author
Bogdan Degtyariov
committed
WL14878: Add bundled libraries in bin server directory.
1 parent 33f2a72 commit c866d1e

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

CMakeLists.txt

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -392,32 +392,46 @@ if(BUNDLE_DEPENDENCIES)
392392
#
393393

394394
file(GLOB _bundled1 "${MYSQL_LIB_DIR}/*${CMAKE_SHARED_LIBRARY_SUFFIX}*")
395-
file(GLOB _bundled2 "${MYSQL_LIB_DIR}/private/*${CMAKE_SHARED_LIBRARY_SUFFIX}*")
395+
396+
# In Windows we need to bundle libraries from bin directory instead
397+
# of private.
398+
399+
if(WIN32)
400+
set(_bundled2_path "${MYSQL_LIB_DIR}/../bin")
401+
set(_bundled_dest "bin")
402+
else()
403+
set(_bundled2_path "${MYSQL_LIB_DIR}/private")
404+
set(_bundled_dest "${INSTALL_LIB_DIR}/private")
405+
endif()
406+
407+
file(GLOB _bundled2 "${_bundled2_path}/*${CMAKE_SHARED_LIBRARY_SUFFIX}*")
396408

397409
foreach(lib IN LISTS _bundled1 _bundled2)
398410

399411
get_filename_component(lib_name ${lib} NAME_WE)
400412

401413
# ssl|crypto are bundled on cdk/cmake/DepFindSSL.cmake
402-
if(NOT lib_name MATCHES "mysql|libprotobuf|liblber|libldap_r|libssl|libcrypto")
403-
404-
message("found bundled libs: ${lib}")
414+
if(NOT lib_name MATCHES "mysql|libprotobuf|liblber|libldap_r|libssl|libcrypto|libcurl|libmecab")
415+
message("found bundled libs: ${lib}")
405416

406-
install(FILES "${lib}"
407-
DESTINATION "${INSTALL_LIB_DIR}/private"
408-
COMPONENT JDBCDll
409-
)
417+
install(FILES "${lib}"
418+
DESTINATION ${_bundled_dest}
419+
COMPONENT JDBCDll
420+
)
410421

411422
endif()
412423

413-
# Also bundle modules required by the SASL library if it is bundled
424+
if(NOT WIN32)
425+
# Also bundle modules required by the SASL library if it is bundled
414426

415-
if(lib_name MATCHES "libsasl")
427+
if(lib_name MATCHES "libsasl")
416428

417-
install(DIRECTORY "${MYSQL_LIB_DIR}/private/sasl2"
418-
DESTINATION "${INSTALL_LIB_DIR}/private"
419-
COMPONENT JDBCDll
420-
)
429+
install(DIRECTORY "${_bundled2_path}/sasl2"
430+
DESTINATION ${_bundled_dest}
431+
COMPONENT JDBCDll
432+
)
433+
434+
endif()
421435

422436
endif()
423437

0 commit comments

Comments
 (0)