mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
MDEV-21303 Make executables MariaDB named
To change all executables to have a mariadb name I had to: - Do name changes in every CMakeLists.txt that produces executables - CREATE_MARIADB_SYMLINK was removed and GET_SYMLINK added by Wlad to reuse the function in other places also - The scripts/CMakeLists.txt could make use of GET_SYMLINK instead of introducing redundant code, but I thought I'll leave that for next release - A lot of changes to debian/.install and debian/.links files due to swapping of real executable and symlink. I did not however change the name of the manpages, so the real name is still mysql there and mariadb are symlinks. - The Windows part needed a change now when we made the executables mariadb -named. MSI (and ZIP) do not support symlinks and to not break backward compatibility we had to include mysql named binaries also. Done by Wlad
This commit is contained in:
committed by
Sergei Golubchik
parent
6fb59d525b
commit
9e1b3af4a4
@@ -1,5 +1,5 @@
|
||||
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
@@ -36,7 +36,7 @@ FUNCTION (MYSQL_ADD_EXECUTABLE)
|
||||
)
|
||||
LIST(GET ARG_UNPARSED_ARGUMENTS 0 target)
|
||||
LIST(REMOVE_AT ARG_UNPARSED_ARGUMENTS 0)
|
||||
|
||||
|
||||
SET(sources ${ARG_UNPARSED_ARGUMENTS})
|
||||
ADD_VERSION_INFO(${target} EXECUTABLE sources)
|
||||
|
||||
@@ -62,6 +62,7 @@ FUNCTION (MYSQL_ADD_EXECUTABLE)
|
||||
ELSE()
|
||||
UNSET(EXCLUDE_FROM_ALL)
|
||||
ENDIF()
|
||||
|
||||
ADD_EXECUTABLE(${target} ${WIN32} ${MACOSX_BUNDLE} ${EXCLUDE_FROM_ALL} ${sources})
|
||||
|
||||
# tell CPack where to install
|
||||
@@ -79,16 +80,44 @@ FUNCTION (MYSQL_ADD_EXECUTABLE)
|
||||
IF (COMP MATCHES ${SKIP_COMPONENTS})
|
||||
RETURN()
|
||||
ENDIF()
|
||||
IF (WITH_STRIPPED_CLIENT AND NOT target STREQUAL mysqld)
|
||||
|
||||
IF (WITH_STRIPPED_CLIENT AND NOT target STREQUAL mariadbd)
|
||||
INSTALL(CODE "SET(CMAKE_INSTALL_DO_STRIP 1)" COMPONENT ${COMP})
|
||||
SET(reset_strip ON)
|
||||
ENDIF()
|
||||
|
||||
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} COMPONENT ${COMP})
|
||||
|
||||
IF (reset_strip)
|
||||
INSTALL(CODE "SET(CMAKE_INSTALL_DO_STRIP 0)" COMPONENT ${COMP})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
# create mariadb named symlink
|
||||
CREATE_MARIADB_SYMLINK(${target} ${ARG_DESTINATION} ${COMP})
|
||||
# create MySQL named "legacy links"
|
||||
GET_SYMLINK(${target} link)
|
||||
IF(link)
|
||||
IF(UNIX)
|
||||
ADD_CUSTOM_COMMAND(TARGET ${target} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink
|
||||
${target} ${link}
|
||||
COMMENT "Creating ${link} link"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
|
||||
INSTALL(PROGRAMS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${link}
|
||||
DESTINATION
|
||||
${ARG_DESTINATION}
|
||||
COMPONENT ${COMP})
|
||||
ELSE()
|
||||
# Windows note:
|
||||
# Here, hardlinks are used, because cmake can't install symlinks.
|
||||
# In packages, there are won't be links, just copies.
|
||||
SET(link ${link}.exe)
|
||||
ADD_CUSTOM_COMMAND(TARGET ${target} POST_BUILD
|
||||
COMMAND cmake -E remove -f ${link}
|
||||
COMMAND mklink /H ${link} $<TARGET_FILE_NAME:${target}>
|
||||
COMMENT "Creating ${link} link"
|
||||
WORKING_DIRECTORY $<TARGET_FILE_DIR:${target}>)
|
||||
INSTALL(PROGRAMS $<TARGET_FILE_DIR:${target}>/${link} DESTINATION ${ARG_DESTINATION} COMPONENT ${COMP})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDFUNCTION()
|
||||
|
Reference in New Issue
Block a user