1
# Copyright (C) 2006 MySQL AB
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; version 2 of the License.
7
# This program is distributed in the hope that it will be useful,
8
# but WITHOUT ANY WARRANTY; without even the implied warranty of
9
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
# GNU General Public License for more details.
12
# You should have received a copy of the GNU General Public License
13
# along with this program; if not, write to the Free Software
14
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16
# Build mysql_fix_privilege_tables.sql
17
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql
19
mysql_system_tables.sql + mysql_system_tables_fix.sql
20
mysql_fix_privilege_tables.sql
22
${PROJECT_SOURCE_DIR}/scripts/mysql_system_tables.sql
23
${PROJECT_SOURCE_DIR}/scripts/mysql_system_tables_fix.sql)
25
# Build comp_sql - used for embedding SQL in C or C++ programs
26
ADD_EXECUTABLE(comp_sql comp_sql.c)
27
TARGET_LINK_LIBRARIES(comp_sql debug dbug mysys strings)
29
# Use comp_sql to build mysql_fix_privilege_tables_sql.c
30
GET_TARGET_PROPERTY(COMP_SQL_EXE comp_sql LOCATION)
32
ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c
33
COMMAND ${COMP_SQL_EXE}
34
mysql_fix_privilege_tables
35
mysql_fix_privilege_tables.sql
36
mysql_fix_privilege_tables_sql.c
37
DEPENDS comp_sql ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables.sql)
39
# Add dummy target for the above to be built
40
ADD_CUSTOM_TARGET(GenFixPrivs
42
DEPENDS ${PROJECT_SOURCE_DIR}/scripts/mysql_fix_privilege_tables_sql.c)
44
# ----------------------------------------------------------------------
45
# Replace some variables @foo@ in the .in/.sh file, and write the new script
46
# ----------------------------------------------------------------------
48
SET(CFLAGS "-D_WINDOWS ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
49
SET(prefix "${CMAKE_INSTALL_PREFIX}/MySQL Server ${MYSQL_BASE_VERSION}")
50
SET(sysconfdir ${prefix})
51
SET(bindir ${prefix}/bin)
52
SET(libexecdir ${prefix}/bin)
53
SET(scriptdir ${prefix}/bin)
54
SET(datadir ${prefix}/share)
55
SET(pkgdatadir ${prefix}/share)
56
SET(localstatedir ${prefix}/data)
58
CONFIGURE_FILE(mysql_config.pl.in
59
scripts/mysql_config.pl ESCAPE_QUOTES @ONLY)
61
CONFIGURE_FILE(mysql_convert_table_format.sh
62
scripts/mysql_convert_table_format.pl ESCAPE_QUOTES @ONLY)
64
CONFIGURE_FILE(mysql_install_db.pl.in
65
scripts/mysql_install_db.pl ESCAPE_QUOTES @ONLY)
67
CONFIGURE_FILE(mysql_secure_installation.pl.in
68
scripts/mysql_secure_installation.pl ESCAPE_QUOTES @ONLY)
70
CONFIGURE_FILE(mysqld_multi.sh
71
scripts/mysqld_multi.pl ESCAPE_QUOTES @ONLY)
73
CONFIGURE_FILE(mysqldumpslow.sh
74
scripts/mysqldumpslow.pl ESCAPE_QUOTES @ONLY)
76
CONFIGURE_FILE(mysqlhotcopy.sh
77
scripts/mysqlhotcopy.pl ESCAPE_QUOTES @ONLY)