Commit c5d7bcf3 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Cleanup, use MYSQL_INSTALL_TARGETS macro instead of INSTALL(TARGETS) combined with

INSTALL_DEBUG_SYMBOLS
parent 91d9e6b6
......@@ -81,6 +81,5 @@ SET(INSTALL_EXES
mysqlbinlog
mysqltest)
INSTALL(TARGETS ${INSTALL_EXES} DESTINATION bin)
INSTALL_DEBUG_SYMBOLS("${INSTALL_EXES}")
MYSQL_INSTALL_TARGETS(${INSTALL_EXES} DESTINATION bin)
......@@ -26,7 +26,7 @@ MACRO(CMAKE_PARSE_ARGUMENTS prefix arg_names option_names)
SET(current_arg_name DEFAULT_ARGS)
SET(current_arg_list)
FOREACH(arg ${ARGN})
FOREACH(arg ${ARGN})
SET(larg_names ${arg_names})
LIST(FIND larg_names "${arg}" is_arg_name)
IF (is_arg_name GREATER -1)
......
......@@ -13,6 +13,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
GET_FILENAME_COMPONENT(MYSQL_CMAKE_SCRIPT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/cmake_parse_arguments.cmake)
MACRO (INSTALL_DEBUG_SYMBOLS targets)
IF(MSVC)
FOREACH(target ${targets})
......@@ -69,3 +71,29 @@ IF(UNIX)
ENDIF()
ENDMACRO()
# Installs targets, also installs pdbs on Windows.
#
# More stuff can be added later, e.g signing
# or pre-link custom targets (one example is creating
# version resource for windows executables)
FUNCTION(MYSQL_INSTALL_TARGETS)
CMAKE_PARSE_ARGUMENTS(ARG
"DESTINATION"
""
${ARGN}
)
SET(TARGETS ${ARG_DEFAULT_ARGS})
IF(NOT TARGETS)
MESSAGE(FATAL_ERROR "Need target list for MYSQL_INSTALL_TARGETS")
ENDIF()
IF(NOT ARG_DESTINATION)
MESSAGE(FATAL_ERROR "Need DESTINATION parameter for MYSQL_INSTALL_TARGETS")
ENDIF()
MESSAGE("INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION})")
INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION})
SET(INSTALL_LOCATION ${ARG_DESTINATION} )
INSTALL_DEBUG_SYMBOLS("${TARGETS}")
SET(INSTALL_LOCATION)
ENDFUNCTION()
......@@ -153,8 +153,7 @@ MACRO(MYSQL_ADD_PLUGIN)
OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}")
# Install dynamic library
SET(INSTALL_LOCATION lib/plugin)
INSTALL(TARGETS ${target} DESTINATION ${INSTALL_LOCATION})
INSTALL_DEBUG_SYMBOLS(${target})
MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_LOCATION})
ENDIF()
ENDMACRO()
......
......@@ -153,14 +153,14 @@ SET(LIBS clientlib dbug strings vio mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES})
# Merge several convenience libraries into one big mysqlclient
# and link them together into shared library.
MERGE_LIBRARIES(mysqlclient STATIC ${LIBS})
INSTALL(TARGETS mysqlclient DESTINATION lib)
MYSQL_INSTALL_TARGETS(mysqlclient DESTINATION lib)
IF(UNIX)
INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r mysqlclient lib)
ENDIF()
INSTALL_DEBUG_SYMBOLS(mysqlclient)
IF(NOT DISABLE_SHARED)
MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS})
MYSQL_INSTALL_TARGETS(libmysql DESTINATION lib)
IF(UNIX)
# Name of shared library is mysqlclient on Unix
SET_TARGET_PROPERTIES(libmysql PROPERTIES
......@@ -179,8 +179,6 @@ IF(NOT DISABLE_SHARED)
#(mysqlclient in this case)
SET_TARGET_PROPERTIES(mysqlclient PROPERTIES CLEAN_DIRECT_OUTPUT 1)
SET_TARGET_PROPERTIES(libmysql PROPERTIES CLEAN_DIRECT_OUTPUT 1)
INSTALL(TARGETS libmysql DESTINATION lib)
INSTALL_SYMLINK(${CMAKE_SHARED_LIBRARY_PREFIX}mysqlclient_r libmysql lib)
ENDIF()
INSTALL_DEBUG_SYMBOLS(libmysql)
ENDIF()
......@@ -120,11 +120,9 @@ ENDFOREACH()
MERGE_LIBRARIES(mysqlserver STATIC ${EMBEDDED_LIBS}
OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME})
INSTALL(TARGETS mysqlserver DESTINATION lib)
INSTALL_DEBUG_SYMBOLS(mysqlserver)
MYSQL_INSTALL_TARGETS(mysqlserver DESTINATION lib)
IF(MSVC AND NOT DISABLE_SHARED)
MERGE_LIBRARIES(libmysqld SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS})
INSTALL(TARGETS libmysqld DESTINATION lib)
INSTALL_DEBUG_SYMBOLS(libmysqld)
MYSQL_INSTALL_TARGETS(libmysqld DESTINATION lib)
ENDIF()
......@@ -140,9 +140,8 @@ ENDIF()
DTRACE_INSTRUMENT_STATIC_LIBS(mysqld
"sql;mysys;${MYSQLD_STATIC_PLUGIN_LIBS}")
INSTALL(TARGETS mysqld DESTINATION bin)
INSTALL_DEBUG_SYMBOLS(mysqld)
MYSQL_INSTALL_TARGETS(mysqld DESTINATION bin)
# Handle out-of-source build from source package with possibly broken
# bison. Copy bison output to from source to build directory, if not already
......
......@@ -13,7 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SET(IBMDB2I_PLUGIN_DYNAMIC "ha_ibmdb2i")
CHECK_INCLUDE_FILES(qlgusr.h HAVE_PASE_ENVIRONMENT)
IF(HAVE_PASE_ENVIRONMENT)
......
......@@ -197,8 +197,7 @@ ELSEIF (MYSQL_VERSION_ID LESS "50137")
ADD_DEPENDENCIES(innobase GenError)
ENDIF()
ELSE()
# New plugin support, cross-platform , name for shared library
# is given in INNOBASE_PLUGIN_STATIC and INNOBASE_PLUGIN_DYNAMIC
# New plugin support, cross-platform , base name for shared module is "ha_innodb"
MYSQL_ADD_PLUGIN(INNOBASE ${INNOBASE_SOURCES} STORAGE_ENGINE
MODULE_OUTPUT_NAME ha_innodb
LINK_LIBRARIES ${ZLIB_LIBRARY})
......
......@@ -13,9 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SET(MYISAM_PLUGIN_STATIC "myisam")
SET(MYISAM_PLUGIN_MANDATORY TRUE)
SET(MYISAM_SOURCES ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c ft_stem.c
ha_myisam.cc
ft_stopwords.c ft_update.c mi_cache.c mi_changed.c mi_check.c
......@@ -68,4 +65,4 @@ IF (MSVC)
SET_TARGET_PROPERTIES(myisamchk myisampack PROPERTIES LINK_FLAGS "setargv.obj")
ENDIF()
INSTALL(TARGETS myisamchk myisamlog myisampack myisam_ftdump DESTINATION bin)
MYSQL_INSTALL_TARGETS(myisamchk myisamlog myisampack myisam_ftdump DESTINATION bin)
......@@ -13,9 +13,6 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SET(MYISAMMRG_PLUGIN_STATIC "myisammrg")
SET(MYISAMMRG_PLUGIN_MANDATORY 1)
SET(MYISAMMRG_SOURCES myrg_close.c myrg_create.c myrg_delete.c myrg_extra.c myrg_info.c
ha_myisammrg.cc
myrg_locking.c myrg_open.c myrg_panic.c myrg_queue.c myrg_range.c
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment