-
Notifications
You must be signed in to change notification settings - Fork 4k
/
Copy pathpaths.cmake
127 lines (118 loc) · 4.42 KB
/
paths.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Copyright (c) 2015, 2025, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is designed to work with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms,
# as designated in a particular file or component or in included license
# documentation. The authors of MySQL hereby grant you an additional
# permission to link the program and your derivative works with the
# separately licensed software that they have either included with
# the program or referenced in the documentation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# installed executable location (used in config.h)
IF(IS_ABSOLUTE "${ROUTER_INSTALL_BINDIR}")
SET(ROUTER_BINDIR ${ROUTER_INSTALL_BINDIR})
ELSE()
SET(ROUTER_BINDIR ${CMAKE_INSTALL_PREFIX}/${ROUTER_INSTALL_BINDIR})
ENDIF()
# Configuration folder (config_folder configuration option)
IF(WIN32)
SET(_configdir "ENV{APPDATA}")
ELSE()
IF(IS_ABSOLUTE ${ROUTER_INSTALL_CONFIGDIR})
SET(_configdir "${ROUTER_INSTALL_CONFIGDIR}")
ELSEIF(INSTALL_CONFIGDIR STREQUAL ".")
# Current working directory
SET(_configdir "${ROUTER_INSTALL_CONFIGDIR}")
ELSE()
SET(_configdir "${CMAKE_INSTALL_PREFIX}/${ROUTER_INSTALL_CONFIGDIR}")
ENDIF()
ENDIF()
SET(ROUTER_CONFIGDIR ${_configdir})
UNSET(_configdir)
# Logging folder (logging_folder configuration option)
IF(WIN32)
SET(_logdir "ENV{APPDATA}\\\\log")
ELSE()
# logging folder can be set to empty to log to console
IF(IS_ABSOLUTE "${ROUTER_INSTALL_LOGDIR}")
SET(_logdir ${ROUTER_INSTALL_LOGDIR})
ELSEIF(NOT ROUTER_INSTALL_LOGDIR)
SET(_logdir "/var/log/mysqlrouter/")
ELSE()
SET(_logdir ${CMAKE_INSTALL_PREFIX}/${ROUTER_INSTALL_LOGDIR})
ENDIF()
ENDIF()
SET(ROUTER_LOGDIR ${_logdir}
CACHE STRING "Location of log files; empty is console (logging_folder)")
UNSET(_logdir)
# Runtime folder (runtime_folder configuration option)
IF(WIN32)
SET(_runtimedir "ENV{APPDATA}")
ELSE()
IF(IS_ABSOLUTE "${ROUTER_INSTALL_RUNTIMEDIR}")
SET(_runtimedir ${ROUTER_INSTALL_RUNTIMEDIR})
ELSEIF(NOT ROUTER_INSTALL_RUNTIMEDIR)
SET(_runtimedir "/var/run/mysqlrouter/")
ELSE()
SET(_runtimedir ${CMAKE_INSTALL_PREFIX}/${ROUTER_INSTALL_RUNTIMEDIR})
ENDIF()
ENDIF()
SET(ROUTER_RUNTIMEDIR ${_runtimedir}
CACHE STRING "Location runtime files such as PID file (runtime_folder)")
UNSET(_runtimedir)
# Plugin folder (plugin_folder configuration option)
IF(IS_ABSOLUTE "${ROUTER_INSTALL_PLUGINDIR}")
SET(_plugindir ${ROUTER_INSTALL_PLUGINDIR})
ELSE()
SET(_plugindir ${CMAKE_INSTALL_PREFIX}/${ROUTER_INSTALL_PLUGINDIR})
ENDIF()
SET(ROUTER_PLUGINDIR ${_plugindir}
CACHE STRING "Location MySQL Router plugins (plugin_folder)")
UNSET(_plugindir)
# Data folder (data_folder configuration option)
IF(WIN32)
SET(_datadir "ENV{APPDATA}\\\\data")
ELSE()
IF(IS_ABSOLUTE "${ROUTER_INSTALL_DATADIR}")
SET(_datadir ${ROUTER_INSTALL_DATADIR})
ELSEIF(NOT ROUTER_INSTALL_DATADIR)
SET(_datadir "/var/lib/mysqlrouter/")
ELSE()
SET(_datadir "${CMAKE_INSTALL_PREFIX}/${ROUTER_INSTALL_DATADIR}")
ENDIF()
ENDIF()
SET(ROUTER_DATADIR ${_datadir}
CACHE STRING "Location of data files such as keyring file")
UNSET(_datadir)
IF(INSTALL_LAYOUT STREQUAL "STANDALONE")
SET(ROUTER_PLUGINDIR "{origin}/../${ROUTER_INSTALL_PLUGINDIR}")
SET(ROUTER_CONFIGDIR "{origin}/../${ROUTER_INSTALL_CONFIGDIR}")
SET(ROUTER_RUNTIMEDIR "{origin}/../${ROUTER_INSTALL_RUNTIMEDIR}")
SET(ROUTER_LOGDIR "{origin}/../${ROUTER_INSTALL_LOGDIR}")
SET(ROUTER_DATADIR "{origin}/../${ROUTER_INSTALL_DATADIR}")
ENDIF()
# Default configuration file locations (similar to MySQL Server)
IF(WIN32)
SET(CONFIG_FILE_LOCATIONS
"${ROUTER_CONFIGDIR}/${MYSQL_ROUTER_INI}"
"ENV{APPDATA}/${MYSQL_ROUTER_INI}"
)
ELSE()
SET(CONFIG_FILE_LOCATIONS
"${ROUTER_CONFIGDIR}/${MYSQL_ROUTER_INI}"
"ENV{HOME}/.${MYSQL_ROUTER_INI}"
)
ENDIF()
SET(CONFIG_FILES ${CONFIG_FILE_LOCATIONS})