summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmake/install_macros.cmake52
-rw-r--r--cmake/plugin.cmake9
-rw-r--r--libmysqld/examples/CMakeLists.txt9
-rw-r--r--plugin/audit_null/CMakeLists.txt2
-rw-r--r--plugin/auth_examples/CMakeLists.txt12
-rw-r--r--plugin/daemon_example/CMakeLists.txt4
-rw-r--r--plugin/fulltext/CMakeLists.txt2
-rw-r--r--plugin/win_auth_client/CMakeLists.txt2
-rw-r--r--storage/example/CMakeLists.txt2
9 files changed, 55 insertions, 39 deletions
diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake
index 8b21774937e..c668b38eef3 100644
--- a/cmake/install_macros.cmake
+++ b/cmake/install_macros.cmake
@@ -15,37 +15,46 @@
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)
+
+FUNCTION (INSTALL_DEBUG_SYMBOLS)
+ IF(MSVC)
+ MYSQL_PARSE_ARGUMENTS(ARG
+ "COMPONENT;INSTALL_LOCATION"
+ ""
+ ${ARGN}
+ )
+
+ IF(NOT ARG_COMPONENT)
+ MESSAGE(FATAL_ERROR "No COMPONENT passed to INSTALL_DEBUG_SYMBOLS")
+ ENDIF()
+ IF(NOT ARG_INSTALL_LOCATION)
+ MESSAGE(FATAL_ERROR "No INSTALL_LOCATION passed to INSTALL_DEBUG_SYMBOLS")
+ ENDIF()
+ SET(targets ${ARG_DEFAULT_ARGS})
FOREACH(target ${targets})
- GET_TARGET_PROPERTY(location ${target} LOCATION)
GET_TARGET_PROPERTY(type ${target} TYPE)
- IF(NOT INSTALL_LOCATION)
- IF(type MATCHES "STATIC_LIBRARY" OR type MATCHES "MODULE_LIBRARY" OR type MATCHES "SHARED_LIBRARY")
- SET(INSTALL_LOCATION "lib")
- ELSEIF(type MATCHES "EXECUTABLE")
- SET(INSTALL_LOCATION "bin")
- ELSE()
- MESSAGE(FATAL_ERROR "cannot determine type of ${target}. Don't now where to install")
- ENDIF()
- ENDIF()
+ GET_TARGET_PROPERTY(location ${target} LOCATION)
STRING(REPLACE ".exe" ".pdb" pdb_location ${location})
STRING(REPLACE ".dll" ".pdb" pdb_location ${pdb_location})
STRING(REPLACE ".lib" ".pdb" pdb_location ${pdb_location})
IF(CMAKE_GENERATOR MATCHES "Visual Studio")
STRING(REPLACE "${CMAKE_CFG_INTDIR}" "\${CMAKE_INSTALL_CONFIG_NAME}" pdb_location ${pdb_location})
ENDIF()
- IF(target STREQUAL "mysqld")
+ IF(ARG_COMPONENT STREQUAL "Server" AND (target MATCHES "mysqld" OR type MATCHES "MODULE"))
+ #MESSAGE("PDB: ${targets}")
SET(comp Server)
- ELSEIF(pdb_location MATCHES "mysql-test")
- SET(comp Tests)
- ELSE()
+ ELSEIF(ARG_COMPONENT MATCHES Development
+ OR ARG_COMPONENT MATCHES SharedLibraries
+ OR ARG_COMPONENT MATCHES Embedded)
+
SET(comp Debuginfo)
+ ELSE()
+ SET(comp Debuginfo_archive_only) # not in MSI
ENDIF()
- INSTALL(FILES ${pdb_location} DESTINATION ${INSTALL_LOCATION} COMPONENT ${comp})
+ INSTALL(FILES ${pdb_location} DESTINATION ${ARG_INSTALL_LOCATION} COMPONENT ${comp})
ENDFOREACH()
ENDIF()
-ENDMACRO()
+ENDFUNCTION()
# Installs manpage for given file (either script or executable)
#
@@ -207,6 +216,8 @@ FUNCTION(MYSQL_INSTALL_TARGETS)
)
IF(ARG_COMPONENT)
SET(COMP COMPONENT ${ARG_COMPONENT})
+ ELSE()
+ MESSAGE(FATAL_ERROR "COMPONENT argument required")
ENDIF()
SET(TARGETS ${ARG_DEFAULT_ARGS})
@@ -231,9 +242,8 @@ FUNCTION(MYSQL_INSTALL_TARGETS)
ENDFOREACH()
INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION} ${COMP})
- SET(INSTALL_LOCATION ${ARG_DESTINATION} )
- INSTALL_DEBUG_SYMBOLS("${TARGETS}")
- SET(INSTALL_LOCATION)
+ INSTALL_DEBUG_SYMBOLS(${TARGETS} ${COMP} INSTALL_LOCATION ${ARG_DESTINATION})
+
ENDFUNCTION()
# Optionally install mysqld/client/embedded from debug build run. outside of the current build dir
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index ac6ce6bc237..7952c351e2f 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -45,7 +45,7 @@ ENDMACRO()
MACRO(MYSQL_ADD_PLUGIN)
MYSQL_PARSE_ARGUMENTS(ARG
- "LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME"
+ "LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT"
"STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED"
${ARGN}
)
@@ -207,8 +207,11 @@ MACRO(MYSQL_ADD_PLUGIN)
SET_TARGET_PROPERTIES(${target} PROPERTIES
OUTPUT_NAME "${ARG_MODULE_OUTPUT_NAME}")
# Install dynamic library
- MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR} COMPONENT Server)
- INSTALL_DEBUG_TARGET(${target} DESTINATION ${INSTALL_PLUGINDIR}/debug)
+ IF(NOT ARG_COMPONENT)
+ SET(ARG_COMPONENT Server)
+ ENDIF()
+ MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR} COMPONENT ${ARG_COMPONENT})
+ INSTALL_DEBUG_TARGET(${target} DESTINATION ${INSTALL_PLUGINDIR}/debug COMPONENT ${ARG_COMPONENT})
# Add installed files to list for RPMs
FILE(APPEND ${CMAKE_BINARY_DIR}/support-files/plugins.files
"%attr(755, root, root) %{_prefix}/${INSTALL_PLUGINDIR}/${ARG_MODULE_OUTPUT_NAME}.so\n"
diff --git a/libmysqld/examples/CMakeLists.txt b/libmysqld/examples/CMakeLists.txt
index 3d67083acc9..e62b2a193e4 100644
--- a/libmysqld/examples/CMakeLists.txt
+++ b/libmysqld/examples/CMakeLists.txt
@@ -25,13 +25,15 @@ ADD_DEFINITIONS(-DEMBEDDED_LIBRARY -UMYSQL_CLIENT)
MYSQL_ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc
- ../../client/mysql.cc ../../client/readline.cc)
+ ../../client/mysql.cc ../../client/readline.cc
+ COMPONENT Test)
TARGET_LINK_LIBRARIES(mysql_embedded mysqlserver)
IF(UNIX)
TARGET_LINK_LIBRARIES(mysql_embedded ${MY_READLINE_LIBRARY})
ENDIF(UNIX)
-MYSQL_ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc)
+MYSQL_ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc
+ COMPONENT Test)
TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver)
IF(CMAKE_GENERATOR MATCHES "Xcode")
@@ -47,7 +49,8 @@ IF(CMAKE_GENERATOR MATCHES "Xcode")
${CMAKE_CURRENT_BINARY_DIR}/mysql_client_test_embedded_dummy.cc
../../tests/mysql_client_test.c)
ELSE()
- MYSQL_ADD_EXECUTABLE(mysql_client_test_embedded ../../tests/mysql_client_test.c)
+ MYSQL_ADD_EXECUTABLE(mysql_client_test_embedded ../../tests/mysql_client_test.c
+ COMPONENT Test)
SET_TARGET_PROPERTIES(mysql_client_test_embedded PROPERTIES HAS_CXX TRUE)
ENDIF()
TARGET_LINK_LIBRARIES(mysql_client_test_embedded mysqlserver)
diff --git a/plugin/audit_null/CMakeLists.txt b/plugin/audit_null/CMakeLists.txt
index b88c4922f60..e87fc2a85f5 100644
--- a/plugin/audit_null/CMakeLists.txt
+++ b/plugin/audit_null/CMakeLists.txt
@@ -14,4 +14,4 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
MYSQL_ADD_PLUGIN(audit_null audit_null.c
- MODULE_ONLY MODULE_OUTPUT_NAME "adt_null")
+ MODULE_ONLY MODULE_OUTPUT_NAME "adt_null" COMPONENT Test)
diff --git a/plugin/auth_examples/CMakeLists.txt b/plugin/auth_examples/CMakeLists.txt
index 0c9fb32b77a..fb27289770f 100644
--- a/plugin/auth_examples/CMakeLists.txt
+++ b/plugin/auth_examples/CMakeLists.txt
@@ -15,17 +15,17 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
MYSQL_ADD_PLUGIN(dialog_examples dialog_examples.c
- MODULE_ONLY)
+ MODULE_ONLY COMPONENT Test)
MYSQL_ADD_PLUGIN(auth_test_plugin test_plugin.c
- MODULE_ONLY)
+ MODULE_ONLY COMPONENT Test)
MYSQL_ADD_PLUGIN(qa_auth_interface qa_auth_interface.c
- MODULE_ONLY)
+ MODULE_ONLY COMPONENT Test)
MYSQL_ADD_PLUGIN(qa_auth_server qa_auth_server.c
- MODULE_ONLY)
+ MODULE_ONLY COMPONENT Test)
MYSQL_ADD_PLUGIN(qa_auth_client qa_auth_client.c
- MODULE_ONLY)
+ MODULE_ONLY COMPONENT Test)
MYSQL_ADD_PLUGIN(mysql_clear_password clear_password_client.c
- MODULE_ONLY)
+ MODULE_ONLY COMPONENT SharedLibraries)
diff --git a/plugin/daemon_example/CMakeLists.txt b/plugin/daemon_example/CMakeLists.txt
index 1623c3025d7..06c39af4bdd 100644
--- a/plugin/daemon_example/CMakeLists.txt
+++ b/plugin/daemon_example/CMakeLists.txt
@@ -14,6 +14,6 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
MYSQL_ADD_PLUGIN(daemon_example daemon_example.cc
- MODULE_ONLY MODULE_OUTPUT_NAME "libdaemon_example")
+ MODULE_ONLY MODULE_OUTPUT_NAME "libdaemon_example" COMPONENT Test)
-INSTALL(FILES daemon_example.ini DESTINATION ${INSTALL_PLUGINDIR})
+INSTALL(FILES daemon_example.ini DESTINATION ${INSTALL_PLUGINDIR} COMPONENT Test)
diff --git a/plugin/fulltext/CMakeLists.txt b/plugin/fulltext/CMakeLists.txt
index 305ae7fe143..b65fcba0449 100644
--- a/plugin/fulltext/CMakeLists.txt
+++ b/plugin/fulltext/CMakeLists.txt
@@ -14,4 +14,4 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
MYSQL_ADD_PLUGIN(ftexample plugin_example.c
- MODULE_ONLY MODULE_OUTPUT_NAME "mypluglib")
+ MODULE_ONLY MODULE_OUTPUT_NAME "mypluglib" COMPONENT Test)
diff --git a/plugin/win_auth_client/CMakeLists.txt b/plugin/win_auth_client/CMakeLists.txt
index 1e65673adbd..a24f6b267f6 100644
--- a/plugin/win_auth_client/CMakeLists.txt
+++ b/plugin/win_auth_client/CMakeLists.txt
@@ -29,6 +29,6 @@ IF(WIN32)
MYSQL_ADD_PLUGIN(authentication_windows_client ${PLUGIN_SOURCES} ${HEADERS}
LINK_LIBRARIES Secur32
- MODULE_ONLY)
+ MODULE_ONLY COMPONENT SharedLibraries)
ENDIF(WIN32)
diff --git a/storage/example/CMakeLists.txt b/storage/example/CMakeLists.txt
index 53f5d6619a0..f0ff3e15b4d 100644
--- a/storage/example/CMakeLists.txt
+++ b/storage/example/CMakeLists.txt
@@ -14,4 +14,4 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SET(EXAMPLE_SOURCES ha_example.cc)
-MYSQL_ADD_PLUGIN(example ${EXAMPLE_SOURCES} STORAGE_ENGINE MODULE_ONLY)
+MYSQL_ADD_PLUGIN(example ${EXAMPLE_SOURCES} STORAGE_ENGINE MODULE_ONLY COMPONENT Test)