Commit cedb6101 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

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

INSTALL_DEBUG_SYMBOLS
parent a6f6932e
...@@ -81,6 +81,5 @@ SET(INSTALL_EXES ...@@ -81,6 +81,5 @@ SET(INSTALL_EXES
mysqlbinlog mysqlbinlog
mysqltest) mysqltest)
INSTALL(TARGETS ${INSTALL_EXES} DESTINATION bin) MYSQL_INSTALL_TARGETS(${INSTALL_EXES} DESTINATION bin)
INSTALL_DEBUG_SYMBOLS("${INSTALL_EXES}")
...@@ -26,7 +26,7 @@ MACRO(CMAKE_PARSE_ARGUMENTS prefix arg_names option_names) ...@@ -26,7 +26,7 @@ MACRO(CMAKE_PARSE_ARGUMENTS prefix arg_names option_names)
SET(current_arg_name DEFAULT_ARGS) SET(current_arg_name DEFAULT_ARGS)
SET(current_arg_list) SET(current_arg_list)
FOREACH(arg ${ARGN}) FOREACH(arg ${ARGN})
SET(larg_names ${arg_names}) SET(larg_names ${arg_names})
LIST(FIND larg_names "${arg}" is_arg_name) LIST(FIND larg_names "${arg}" is_arg_name)
IF (is_arg_name GREATER -1) IF (is_arg_name GREATER -1)
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # 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) MACRO (INSTALL_DEBUG_SYMBOLS targets)
IF(MSVC) IF(MSVC)
FOREACH(target ${targets}) FOREACH(target ${targets})
...@@ -69,3 +71,29 @@ IF(UNIX) ...@@ -69,3 +71,29 @@ IF(UNIX)
ENDIF() ENDIF()
ENDMACRO() 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) ...@@ -153,8 +153,7 @@ MACRO(MYSQL_ADD_PLUGIN)
OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}") OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}")
# Install dynamic library # Install dynamic library
SET(INSTALL_LOCATION lib/plugin) SET(INSTALL_LOCATION lib/plugin)
INSTALL(TARGETS ${target} DESTINATION ${INSTALL_LOCATION}) MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_LOCATION})
INSTALL_DEBUG_SYMBOLS(${target})
ENDIF() ENDIF()
ENDMACRO() ENDMACRO()
......
...@@ -153,14 +153,14 @@ SET(LIBS clientlib dbug strings vio mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES}) ...@@ -153,14 +153,14 @@ SET(LIBS clientlib dbug strings vio mysys ${ZLIB_LIBRARY} ${SSL_LIBRARIES})
# Merge several convenience libraries into one big mysqlclient # Merge several convenience libraries into one big mysqlclient
# and link them together into shared library. # and link them together into shared library.
MERGE_LIBRARIES(mysqlclient STATIC ${LIBS}) MERGE_LIBRARIES(mysqlclient STATIC ${LIBS})
INSTALL(TARGETS mysqlclient DESTINATION lib) MYSQL_INSTALL_TARGETS(mysqlclient DESTINATION lib)
IF(UNIX) IF(UNIX)
INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r mysqlclient lib) INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r mysqlclient lib)
ENDIF() ENDIF()
INSTALL_DEBUG_SYMBOLS(mysqlclient)
IF(NOT DISABLE_SHARED) IF(NOT DISABLE_SHARED)
MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS}) MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS})
MYSQL_INSTALL_TARGETS(libmysql DESTINATION lib)
IF(UNIX) IF(UNIX)
# Name of shared library is mysqlclient on Unix # Name of shared library is mysqlclient on Unix
SET_TARGET_PROPERTIES(libmysql PROPERTIES SET_TARGET_PROPERTIES(libmysql PROPERTIES
...@@ -179,8 +179,6 @@ IF(NOT DISABLE_SHARED) ...@@ -179,8 +179,6 @@ IF(NOT DISABLE_SHARED)
#(mysqlclient in this case) #(mysqlclient in this case)
SET_TARGET_PROPERTIES(mysqlclient PROPERTIES CLEAN_DIRECT_OUTPUT 1) SET_TARGET_PROPERTIES(mysqlclient PROPERTIES CLEAN_DIRECT_OUTPUT 1)
SET_TARGET_PROPERTIES(libmysql 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) INSTALL_SYMLINK(${CMAKE_SHARED_LIBRARY_PREFIX}mysqlclient_r libmysql lib)
ENDIF() ENDIF()
INSTALL_DEBUG_SYMBOLS(libmysql)
ENDIF() ENDIF()
...@@ -120,11 +120,9 @@ ENDFOREACH() ...@@ -120,11 +120,9 @@ ENDFOREACH()
MERGE_LIBRARIES(mysqlserver STATIC ${EMBEDDED_LIBS} MERGE_LIBRARIES(mysqlserver STATIC ${EMBEDDED_LIBS}
OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME}) OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME})
INSTALL(TARGETS mysqlserver DESTINATION lib) MYSQL_INSTALL_TARGETS(mysqlserver DESTINATION lib)
INSTALL_DEBUG_SYMBOLS(mysqlserver)
IF(MSVC AND NOT DISABLE_SHARED) IF(MSVC AND NOT DISABLE_SHARED)
MERGE_LIBRARIES(libmysqld SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS}) MERGE_LIBRARIES(libmysqld SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS})
INSTALL(TARGETS libmysqld DESTINATION lib) MYSQL_INSTALL_TARGETS(libmysqld DESTINATION lib)
INSTALL_DEBUG_SYMBOLS(libmysqld)
ENDIF() ENDIF()
...@@ -140,9 +140,8 @@ ENDIF() ...@@ -140,9 +140,8 @@ ENDIF()
DTRACE_INSTRUMENT_STATIC_LIBS(mysqld DTRACE_INSTRUMENT_STATIC_LIBS(mysqld
"sql;mysys;${MYSQLD_STATIC_PLUGIN_LIBS}") "sql;mysys;${MYSQLD_STATIC_PLUGIN_LIBS}")
INSTALL(TARGETS mysqld DESTINATION bin) MYSQL_INSTALL_TARGETS(mysqld DESTINATION bin)
INSTALL_DEBUG_SYMBOLS(mysqld)
# Handle out-of-source build from source package with possibly broken # Handle out-of-source build from source package with possibly broken
# bison. Copy bison output to from source to build directory, if not already # bison. Copy bison output to from source to build directory, if not already
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # 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) CHECK_INCLUDE_FILES(qlgusr.h HAVE_PASE_ENVIRONMENT)
IF(HAVE_PASE_ENVIRONMENT) IF(HAVE_PASE_ENVIRONMENT)
......
...@@ -197,8 +197,7 @@ ELSEIF (MYSQL_VERSION_ID LESS "50137") ...@@ -197,8 +197,7 @@ ELSEIF (MYSQL_VERSION_ID LESS "50137")
ADD_DEPENDENCIES(innobase GenError) ADD_DEPENDENCIES(innobase GenError)
ENDIF() ENDIF()
ELSE() ELSE()
# New plugin support, cross-platform , name for shared library # New plugin support, cross-platform , base name for shared module is "ha_innodb"
# is given in INNOBASE_PLUGIN_STATIC and INNOBASE_PLUGIN_DYNAMIC
MYSQL_ADD_PLUGIN(INNOBASE ${INNOBASE_SOURCES} STORAGE_ENGINE MYSQL_ADD_PLUGIN(INNOBASE ${INNOBASE_SOURCES} STORAGE_ENGINE
MODULE_OUTPUT_NAME ha_innodb MODULE_OUTPUT_NAME ha_innodb
LINK_LIBRARIES ${ZLIB_LIBRARY}) LINK_LIBRARIES ${ZLIB_LIBRARY})
......
...@@ -13,9 +13,6 @@ ...@@ -13,9 +13,6 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # 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 SET(MYISAM_SOURCES ft_boolean_search.c ft_nlq_search.c ft_parser.c ft_static.c ft_stem.c
ha_myisam.cc ha_myisam.cc
ft_stopwords.c ft_update.c mi_cache.c mi_changed.c mi_check.c ft_stopwords.c ft_update.c mi_cache.c mi_changed.c mi_check.c
...@@ -68,4 +65,4 @@ IF (MSVC) ...@@ -68,4 +65,4 @@ IF (MSVC)
SET_TARGET_PROPERTIES(myisamchk myisampack PROPERTIES LINK_FLAGS "setargv.obj") SET_TARGET_PROPERTIES(myisamchk myisampack PROPERTIES LINK_FLAGS "setargv.obj")
ENDIF() ENDIF()
INSTALL(TARGETS myisamchk myisamlog myisampack myisam_ftdump DESTINATION bin) MYSQL_INSTALL_TARGETS(myisamchk myisamlog myisampack myisam_ftdump DESTINATION bin)
...@@ -13,9 +13,6 @@ ...@@ -13,9 +13,6 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # 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 SET(MYISAMMRG_SOURCES myrg_close.c myrg_create.c myrg_delete.c myrg_extra.c myrg_info.c
ha_myisammrg.cc ha_myisammrg.cc
myrg_locking.c myrg_open.c myrg_panic.c myrg_queue.c myrg_range.c 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