| 1 |
cmake_policy(SET CMP0011 NEW) |
| 2 |
cmake_policy(SET CMP0057 NEW) |
| 3 |
|
| 4 |
# Add a component to component-group based install (compare to cmake_add_component) |
| 5 |
macro(add_component compname) |
| 6 |
if("${compname}" IN_LIST CPACK_COMPONENTS_ALL) |
| 7 |
list(APPEND COMPONENTS_INSTALL ${compname}) |
| 8 |
string(TOUPPER ${compname} _CPACK_ADDCOMP_UNAME) |
| 9 |
cmake_parse_arguments(CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME} |
| 10 |
"HIDDEN" |
| 11 |
"DISPLAY_NAME;DESCRIPTION;GROUP" |
| 12 |
"" |
| 13 |
${ARGN} |
| 14 |
) |
| 15 |
string(TOUPPER ${CPACK_COMPONENT_${_CPACK_ADDCOMP_UNAME}_GROUP} _UGROUP) |
| 16 |
if("${CPACK_COMPONENT_GROUP_${_UGROUP}_DISPLAY_NAME}" STREQUAL "") |
| 17 |
message(FATAL_ERROR "group not found for ${compname}") |
| 18 |
endif() |
| 19 |
else() |
| 20 |
message(STATUS "add_component : ignoring ${compname}, not in CPACK_COMPONENTS_ALL") |
| 21 |
endif() |
| 22 |
endmacro() |
| 23 |
|
| 24 |
# Add a group to component-group based install (compare to cmake_add_component_group) |
| 25 |
macro(add_component_group grpname) |
| 26 |
string(TOUPPER ${grpname} _CPACK_ADDGRP_UNAME) |
| 27 |
cmake_parse_arguments(CPACK_COMPONENT_GROUP_${_CPACK_ADDGRP_UNAME} |
| 28 |
"EXPANDED;HIDDEN" |
| 29 |
"DISPLAY_NAME;DESCRIPTION" |
| 30 |
"" |
| 31 |
${ARGN} |
| 32 |
) |
| 33 |
endmacro() |
| 34 |
|
| 35 |
message(STATUS "CPACK_COMPONENTS_ALL=${CPACK_COMPONENTS_ALL}") |
| 36 |
add_component_group(AlwaysInstall HIDDEN |
| 37 |
DISPLAY_NAME "AlwaysInstall" |
| 38 |
DESCRIPTION "Always installed components") |
| 39 |
|
| 40 |
foreach(c Readme Common VCCRT RuntimeDeps) |
| 41 |
add_component(${c} GROUP AlwaysInstall) |
| 42 |
endforeach() |
| 43 |
|
| 44 |
add_component_group(MySQLServer EXPANDED DISPLAY_NAME "MariaDB Server" DESCRIPTION "Install server") |
| 45 |
add_component(Server |
| 46 |
GROUP MySQLServer HIDDEN) |
| 47 |
add_component(Client |
| 48 |
GROUP MySQLServer DISPLAY_NAME "Client Programs" |
| 49 |
DESCRIPTION "Various helpful (commandline) tools including the command line client") |
| 50 |
add_component(Backup |
| 51 |
GROUP MySQLServer |
| 52 |
DISPLAY_NAME "Backup utilities" |
| 53 |
DESCRIPTION "Installs backup utilities(mariabackup and mbstream)") |
| 54 |
|
| 55 |
#Miscellaneous hidden components, part of server / or client programs |
| 56 |
foreach(comp connect-engine connect-engine-jdbc ClientPlugins aws-key-management rocksdb-engine |
| 57 |
hashicorp-key-management) |
| 58 |
add_component(${comp} GROUP MySQLServer HIDDEN) |
| 59 |
endforeach() |
| 60 |
|
| 61 |
add_component_group(Devel |
| 62 |
DISPLAY_NAME "Development components" |
| 63 |
DESCRIPTION "Installs C/C++ header files and libraries") |
| 64 |
add_component(Development |
| 65 |
GROUP Devel HIDDEN) |
| 66 |
add_component(SharedLibraries |
| 67 |
GROUP Devel |
| 68 |
DISPLAY_NAME "Client C API library (shared)" |
| 69 |
DESCRIPTION "Installs shared client library") |
| 70 |
|
| 71 |
include(${CMAKE_CURRENT_LIST_DIR}/ComponentsIgnore.cmake) |
| 72 |
set(KNOWN_COMPONENTS ${COMPONENTS_IGNORE} ${COMPONENTS_INSTALL}) |
| 73 |
foreach(c ${CPACK_COMPONENTS_ALL}) |
| 74 |
if(NOT (${c} IN_LIST KNOWN_COMPONENTS)) |
| 75 |
message(FATAL_ERROR "Component ${c} is not known. Either install it using add_component() macro \ |
| 76 |
or add to COMPONENTS_IGNORE list") |
| 77 |
endif() |
| 78 |
endforeach() |
| 79 |
|
| 80 |
set(CPACK_COMPONENTS_ALL ${COMPONENTS_INSTALL}) |
| 81 |
|
| 82 |
# Extra things beyong CMake components |
| 83 |
# DBInstance (running mysql_install_db.exe) |
| 84 |
set(WIX_FEATURE_MySQLServer_EXTRA_FEATURES "DBInstance;SharedClientServerComponents") |
| 85 |
|
| 86 |
# Firewall exception for mysqld.exe |
| 87 |
set(bin.mysqld.exe.FILE_EXTRA " |
| 88 |
<FirewallException Id='firewallexception.mysqld.exe' Name='[ProductName]' Scope='any' |
| 89 |
IgnoreFailure='yes' xmlns='http://schemas.microsoft.com/wix/FirewallExtension' |
| 90 |
/> |
| 91 |
") |
| 92 |
|