summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <vvaintroub@mysql.com>2010-02-10 20:23:24 +0100
committerVladislav Vaintroub <vvaintroub@mysql.com>2010-02-10 20:23:24 +0100
commit890c52d889231c7854c52d7b649d2be24e509e69 (patch)
treedfea6a5cf6f617ecfe6559b0eff36aba6b474d05
parentbefe4641f23d1b62a797d678aa2e5198e0c2d388 (diff)
downloadmariadb-git-890c52d889231c7854c52d7b649d2be24e509e69.tar.gz
Add components to INSTALL, some eraly Wix support
-rwxr-xr-xCMakeLists.txt20
-rwxr-xr-xclient/CMakeLists.txt2
-rw-r--r--cmake/install_macros.cmake96
-rw-r--r--cmake/libutils.cmake7
-rw-r--r--cmake/mysql_add_executable.cmake13
-rw-r--r--cmake/package_name.cmake5
-rw-r--r--cmake/plugin.cmake2
-rwxr-xr-xextra/CMakeLists.txt2
-rw-r--r--include/CMakeLists.txt4
-rwxr-xr-xlibmysql/CMakeLists.txt8
-rw-r--r--libmysqld/CMakeLists.txt5
-rw-r--r--mysql-test/CMakeLists.txt1
-rw-r--r--mysql-test/lib/My/SafeProcess/CMakeLists.txt19
-rw-r--r--packaging/WiX/AdminBackground.jpgbin0 -> 20557 bytes
-rw-r--r--packaging/WiX/AdminHeader.jpgbin0 -> 3469 bytes
-rw-r--r--packaging/WiX/CMakeLists.txt28
-rw-r--r--packaging/WiX/create_fragments.cmake86
-rw-r--r--packaging/WiX/create_msi.cmake.in103
-rw-r--r--packaging/WiX/mysql_server.wxs.in40
-rwxr-xr-xscripts/CMakeLists.txt46
-rwxr-xr-xscripts/make_win_bin_dist2
-rwxr-xr-xsql/CMakeLists.txt2
-rw-r--r--sql/share/CMakeLists.txt6
-rw-r--r--support-files/CMakeLists.txt2
24 files changed, 422 insertions, 77 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 369e03bf988..f1185e65028 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -261,14 +261,10 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/include/mysql_version.h.in
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/sql/sql_builtin.cc.in
${CMAKE_BINARY_DIR}/sql/sql_builtin.cc)
-# Packaging
-IF(WIN32)
- SET(CPACK_GENERATOR "ZIP")
-ELSE()
- SET(CPACK_GENERATOR "TGZ")
-ENDIF()
-INCLUDE(CPack)
-INSTALL(FILES COPYING EXCEPTIONS-CLIENT README DESTINATION ${INSTALL_DOCREADMEDIR})
+INSTALL(FILES EXCEPTIONS-CLIENT DESTINATION ${INSTALL_DOCREADMEDIR} COMPONENT
+ Development)
+
+INSTALL(FILES COPYING README DESTINATION ${INSTALL_DOCREADMEDIR})
IF(UNIX)
INSTALL(FILES Docs/INSTALL-BINARY DESTINATION ${INSTALL_DOCREADMEDIR})
ENDIF()
@@ -276,3 +272,11 @@ ENDIF()
SET(MYSQL_DOCS_LOCATION "" CACHE PATH "Location from where documentation is copied")
MARK_AS_ADVANCED(MYSQL_DOCS_LOCATION)
INSTALL(DIRECTORY Docs/ DESTINATION ${INSTALL_DOCDIR})
+# Packaging
+IF(WIN32)
+ SET(CPACK_GENERATOR "ZIP")
+ELSE()
+ SET(CPACK_GENERATOR "TGZ")
+ENDIF()
+ADD_SUBDIRECTORY(packaging/WiX)
+INCLUDE(CPack)
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index f4e223c9c72..d0bb8d43edd 100755
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -33,7 +33,7 @@ IF(UNIX)
TARGET_LINK_LIBRARIES(mysql ${READLINE_LIBRARY})
ENDIF(UNIX)
-MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc)
+MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc COMPONENT Test)
SET_SOURCE_FILES_PROPERTIES(mysqltest.cc PROPERTIES COMPILE_FLAGS "-DTHREADS")
TARGET_LINK_LIBRARIES(mysqltest mysqlclient regex)
diff --git a/cmake/install_macros.cmake b/cmake/install_macros.cmake
index 8a201cbb026..5b20c1966be 100644
--- a/cmake/install_macros.cmake
+++ b/cmake/install_macros.cmake
@@ -40,10 +40,74 @@ MACRO (INSTALL_DEBUG_SYMBOLS targets)
ENDIF()
ENDMACRO()
+# Installs manpage for given file (either script or executable)
+#
+FUNCTION(INSTALL_MANPAGE file)
+ IF(NOT UNIX)
+ RETURN()
+ ENDIF()
+ GET_FILENAME_COMPONENT(file_name "${file}" NAME)
+ SET(GLOB_EXPR
+ ${CMAKE_SOURCE_DIR}/man/*${file}man.1*
+ ${CMAKE_SOURCE_DIR}/man/*${file}man.8*
+ ${CMAKE_BINARY_DIR}/man/*${file}man.1*
+ ${CMAKE_BINARY_DIR}/man/*${file}man.8*
+ )
+ IF(MYSQL_DOC_DIR)
+ SET(GLOB_EXPR
+ ${MYSQL_DOC_DIR}/man/*${file}man.1*
+ ${MYSQL_DOC_DIR}/man/*${file}man.8*
+ ${MYSQL_DOC_DIR}/man/*${file}.1*
+ ${MYSQL_DOC_DIR}/man/*${file}.8*
+ ${GLOB_EXPR}
+ )
+ ENDIF()
+
+ FILE(GLOB_RECURSE MANPAGES ${GLOB_EXPR})
+ IF(MANPAGES)
+ LIST(GET MANPAGES 0 MANPAGE)
+ STRING(REPLACE "${file}man.1" "${file}.1" MANPAGE "${MANPAGE}")
+ STRING(REPLACE "${file}man.8" "${file}.8" MANPAGE "${MANPAGE}")
+ IF(MANPAGE MATCHES "${file}.1")
+ SET(SECTION man1)
+ ELSE()
+ SET(SECTION man8)
+ ENDIF()
+ INSTALL(FILES "${MANPAGE}" DESTINATION "${INSTALL_MANDIR}/${SECTION}")
+ ENDIF()
+ENDFUNCTION()
+
+FUNCTION(INSTALL_SCRIPT)
+ CMAKE_PARSE_ARGUMENTS(ARG
+ "DESTINATION;COMPONENT"
+ ""
+ ${ARGN}
+ )
+
+ SET(script ${ARG_DEFAULT_ARGS})
+ IF(NOT ARG_DESTINATION)
+ SET(ARG_DESTINATION ${INSTALL_BINDIR})
+ ENDIF()
+ IF(ARG_COMPONENT)
+ SET(COMP COMPONENT ${ARG_COMPONENT})
+ ELSE()
+ SET(COMP)
+ ENDIF()
+
+ INSTALL(FILES
+ ${script}
+ DESTINATION ${ARG_DESTINATION}
+ PERMISSIONS OWNER_READ OWNER_WRITE
+ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE ${COMP}
+ )
+ INSTALL_MANPAGE(${script})
+ENDFUNCTION()
+
# Install symbolic link to CMake target.
# the link is created in the same directory as target
# and extension will be the same as for target file.
-MACRO(INSTALL_SYMLINK linkbasename target destination)
+MACRO(INSTALL_SYMLINK linkbasename target destination component)
IF(UNIX)
GET_TARGET_PROPERTY(location ${target} LOCATION)
GET_FILENAME_COMPONENT(path ${location} PATH)
@@ -69,7 +133,12 @@ IF(UNIX)
STRING(REPLACE "${CMAKE_CFG_INTDIR}"
"\${CMAKE_INSTALL_CONFIG_NAME}" output ${output})
ENDIF()
- INSTALL(FILES ${output} DESTINATION ${destination})
+ IF(component)
+ SET(COMP COMPONENT ${component})
+ ELSE()
+ SET(COMP)
+ ENDIF()
+ INSTALL(FILES ${output} DESTINATION ${destination} ${COMP})
ENDIF()
ENDMACRO()
@@ -129,13 +198,11 @@ 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"
+ "DESTINATION;COMPONENT"
""
${ARGN}
)
@@ -147,15 +214,24 @@ FUNCTION(MYSQL_INSTALL_TARGETS)
MESSAGE(FATAL_ERROR "Need DESTINATION parameter for MYSQL_INSTALL_TARGETS")
ENDIF()
- # If signing is required, sign executables before installing
+
FOREACH(target ${TARGETS})
- IF(SIGNCODE AND SIGNCODE_ENABLED)
+ # If signing is required, sign executables before installing
+ IF(SIGNCODE AND SIGNCODE_ENABLED)
SIGN_TARGET(${target})
ENDIF()
+ # For Windows, add version info to executables
ADD_VERSION_INFO(${target})
+ # Install man pages on Unix
+ IF(UNIX)
+ GET_TARGET_PROPERTY(target_location ${target} LOCATION)
+ INSTALL_MANPAGE(${target_location})
+ ENDIF()
ENDFOREACH()
-
- INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION})
+ IF(ARG_COMPONENT)
+ SET(COMP COMPONENT ${ARG_COMPONENT})
+ ENDIF()
+ INSTALL(TARGETS ${TARGETS} DESTINATION ${ARG_DESTINATION} ${COMP})
SET(INSTALL_LOCATION ${ARG_DESTINATION} )
INSTALL_DEBUG_SYMBOLS("${TARGETS}")
SET(INSTALL_LOCATION)
diff --git a/cmake/libutils.cmake b/cmake/libutils.cmake
index 2263b146ed6..ba63df71428 100644
--- a/cmake/libutils.cmake
+++ b/cmake/libutils.cmake
@@ -214,7 +214,7 @@ ENDMACRO()
#)
MACRO(MERGE_LIBRARIES)
CMAKE_PARSE_ARGUMENTS(ARG
- "EXPORTS;OUTPUT_NAME"
+ "EXPORTS;OUTPUT_NAME;COMPONENT"
"STATIC;SHARED;MODULE;NOINSTALL"
${ARGN}
)
@@ -259,7 +259,10 @@ MACRO(MERGE_LIBRARIES)
MESSAGE(FATAL_ERROR "Unknown library type")
ENDIF()
IF(NOT ARG_NOINSTALL)
- MYSQL_INSTALL_TARGETS(${TARGET} DESTINATION "${INSTALL_LIBDIR}")
+ IF(ARG_COMPONENT)
+ SET(COMP COMPONENT ${ARG_COMPONENT})
+ ENDIF()
+ MYSQL_INSTALL_TARGETS(${TARGET} DESTINATION "${INSTALL_LIBDIR}" ${COMP})
ENDIF()
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES LINK_INTERFACE_LIBRARIES "")
ENDMACRO()
diff --git a/cmake/mysql_add_executable.cmake b/cmake/mysql_add_executable.cmake
index 2157d03e6d1..86301c2eec8 100644
--- a/cmake/mysql_add_executable.cmake
+++ b/cmake/mysql_add_executable.cmake
@@ -29,7 +29,7 @@ INCLUDE(cmake_parse_arguments)
FUNCTION (MYSQL_ADD_EXECUTABLE)
# Pass-through arguments for ADD_EXECUTABLE
CMAKE_PARSE_ARGUMENTS(ARG
- "WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION"
+ "WIN32;MACOSX_BUNDLE;EXCLUDE_FROM_ALL;DESTINATION;COMPONENT"
""
${ARGN}
)
@@ -43,7 +43,14 @@ FUNCTION (MYSQL_ADD_EXECUTABLE)
IF(NOT ARG_EXCLUDE_FROM_ALL)
IF(NOT ARG_DESTINATION)
SET(ARG_DESTINATION ${INSTALL_BINDIR})
+ ENDIF()
+ IF(ARG_COMPONENT)
+ SET(COMP COMPONENT ${ARG_COMPONENT})
+ ELSEIF(MYSQL_INSTALL_COMPONENT)
+ SET(COMP COMPONENT ${MYSQL_INSTALL_COMPONENT})
+ ELSE()
+ SET(COMP COMPONENT Client)
ENDIF()
- MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION})
+ MYSQL_INSTALL_TARGETS(${target} DESTINATION ${ARG_DESTINATION} ${COMP})
ENDIF()
-ENDFUNCTION() \ No newline at end of file
+ENDFUNCTION()
diff --git a/cmake/package_name.cmake b/cmake/package_name.cmake
index d2998cfd795..6e6fe89e8b3 100644
--- a/cmake/package_name.cmake
+++ b/cmake/package_name.cmake
@@ -15,6 +15,8 @@
# Produce meaningful package name for the binary package
# The logic is rather involved with special cases for different OSes
+INCLUDE(CheckTypeSize)
+CHECK_TYPE_SIZE("void *" SIZEOF_VOIDP)
MACRO(GET_PACKAGE_FILE_NAME Var)
IF(NOT VERSION)
MESSAGE(FATAL_ERROR
@@ -24,7 +26,8 @@ IF(NOT VERSION)
SET(NEED_DASH_BETWEEN_PLATFORM_AND_MACHINE 1)
SET(DEFAULT_PLATFORM ${CMAKE_SYSTEM_NAME})
SET(DEFAULT_MACHINE ${CMAKE_SYSTEM_PROCESSOR})
- IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ MESSAGE("SIZEOF_VOIDP=${SIZEOF_VOIDP}")
+ IF(SIZEOF_VOIDP EQUAL 8)
SET(64BIT 1)
ENDIF()
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index d6411641192..585883a7ca3 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -168,7 +168,7 @@ 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})
+ MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR} COMPONENT Server)
ENDIF()
ENDMACRO()
diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt
index 479fb8cbd71..ee575685655 100755
--- a/extra/CMakeLists.txt
+++ b/extra/CMakeLists.txt
@@ -24,6 +24,8 @@ ${CMAKE_SOURCE_DIR}/storage/ndb/include/ndbapi
${CMAKE_SOURCE_DIR}/storage/ndb/include/portlib
${CMAKE_SOURCE_DIR}/storage/ndb/include/mgmapi)
+# Default install component for the files is Server here
+SET(MYSQL_INSTALL_COMPONENT Server)
IF(NOT CMAKE_CROSSCOMPILING)
ADD_EXECUTABLE(comp_err comp_err.c)
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index e2ef01b3b4c..c3922231047 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -57,7 +57,7 @@ SET(HEADERS
${HEADERS_GEN_CONFIGURE}
)
-INSTALL(FILES ${HEADERS} DESTINATION ${INSTALL_INCLUDEDIR})
-INSTALL(DIRECTORY mysql/ DESTINATION ${INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h")
+INSTALL(FILES ${HEADERS} DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development)
+INSTALL(DIRECTORY mysql/ DESTINATION ${INSTALL_INCLUDEDIR} COMPONENT Development FILES_MATCHING PATTERN "*.h" )
diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt
index acdff87f4a0..2206f74c528 100755
--- a/libmysql/CMakeLists.txt
+++ b/libmysql/CMakeLists.txt
@@ -152,13 +152,13 @@ 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})
+MERGE_LIBRARIES(mysqlclient STATIC ${LIBS} COMPONENT Development)
IF(UNIX)
- INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r mysqlclient ${INSTALL_LIBDIR})
+ INSTALL_SYMLINK(${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient_r mysqlclient ${INSTALL_LIBDIR} COMPONENT SharedLibraries)
ENDIF()
IF(NOT DISABLE_SHARED)
- MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS})
+ MERGE_LIBRARIES(libmysql SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS} COMPONENT SharedLibraries)
IF(UNIX)
# Name of shared library is mysqlclient on Unix
SET_TARGET_PROPERTIES(libmysql PROPERTIES
@@ -177,6 +177,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_SYMLINK(${CMAKE_SHARED_LIBRARY_PREFIX}mysqlclient_r libmysql ${INSTALL_LIBDIR})
+ INSTALL_SYMLINK(${CMAKE_SHARED_LIBRARY_PREFIX}mysqlclient_r libmysql ${INSTALL_LIBDIR} SharedLibraries)
ENDIF()
ENDIF()
diff --git a/libmysqld/CMakeLists.txt b/libmysqld/CMakeLists.txt
index 5c83db5f87c..b02510bda46 100644
--- a/libmysqld/CMakeLists.txt
+++ b/libmysqld/CMakeLists.txt
@@ -123,8 +123,9 @@ FOREACH(LIB ${LIBS})
ENDFOREACH()
MERGE_LIBRARIES(mysqlserver STATIC ${EMBEDDED_LIBS}
- OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME})
+ OUTPUT_NAME ${MYSQLSERVER_OUTPUT_NAME} COMPONENT Embedded)
IF(MSVC AND NOT DISABLE_SHARED)
- MERGE_LIBRARIES(libmysqld SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS})
+ MERGE_LIBRARIES(libmysqld SHARED ${LIBS} EXPORTS ${CLIENT_API_FUNCTIONS}
+ COMPONENT Embedded)
ENDIF()
diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt
index 75e7502751c..c00d5153d3e 100644
--- a/mysql-test/CMakeLists.txt
+++ b/mysql-test/CMakeLists.txt
@@ -16,6 +16,7 @@
INSTALL(
DIRECTORY .
DESTINATION ${INSTALL_MYSQLTESTDIR}
+ COMPONENT Test
PATTERN "var/" EXCLUDE
PATTERN "lib/My/SafeProcess" EXCLUDE
PATTERN "CPack" EXCLUDE
diff --git a/mysql-test/lib/My/SafeProcess/CMakeLists.txt b/mysql-test/lib/My/SafeProcess/CMakeLists.txt
index ec2a13b910c..f133528a44b 100644
--- a/mysql-test/lib/My/SafeProcess/CMakeLists.txt
+++ b/mysql-test/lib/My/SafeProcess/CMakeLists.txt
@@ -13,15 +13,18 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+SET(INSTALL_ARGS
+ DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess"
+ COMPONENT Test
+)
+
IF (WIN32)
- ADD_EXECUTABLE(my_safe_process safe_process_win.cc)
- ADD_EXECUTABLE(my_safe_kill safe_kill_win.cc)
+ MYSQL_ADD_EXECUTABLE(my_safe_process safe_process_win.cc ${INSTALL_ARGS})
+ MYSQL_ADD_EXECUTABLE(my_safe_kill safe_kill_win.cc ${INSTALL_ARGS})
ELSE()
- ADD_EXECUTABLE(my_safe_process safe_process.cc)
+ MYSQL_ADD_EXECUTABLE(my_safe_process safe_process.cc ${INSTALL_ARGS})
ENDIF()
-INSTALL(TARGETS my_safe_process DESTINATION "mysql-test/lib/My/SafeProcess")
-IF(WIN32)
- INSTALL(TARGETS my_safe_kill DESTINATION "mysql-test/lib/My/SafeProcess")
-ENDIF()
-INSTALL(FILES safe_process.pl Base.pm DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess")
+
+INSTALL(FILES safe_process.pl Base.pm DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess"
+COMPONENT Test)
diff --git a/packaging/WiX/AdminBackground.jpg b/packaging/WiX/AdminBackground.jpg
new file mode 100644
index 00000000000..847dc6cdbed
--- /dev/null
+++ b/packaging/WiX/AdminBackground.jpg
Binary files differ
diff --git a/packaging/WiX/AdminHeader.jpg b/packaging/WiX/AdminHeader.jpg
new file mode 100644
index 00000000000..6e2e33d404f
--- /dev/null
+++ b/packaging/WiX/AdminHeader.jpg
Binary files differ
diff --git a/packaging/WiX/CMakeLists.txt b/packaging/WiX/CMakeLists.txt
new file mode 100644
index 00000000000..1d1a82f7b1c
--- /dev/null
+++ b/packaging/WiX/CMakeLists.txt
@@ -0,0 +1,28 @@
+FIND_PATH(WIX_DIR heat.exe
+ $ENV{WIX_DIR}/bin
+ $ENV{ProgramFiles}/wix/bin
+ "$ENV{ProgramFiles}/Windows Installer XML v3.0/bin"
+ "$ENV{ProgramFiles}/Windows Installer XML v3.5/bin"
+)
+
+IF(NOT WIX_DIR)
+ MESSAGE(FATAL_ERROR "Cannot find wix")
+ENDIF()
+
+FIND_PROGRAM(HEAT_EXECUTABLE heat ${WIX_DIR})
+FIND_PROGRAM(CANDLE_EXECUTABLE candle ${WIX_DIR})
+FIND_PROGRAM(LIGHT_EXECUTABLE light ${WIX_DIR})
+
+
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/create_msi.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
+ @ONLY)
+IF(CMAKE_GENERATOR MATCHES "Visual Studio")
+ SET(CONFIG_PARAM "-DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_CFG_INTDIR}")
+ENDIF()
+ADD_CUSTOM_TARGET(
+ WIX_Installer
+ COMMAND set VS_UNICODE_OUTPUT=
+ COMMAND ${CMAKE_COMMAND} ${CONFIG_PARAM} -P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
+)
+
diff --git a/packaging/WiX/create_fragments.cmake b/packaging/WiX/create_fragments.cmake
new file mode 100644
index 00000000000..01e8a11c0cf
--- /dev/null
+++ b/packaging/WiX/create_fragments.cmake
@@ -0,0 +1,86 @@
+INCLUDE(${CMAKE_BINARY_DIR}/CPackConfig)
+
+FOREACH(comp ${COMPS})
+ SET(CMDS ${CMDS}
+ COMMAND set DESTDIR=testinstall/${comp}
+ COMMAND ${CMAKE_COMMAND}
+ -DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_CFG_INTDIR}
+ -DCMAKE_INSTALL_COMPONENT=${comp}
+ -DCMAKE_INSTALL_PREFIX=
+ -P ${CMAKE_BINARY_DIR}/cmake_install.cmake
+ )
+ENDFOREACH()
+
+MACRO(MAKE_WIX_IDENTIFIER str varname)
+ STRING(REPLACE "/" "." ${varname} "${str}")
+ STRING(REPLACE "-" "_" ${varname} "${${varname}}")
+ENDMACRO()
+
+FUNCTION(TRAVERSE_FILES dir topdir file file_comp dir_root)
+ FILE(GLOB all_files ${dir}/*)
+ IF(NOT all_files)
+ RETURN()
+ ENDIF()
+ FILE(RELATIVE_PATH dir_rel ${topdir} ${dir})
+ IF(dir_rel)
+ MAKE_DIRECTORY(${dir_root}/${dir_rel})
+ MAKE_WIX_IDENTIFIER("${dir_rel}" id)
+ FILE(APPEND ${file} "<DirectoryRef Id='directory.${id}'>\n")
+ ELSE()
+ FILE(APPEND ${file} "<DirectoryRef Id='INSTALLDIR'>\n")
+ ENDIF()
+
+ FOREACH(f ${all_files})
+ IF(NOT IS_DIRECTORY ${f})
+ FILE(RELATIVE_PATH rel ${topdir} ${f})
+ MAKE_WIX_IDENTIFIER("${rel}" id)
+ FILE(TO_NATIVE_PATH ${f} f_native)
+ FILE(APPEND ${file} " <Component Id='component.${id}' Guid='*'>\n")
+ FILE(APPEND ${file} " <File Id='file.${id}' KeyPath='yes' Source='${f_native}'/>\n")
+ FILE(APPEND ${file} " </Component>\n")
+ FILE(APPEND ${file_comp} " <ComponentRef Id='component.${id}'/>\n")
+ ENDIF()
+ ENDFOREACH()
+ FILE(APPEND ${file} "</DirectoryRef>\n")
+ FOREACH(f ${all_files})
+ IF(IS_DIRECTORY ${f})
+ TRAVERSE_FILES(${f} ${topdir} ${file} ${file_comp} ${dir_root})
+ ENDIF()
+ ENDFOREACH()
+ENDFUNCTION()
+
+FUNCTION(TRAVERSE_DIRECTORIES dir topdir file prefix)
+ FILE(RELATIVE_PATH rel ${topdir} ${dir})
+ IF(rel)
+ MAKE_WIX_IDENTIFIER("${rel}" id)
+ GET_FILENAME_COMPONENT(name ${dir} NAME)
+ FILE(APPEND ${file} "${prefix}<Directory Id='directory.${id}' Name='${name}'>\n")
+ ENDIF()
+ FILE(GLOB all_files ${dir}/*)
+ FOREACH(f ${all_files})
+ IF(IS_DIRECTORY ${f})
+ TRAVERSE_DIRECTORIES(${f} ${topdir} ${file} "${prefix} ")
+ ENDIF()
+ ENDFOREACH()
+ IF(rel)
+ FILE(APPEND ${file} "</Directory>\n")
+ ENDIF()
+ENDFUNCTION()
+
+
+GET_FILENAME_COMPONENT(abs . ABSOLUTE)
+FOREACH(d ${DIRS})
+ GET_FILENAME_COMPONENT(d ${d} ABSOLUTE)
+ GET_FILENAME_COMPONENT(d_name ${d} NAME)
+ FILE(WRITE
+ ${abs}/${d_name}.wxs "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\n<Fragment>\n")
+ FILE(WRITE
+ ${abs}/${d_name}_component_group.wxs "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\n<Fragment>\n<ComponentGroup Id='componentgroup.${d_name}'>\n")
+ TRAVERSE_FILES(${d} ${d} ${abs}/${d_name}.wxs ${abs}/${d_name}_component_group.wxs "${abs}/dirs")
+ FILE(APPEND ${abs}/${d_name}.wxs " </Fragment>\n</Wix>")
+ FILE(APPEND ${abs}/${d_name}_component_group.wxs "</ComponentGroup>\n</Fragment>\n</Wix>")
+ENDFOREACH()
+FILE(WRITE directories.wxs "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\n<Fragment>\n<DirectoryRef Id='INSTALLDIR'>\n")
+TRAVERSE_DIRECTORIES(${abs}/dirs ${abs}/dirs directories.wxs "")
+FILE(APPEND directories.wxs "</DirectoryRef>\n</Fragment>\n</Wix>\n")
+
diff --git a/packaging/WiX/create_msi.cmake.in b/packaging/WiX/create_msi.cmake.in
new file mode 100644
index 00000000000..13836d6d35f
--- /dev/null
+++ b/packaging/WiX/create_msi.cmake.in
@@ -0,0 +1,103 @@
+SET(CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@")
+SET(CMAKE_CURRENT_SOURCE_DIR "@CMAKE_CURRENT_SOURCE_DIR@")
+SET(CANDLE_EXECUTABLE "@CANDLE_EXECUTABLE@")
+SET(LIGHT_EXECUTABLE "@LIGHT_EXECUTABLE@")
+SET(CMAKE_COMMAND "@CMAKE_COMMAND@")
+SET(CMAKE_CFG_INTDIR "@CMAKE_CFG_INTDIR@")
+SET(ENV{VS_UNICODE_OUTPUT})
+INCLUDE(${CMAKE_BINARY_DIR}/CPackConfig.cmake)
+
+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_server.wxs.in
+ ${CMAKE_CURRENT_BINARY_DIR}/mysql_server.wxs)
+
+IF(CMAKE_INSTALL_CONFIG_NAME)
+ SET(CONFIG_PARAM "-DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_INSTALL_CONFIG_NAME}")
+ENDIF()
+
+FOREACH(comp ${CPACK_COMPONENTS_ALL})
+ SET(ENV{DESTDIR} testinstall/${comp})
+ SET(DIRS ${DIRS} testinstall/${comp})
+ EXECUTE_PROCESS(
+ COMMAND ${CMAKE_COMMAND} ${CONFIG_PARAM} -DCMAKE_INSTALL_COMPONENT=${comp}
+ -DCMAKE_INSTALL_PREFIX= -P ${CMAKE_BINARY_DIR}/cmake_install.cmake
+ )
+ENDFOREACH()
+
+MACRO(MAKE_WIX_IDENTIFIER str varname)
+ STRING(REPLACE "/" "." ${varname} "${str}")
+ STRING(REPLACE "-" "_" ${varname} "${${varname}}")
+ENDMACRO()
+
+FUNCTION(TRAVERSE_FILES dir topdir file file_comp dir_root)
+ FILE(GLOB all_files ${dir}/*)
+ IF(NOT all_files)
+ RETURN()
+ ENDIF()
+ FILE(RELATIVE_PATH dir_rel ${topdir} ${dir})
+ IF(dir_rel)
+ MAKE_DIRECTORY(${dir_root}/${dir_rel})
+ MAKE_WIX_IDENTIFIER("${dir_rel}" id)
+ FILE(APPEND ${file} "<DirectoryRef Id='directory.${id}'>\n")
+ ELSE()
+ FILE(APPEND ${file} "<DirectoryRef Id='INSTALLDIR'>\n")
+ ENDIF()
+
+ FOREACH(f ${all_files})
+ IF(NOT IS_DIRECTORY ${f})
+ FILE(RELATIVE_PATH rel ${topdir} ${f})
+ MAKE_WIX_IDENTIFIER("${rel}" id)
+ FILE(TO_NATIVE_PATH ${f} f_native)
+ FILE(APPEND ${file} " <Component Id='component.${id}' Guid='*'>\n")
+ FILE(APPEND ${file} " <File Id='file.${id}' KeyPath='yes' Source='${f_native}'/>\n")
+ FILE(APPEND ${file} " </Component>\n")
+ FILE(APPEND ${file_comp} " <ComponentRef Id='component.${id}'/>\n")
+ ENDIF()
+ ENDFOREACH()
+ FILE(APPEND ${file} "</DirectoryRef>\n")
+ FOREACH(f ${all_files})
+ IF(IS_DIRECTORY ${f})
+ TRAVERSE_FILES(${f} ${topdir} ${file} ${file_comp} ${dir_root})
+ ENDIF()
+ ENDFOREACH()
+ENDFUNCTION()
+
+FUNCTION(TRAVERSE_DIRECTORIES dir topdir file prefix)
+ FILE(RELATIVE_PATH rel ${topdir} ${dir})
+ IF(rel AND IS_DIRECTORY "${f}")
+ MAKE_WIX_IDENTIFIER("${rel}" id)
+ GET_FILENAME_COMPONENT(name ${dir} NAME)
+ FILE(APPEND ${file} "${prefix}<Directory Id='directory.${id}' Name='${name}'>\n")
+ ENDIF()
+ FILE(GLOB all_files ${dir}/*)
+ FOREACH(f ${all_files})
+ IF(IS_DIRECTORY ${f})
+ TRAVERSE_DIRECTORIES(${f} ${topdir} ${file} "${prefix} ")
+ ENDIF()
+ ENDFOREACH()
+ IF(rel AND IS_DIRECTORY "${f}")
+ FILE(APPEND ${file} "</Directory>\n")
+ ENDIF()
+ENDFUNCTION()
+
+
+GET_FILENAME_COMPONENT(abs . ABSOLUTE)
+FOREACH(d ${DIRS})
+ GET_FILENAME_COMPONENT(d ${d} ABSOLUTE)
+ GET_FILENAME_COMPONENT(d_name ${d} NAME)
+ FILE(WRITE
+ ${abs}/${d_name}.wxs "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\n<Fragment>\n")
+ FILE(WRITE
+ ${abs}/${d_name}_component_group.wxs "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\n<Fragment>\n<ComponentGroup Id='componentgroup.${d_name}'>\n")
+ TRAVERSE_FILES(${d} ${d} ${abs}/${d_name}.wxs ${abs}/${d_name}_component_group.wxs "${abs}/dirs")
+ FILE(APPEND ${abs}/${d_name}.wxs " </Fragment>\n</Wix>")
+ FILE(APPEND ${abs}/${d_name}_component_group.wxs "</ComponentGroup>\n</Fragment>\n</Wix>")
+ENDFOREACH()
+FILE(WRITE directories.wxs "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>\n<Fragment>\n<DirectoryRef Id='INSTALLDIR'>\n")
+TRAVERSE_DIRECTORIES(${abs}/dirs ${abs}/dirs directories.wxs "")
+FILE(APPEND directories.wxs "</DirectoryRef>\n</Fragment>\n</Wix>\n")
+
+EXECUTE_PROCESS(
+ COMMAND ${CANDLE_EXECUTABLE} *.wxs
+ COMMAND ${LIGHT_EXECUTABLE} -ext WixUIExtension *.wixobj -out ${CPACK_PACKAGE_FILE_NAME}.msi
+)
+
diff --git a/packaging/WiX/mysql_server.wxs.in b/packaging/WiX/mysql_server.wxs.in
new file mode 100644
index 00000000000..21f2a6256f3
--- /dev/null
+++ b/packaging/WiX/mysql_server.wxs.in
@@ -0,0 +1,40 @@
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Product Id="*" UpgradeCode="49EB7A6A-1CEF-4A1E-9E89-B9A4993963E3"
+ Name="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@" Version="@MAJOR_VERSION@.@MINOR_VERSION@.@PATCH@" Language="1033" Manufacturer="MySQL AB">
+ <Package Id='*' Keywords='Installer' Description="MySQL Database Server"
+ Manufacturer='MySQL AB'
+ InstallerVersion='310' Languages='1033' Compressed='yes' SummaryCodepage='1252' />
+ <Media Id='1' Cabinet='product.cab' EmbedCab='yes' />
+ <Directory Id='TARGETDIR' Name='SourceDir'>
+ <Directory Id='ProgramFilesFolder'>
+ <Directory Id='directory.MySQL' Name='MySQL'>
+ <Directory Id='INSTALLDIR' Name='MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@'>
+ </Directory>
+ </Directory>
+ </Directory>
+ </Directory>
+ <Directory Id="CommonAppDataFolder">
+ <Directory Id="directory.Data.MySQL" Name="MySQL">
+ <Directory Id="DATADIR" LongName="MySQL Server @MAJOR_VERSION@.@MINOR_VERSION@" src=".\">
+ <Directory Id="DATADIR" Name=".">
+ <!-- *****************************************************************************************
+ data directory
+ -->
+ <Directory Id="DataDir" Name="data">
+ <Directory Id="mysql" Name="mysql">
+ <Feature Id='Server' Level='1' Title="MySQL Server" Description="Install MySQL server" Display="expand">
+ <ComponentGroupRef Id='componentgroup.Server'/>
+ <Feature Level='1' Id='ClientPrograms' Title="Client Programs" Description="Various helpful (commandline) tools including the mysql command line client" >
+ <ComponentRef Id="componentgroup.Client" />
+ </Feature>
+ </Feature>
+ <Feature Id='Devel' Level='1' Title="Development Components"
+ Description="Installs C/C++ header files and libraries">
+ <ComponentGroupRef Id='componentgroup.Development' />
+ </Feature>
+ <UIRef Id="WixUI_FeatureTree" />
+ <UIRef Id="WixUI_ErrorProgressText" />
+ <WixVariable Id="WixUIBannerBmp" Value="@CMAKE_CURRENT_SOURCE_DIR@/AdminHeader.jpg" />
+ <WixVariable Id="WixUIDialogBmp" Value="@CMAKE_CURRENT_SOURCE_DIR@/AdminBackground.jpg" />
+ </Product>
+</Wix>
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index dd9c5785dcb..28b14661265 100755
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -66,7 +66,7 @@ INSTALL(FILES
${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables_data.sql
${CMAKE_CURRENT_SOURCE_DIR}/fill_help_tables.sql
${CMAKE_CURRENT_SOURCE_DIR}/mysql_test_data_timezone.sql
- DESTINATION ${INSTALL_MYSQLSHAREDIR}
+ DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Server
)
# TCMalloc hacks
@@ -166,12 +166,10 @@ ELSE()
SET(EXT ".pl")
ENDIF()
-INSTALL(FILES
+INSTALL_SCRIPT(
"${CMAKE_CURRENT_BINARY_DIR}/mysql_install_db${EXT}"
- DESTINATION ${DEST}
- PERMISSIONS OWNER_READ OWNER_WRITE
- OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE
+ DESTINATION ${INSTALL_BINDIR}
+ COMPONENT Server
)
@@ -260,29 +258,17 @@ IF(WIN32)
FOREACH(file ${PLIN_FILES})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.pl.in
${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY)
-
- INSTALL(FILES
- ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl
- DESTINATION scripts
- PERMISSIONS OWNER_READ OWNER_WRITE
- OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE
- )
+ INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl)
ENDFOREACH()
FOREACH(file ${SH_FILES})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh
${CMAKE_CURRENT_BINARY_DIR}/${file}.pl ESCAPE_QUOTES @ONLY)
- INSTALL(FILES
- ${CMAKE_CURRENT_BINARY_DIR}/${file}.pl
- DESTINATION scripts
- PERMISSIONS OWNER_READ OWNER_WRITE
- OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE
- )
+ INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl)
ENDFOREACH()
ELSE()
# On Unix, most of the files end up in the bin directory
+ SET(mysql_config_COMPONENT COMPONENT Development)
SET(BIN_SCRIPTS
msql2mysql
mysql_config
@@ -312,13 +298,14 @@ ELSE()
MESSAGE(FATAL_ERROR "Can not find ${file}.sh or ${file} in "
"${CMAKE_CURRENT_SOURCE_DIR}" )
ENDIF()
- INSTALL(FILES
- ${CMAKE_CURRENT_BINARY_DIR}/${file}
- DESTINATION ${INSTALL_BINDIR}
- PERMISSIONS OWNER_READ OWNER_WRITE
- OWNER_EXECUTE GROUP_READ GROUP_EXECUTE
- WORLD_READ WORLD_EXECUTE
- )
+ IF(NOT ${file}_COMPONENT)
+ SET(${file}_COMPONENT Server)
+ ENDIF()
+ INSTALL_SCRIPT(
+ ${CMAKE_CURRENT_BINARY_DIR}/${file}
+ DESTINATION ${INSTALL_BINDIR}
+ COMPONENT ${${file}_COMPONENT}
+ )
ENDFOREACH()
ENDIF()
@@ -333,7 +320,8 @@ IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_FLAGS MATCHES "-static")
ERROR_QUIET
)
IF(${RESULT} EQUAL 0 AND EXISTS ${LIBGCC_LOCATION})
- INSTALL(FILES "${LIBGCC_LOCATION}" DESTINATION ${INSTALL_LIBDIR})
+ INSTALL(FILES "${LIBGCC_LOCATION}" DESTINATION ${INSTALL_LIBDIR}
+ COMPONENT Development)
ENDIF()
ENDIF()
diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist
index 51271a3dad0..0cbbd5db283 100755
--- a/scripts/make_win_bin_dist
+++ b/scripts/make_win_bin_dist
@@ -158,7 +158,7 @@ cp tests/$TARGET/*.exe $DESTDIR/bin/
cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/
cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe
-cp sql/$TARGET/mysqld.map $DESTDIR/bin/mysqld$EXE_SUFFIX.map
+cp sql/$TARGET/mysqld.map $DESTDIR/bin/mysqld$EXE_SUFFIX.map || /bin/true
if [ x"$TARGET" != x"release" ] ; then
cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb
fi
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 85970ff5c0a..0c727626138 100755
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -100,7 +100,7 @@ ELSE()
SET(MYSQLD_SOURCE main.cc ${DTRACE_PROBES_ALL})
ENDIF()
-MYSQL_ADD_EXECUTABLE(mysqld ${MYSQLD_SOURCE} DESTINATION ${INSTALL_SBINDIR})
+MYSQL_ADD_EXECUTABLE(mysqld ${MYSQLD_SOURCE} DESTINATION ${INSTALL_SBINDIR} COMPONENT Server)
IF(NOT WITHOUT_DYNAMIC_PLUGINS)
SET_TARGET_PROPERTIES(mysqld PROPERTIES ENABLE_EXPORTS TRUE)
diff --git a/sql/share/CMakeLists.txt b/sql/share/CMakeLists.txt
index 944120cfc24..0d241928208 100644
--- a/sql/share/CMakeLists.txt
+++ b/sql/share/CMakeLists.txt
@@ -45,8 +45,8 @@ SET(files
FOREACH (dir ${dirs})
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}
- DESTINATION ${INSTALL_MYSQLSHAREDIR})
+ DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Server)
ENDFOREACH()
-INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/charsets DESTINATION ${INSTALL_MYSQLSHAREDIR})
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/charsets DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Server)
-INSTALL(FILES ${files} DESTINATION ${INSTALL_MYSQLSHAREDIR})
+INSTALL(FILES ${files} DESTINATION ${INSTALL_MYSQLSHAREDIR} COMPONENT Server)
diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt
index ff98a7dd885..906f516eac2 100644
--- a/support-files/CMakeLists.txt
+++ b/support-files/CMakeLists.txt
@@ -62,7 +62,7 @@ IF(UNIX)
INSTALL(FILES magic DESTINATION ${inst_location})
ENDIF()
- INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal)
+ INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development)
CONFIGURE_FILE(MySQL-shared-compat.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/MySQL-shared-compat.spec @ONLY)
CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql.spec @ONLY)
CONFIGURE_FILE(mysql.spec.sh ${CMAKE_CURRENT_BINARY_DIR}/mysql.${VERSION}.spec @ONLY)