Skip to content

Commit f94274a

Browse files
committed
cmake: Add WiX definitions for MSI packages and specify install components.
1 parent 4beeeb1 commit f94274a

19 files changed

+966
-13
lines changed

CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -576,16 +576,16 @@ set_target_properties(connector PROPERTIES
576576

577577
install(TARGETS connector
578578
CONFIGURATIONS Release RelWithDebInfo
579-
ARCHIVE DESTINATION "${INSTALL_LIB_DIR_STATIC}"
580-
RUNTIME DESTINATION "${INSTALL_LIB_DIR}"
581-
LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
579+
ARCHIVE DESTINATION "${INSTALL_LIB_DIR_STATIC}" COMPONENT XDevAPIDev
580+
RUNTIME DESTINATION "${INSTALL_LIB_DIR}" COMPONENT XDevAPIDll
581+
LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT XDevAPIDll
582582
)
583583

584584
install(TARGETS connector
585585
CONFIGURATIONS Debug
586-
ARCHIVE DESTINATION "${INSTALL_LIB_DIR_STATIC}/debug"
587-
RUNTIME DESTINATION "${INSTALL_LIB_DIR}/debug"
588-
LIBRARY DESTINATION "${INSTALL_LIB_DIR}/debug"
586+
ARCHIVE DESTINATION "${INSTALL_LIB_DIR_STATIC}/debug" COMPONENT XDevAPIDev
587+
RUNTIME DESTINATION "${INSTALL_LIB_DIR}/debug" COMPONENT XDevAPIDll
588+
LIBRARY DESTINATION "${INSTALL_LIB_DIR}/debug" COMPONENT XDevAPIDll
589589
)
590590

591591
if(MAINTAINER_MODE)
@@ -765,5 +765,6 @@ message("Connector libraries will be installed at: ${INSTALL_LIB_DIR}")
765765
option(WITH_PACKAGES "Configure for building binary/source packages" OFF)
766766
if(WITH_PACKAGES)
767767
include(PackageSpecs.cmake)
768+
ADD_SUBDIRECTORY(packaging/WiX)
768769
endif()
769770

PackageSpecs.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ foreach(file ${info_files})
148148
set(file_bin "${CMAKE_BINARY_DIR}/${file}${info_ext}")
149149

150150
configure_file("${file_src}" "${file_bin}" NEWLINE_STYLE ${newline})
151-
install(FILES "${file_bin}" DESTINATION .)
151+
install(FILES "${file_bin}" DESTINATION . COMPONENT Readme)
152152

153153
endforeach()
154154

buildinfo.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,4 @@ if(WITH_JDBC)
112112
endif()
113113

114114

115-
install(FILES "${PROJECT_BINARY_DIR}/BUILDINFO.txt" DESTINATION .)
115+
install(FILES "${PROJECT_BINARY_DIR}/BUILDINFO.txt" DESTINATION . COMPONENT Readme)

include/mysqlx/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ ADD_HEADERS_DIR(devapi)
3636
ADD_HEADERS(${headers})
3737
ADD_HEADER_CHECKS()
3838

39-
INSTALL(FILES ${headers} DESTINATION include/mysqlx)
39+
INSTALL(FILES ${headers} DESTINATION include/mysqlx COMPONENT XDevAPIDev)
4040

include/mysqlx/common/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ check_headers(${headers})
3232

3333
ADD_HEADERS(${headers})
3434
ADD_HEADER_CHECKS()
35-
INSTALL(FILES ${headers} DESTINATION include/mysqlx/common)
35+
INSTALL(FILES ${headers} DESTINATION include/mysqlx/common COMPONENT XDevAPIDev)

include/mysqlx/devapi/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ check_headers(${headers})
3535
ADD_HEADERS_DIR(detail)
3636
ADD_HEADERS(${headers})
3737
ADD_HEADER_CHECKS()
38-
INSTALL(FILES ${headers} DESTINATION "${INSTALL_INCLUDE_DIR}/mysqlx/devapi")
38+
INSTALL(FILES ${headers} DESTINATION "${INSTALL_INCLUDE_DIR}/mysqlx/devapi" COMPONENT XDevAPIDev)

include/mysqlx/devapi/detail/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ check_headers(${headers})
3333

3434
ADD_HEADERS(${headers})
3535
ADD_HEADER_CHECKS()
36-
INSTALL(FILES ${headers} DESTINATION include/mysqlx/devapi/detail)
36+
INSTALL(FILES ${headers} DESTINATION include/mysqlx/devapi/detail COMPONENT XDevAPIDev)

jdbc.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,14 @@ foreach(config ${configurations})
216216
FILES ${location}
217217
CONFIGURATIONS ${config}
218218
DESTINATION ${loc_static}
219+
COMPONENT JDBCDev
219220
)
220221

221222
else()
222223

223224
if(WIN32)
224225

225-
install(FILES ${location} CONFIGURATIONS ${config} DESTINATION ${loc})
226+
install(FILES ${location} CONFIGURATIONS ${config} DESTINATION ${loc} COMPONENT JDBCDll)
226227

227228
# install import library for the DLL
228229

@@ -232,6 +233,7 @@ foreach(config ${configurations})
232233
FILES ${imp_location}
233234
CONFIGURATIONS ${config}
234235
DESTINATION ${loc_static}
236+
COMPONENT JDBCDev
235237
)
236238

237239
else()
@@ -271,6 +273,7 @@ endforeach()
271273
install(
272274
DIRECTORY ${JDBC_DIR}/install/include/jdbc
273275
DESTINATION ${INSTALL_INCLUDE_DIR}
276+
COMPONENT JDBCDev
274277
)
275278

276279
#
@@ -309,6 +312,7 @@ if(BUNDLE_DEPENDENCIES AND WITH_SSL STREQUAL "bundled")
309312

310313
install(DIRECTORY "${MYSQL_DIR}/bin/" DESTINATION lib64
311314
FILES_MATCHING PATTERN "*${CMAKE_SHARED_LIBRARY_SUFFIX}"
315+
COMPONENT JDBCDev
312316
)
313317

314318
endif()

packaging/WiX/AdminBackground.jpg

20.1 KB
Loading

packaging/WiX/AdminHeader.jpg

3.39 KB
Loading

packaging/WiX/CMakeLists.txt

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
2+
#
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License, version 2.0,
5+
# as published by the Free Software Foundation.
6+
#
7+
# This program is also distributed with certain software (including
8+
# but not limited to OpenSSL) that is licensed under separate terms,
9+
# as designated in a particular file or component or in included license
10+
# documentation. The authors of MySQL hereby grant you an additional
11+
# permission to link the program and your derivative works with the
12+
# separately licensed software that they have included with MySQL.
13+
#
14+
# This program is distributed in the hope that it will be useful,
15+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# GNU General Public License, version 2.0, for more details.
18+
#
19+
# You should have received a copy of the GNU General Public License
20+
# along with this program; if not, write to the Free Software
21+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22+
23+
IF(NOT WIN32)
24+
RETURN()
25+
ENDIF()
26+
27+
include(wix_setup.cmake)
28+
29+
# WiX wants the license text as rtf; if there is no rtf license,
30+
# we create a fake one from the plain text LICENSE file.
31+
IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.rtf")
32+
SET(LICENSE_RTF "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.rtf")
33+
ELSE()
34+
SET(LICENSE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../../LICENSE.txt")
35+
FILE(READ ${LICENSE_FILE} CONTENTS)
36+
STRING(REGEX REPLACE "\n" "\\\\par\n" CONTENTS "${CONTENTS}")
37+
STRING(REGEX REPLACE "\t" "\\\\tab" CONTENTS "${CONTENTS}")
38+
FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.rtf" "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Courier New;}}\\viewkind4\\uc1\\pard\\lang1031\\f0\\fs15")
39+
FILE(APPEND "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.rtf" "${CONTENTS}")
40+
FILE(APPEND "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.rtf" "\n}\n")
41+
SET(LICENSE_RTF "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.rtf")
42+
ENDIF()
43+
# GET_TARGET_PROPERTY(WIXCA_LOCATION wixca LOCATION)
44+
# MESSAGE(STATUS "\nWIXCA_LOCATION ${WIXCA_LOCATION}\n")
45+
46+
SET(CPACK_WIX_CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/CPackWixConfig.cmake)
47+
SET(CPACK_WIX_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/custom_ui.wxs")
48+
SET(CPACK_MSI_SETUP ${CMAKE_CURRENT_SOURCE_DIR}/cpack_msi_setup.cmake)
49+
50+
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/create_msi.cmake.in
51+
${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
52+
@ONLY)
53+
54+
IF(CMAKE_GENERATOR MATCHES "Visual Studio")
55+
SET(CONFIG_PARAM "-DCMAKE_INSTALL_CONFIG_NAME=${CMAKE_CFG_INTDIR}")
56+
ENDIF()
57+
58+
ADD_CUSTOM_TARGET(
59+
MSI
60+
COMMAND set VS_UNICODE_OUTPUT=
61+
COMMAND ${CMAKE_COMMAND}
62+
${CONFIG_PARAM}
63+
-P ${CMAKE_CURRENT_BINARY_DIR}/create_msi.cmake
64+
)

packaging/WiX/CPackWixConfig.cmake

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
2+
#
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License, version 2.0,
5+
# as published by the Free Software Foundation.
6+
#
7+
# This program is also distributed with certain software (including
8+
# but not limited to OpenSSL) that is licensed under separate terms,
9+
# as designated in a particular file or component or in included license
10+
# documentation. The authors of MySQL hereby grant you an additional
11+
# permission to link the program and your derivative works with the
12+
# separately licensed software that they have included with MySQL.
13+
#
14+
# This program is distributed in the hope that it will be useful,
15+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# GNU General Public License, version 2.0, for more details.
18+
#
19+
# You should have received a copy of the GNU General Public License
20+
# along with this program; if not, write to the Free Software
21+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22+
23+
SET(CPACK_COMPONENTS_USED
24+
"XDevAPIDll;JDBCDll;XDevAPIDev;JDBCDev;Readme")
25+
26+
# Some components are optional
27+
# We will build MSI without optional components that are not selected for build
28+
#(need to modify CPACK_COMPONENTS_ALL for that)
29+
SET(CPACK_ALL)
30+
FOREACH(comp1 ${CPACK_COMPONENTS_USED})
31+
SET(found)
32+
FOREACH(comp2 ${CPACK_COMPONENTS_ALL})
33+
IF(comp1 STREQUAL comp2)
34+
SET(found 1)
35+
BREAK()
36+
ENDIF()
37+
ENDFOREACH()
38+
IF(found)
39+
SET(CPACK_ALL ${CPACK_ALL} ${comp1})
40+
ENDIF()
41+
ENDFOREACH()
42+
SET(CPACK_COMPONENTS_ALL ${CPACK_ALL})
43+
44+
# Always install (hidden), includes Readme files
45+
SET(CPACK_COMPONENT_GROUP_ALWAYSINSTALL_HIDDEN 1)
46+
SET(CPACK_COMPONENT_README_GROUP "AlwaysInstall")
47+
48+
# Feature Connector C++
49+
SET(CPACK_COMPONENT_GROUP_CONNECTORCPP_DISPLAY_NAME "Connector C++")
50+
SET(CPACK_COMPONENT_GROUP_CONNECTORCPP_EXPANDED "1")
51+
SET(CPACK_COMPONENT_GROUP_CONNECTORCPP_DESCRIPTION "Install MySQL Connector C++")
52+
# Subfeature "DLL Libraries"
53+
SET(CPACK_COMPONENT_GROUP_DLLLIBRARIES_GROUP "ConnectorCpp")
54+
SET(CPACK_COMPONENT_GROUP_DLLLIBRARIES_DISPLAY_NAME "Dll Libraries")
55+
SET(CPACK_COMPONENT_GROUP_DLLLIBRARIES_DESCRIPTION
56+
"Connector C++ dll libraries and depdnencies" )
57+
#Subfeature "New XDevAPI/XAPI connector"
58+
SET(CPACK_COMPONENT_XDEVAPIDLL_GROUP "DLLLibraries")
59+
SET(CPACK_COMPONENT_XDEVAPIDLL_DISPLAY_NAME "New XDevAPI/XAPI")
60+
SET(CPACK_COMPONENT_XDEVAPIDLL_DESCRIPTION "Installs new XDevAPI/XAPI dlls")
61+
#Subfeature "Legacy JDBC API connector"
62+
SET(CPACK_COMPONENT_JDBCDLL_GROUP "DLLLibraries")
63+
SET(CPACK_COMPONENT_JDBCDLL_DISPLAY_NAME "Legacy JDBC API connector")
64+
SET(CPACK_COMPONENT_JDBCDLL_DESCRIPTION "Installs legacy JDBC API connector dlls")
65+
SET(CPACK_COMPONENT_JDBCDLL_WIX_LEVEL 2)
66+
# Subfeature "Development Components"
67+
SET(CPACK_COMPONENT_GROUP_DEV_GROUP "ConnectorCpp")
68+
SET(CPACK_COMPONENT_GROUP_DEV_DISPLAY_NAME "Development Components")
69+
SET(CPACK_COMPONENT_GROUP_DEV_DESCRIPTION
70+
"Connector C++ headers, static libraries and import libraries" )
71+
#Subfeature "New XDevAPI/XAPI connector"
72+
SET(CPACK_COMPONENT_XDEVAPIDEV_GROUP "Dev")
73+
SET(CPACK_COMPONENT_XDEVAPIDEV_DISPLAY_NAME "New XDevAPI/XAPI")
74+
SET(CPACK_COMPONENT_XDEVAPIDEV_DESCRIPTION "Installs new XDevAPI/XAPI dev files")
75+
#Subfeature "Legacy JDBC API connector"
76+
SET(CPACK_COMPONENT_JDBCDEV_GROUP "Dev")
77+
SET(CPACK_COMPONENT_JDBCDEV_DISPLAY_NAME "Legacy JDBC API connector")
78+
SET(CPACK_COMPONENT_JDBCDEV_DESCRIPTION "Installs legacy JDBC API connector dev files")
79+
SET(CPACK_COMPONENT_JDBCDEV_WIX_LEVEL 2)
80+

packaging/WiX/MySQLConnector.ico

16.9 KB
Binary file not shown.

packaging/WiX/configure_file.cmake

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2+
#
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License, version 2.0,
5+
# as published by the Free Software Foundation.
6+
#
7+
# This program is also distributed with certain software (including
8+
# but not limited to OpenSSL) that is licensed under separate terms,
9+
# as designated in a particular file or component or in included license
10+
# documentation. The authors of MySQL hereby grant you an additional
11+
# permission to link the program and your derivative works with the
12+
# separately licensed software that they have included with MySQL.
13+
#
14+
# This program is distributed in the hope that it will be useful,
15+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
16+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+
# GNU General Public License, version 2.0, for more details.
18+
#
19+
# You should have received a copy of the GNU General Public License
20+
# along with this program; if not, write to the Free Software
21+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22+
23+
CONFIGURE_FILE(${INPUT_FILE} ${OUTPUT_FILE})

0 commit comments

Comments
 (0)