diff options
author | Vladislav Vaintroub <vvaintroub@mysql.com> | 2009-12-12 02:03:05 +0100 |
---|---|---|
committer | Vladislav Vaintroub <vvaintroub@mysql.com> | 2009-12-12 02:03:05 +0100 |
commit | cedb6101db403430d593431478fddd3c3da9b267 (patch) | |
tree | 4007236a6bd4922f17a327fd7e196d8bda1a9350 | |
parent | a6f6932e26f74557f674bc848271ed6a28de5bb6 (diff) | |
download | mariadb-git-cedb6101db403430d593431478fddd3c3da9b267.tar.gz |
Cleanup, use MYSQL_INSTALL_TARGETS macro instead of INSTALL(TARGETS) combined with
INSTALL_DEBUG_SYMBOLS
-rwxr-xr-x | client/CMakeLists.txt | 3 | ||||
-rw-r--r-- | cmake/cmake_parse_arguments.cmake | 2 | ||||
-rw-r--r-- | cmake/install_macros.cmake | 28 | ||||
-rw-r--r-- | cmake/plugin.cmake | 3 | ||||
-rwxr-xr-x | libmysql/CMakeLists.txt | 6 | ||||
-rw-r--r-- | libmysqld/CMakeLists.txt | 6 | ||||
-rwxr-xr-x | sql/CMakeLists.txt | 5 | ||||
-rw-r--r-- | storage/ibmdb2i/CMakeLists.txt | 1 | ||||
-rw-r--r-- | storage/innobase/CMakeLists.txt | 3 | ||||
-rwxr-xr-x | storage/myisam/CMakeLists.txt | 5 | ||||
-rwxr-xr-x | storage/myisammrg/CMakeLists.txt | 3 |
11 files changed, 39 insertions, 26 deletions
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 1cda6592a6e..7d501f19b10 100755 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -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) diff --git a/cmake/cmake_parse_arguments.cmake b/cmake/cmake_parse_arguments.cmake index e9bd7f872d1..ea601f916a8 100644 --- a/cmake/cmake_parse_arguments.cmake +++ b/cmake/cmake_parse_arguments.cmake @@ -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) diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake index 3925ce292de..b1f03b40fe6 100644 --- a/cmake/install_macros.cmake +++ b/cmake/install_macros.cmake @@ -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() + diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake index f718563acda..41fc3739979 100644 --- a/cmake/plugin.cmake +++ b/cmake/plugin.cmake @@ -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() diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt index db7d2ee2468..a2ccd8f340d 100755 --- a/libmysql/CMakeLists.txt +++ b/libmysql/CMakeLists.txt @@ -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() diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt index 56e16e6cd1c..b0131bddee0 100644 --- a/libmysqld/CMakeLists.txt +++ b/libmysqld/CMakeLists.txt @@ -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() diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 8062fd62c1a..6adad10a2e0 100755 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -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 diff --git a/storage/ibmdb2i/CMakeLists.txt b/storage/ibmdb2i/CMakeLists.txt index b1517f53f7f..e8db6989583 100644 --- a/storage/ibmdb2i/CMakeLists.txt +++ b/storage/ibmdb2i/CMakeLists.txt @@ -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) diff --git a/storage/innobase/CMakeLists.txt b/storage/innobase/CMakeLists.txt index e5ecc98dc3a..76acec8f6d7 100644 --- a/storage/innobase/CMakeLists.txt +++ b/storage/innobase/CMakeLists.txt @@ -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}) diff --git a/storage/myisam/CMakeLists.txt b/storage/myisam/CMakeLists.txt index 396b5e29834..9359eca0ccc 100755 --- a/storage/myisam/CMakeLists.txt +++ b/storage/myisam/CMakeLists.txt @@ -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) diff --git a/storage/myisammrg/CMakeLists.txt b/storage/myisammrg/CMakeLists.txt index 59bc5ce4fc1..44f2e276c19 100755 --- a/storage/myisammrg/CMakeLists.txt +++ b/storage/myisammrg/CMakeLists.txt @@ -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 |