2011-06-30 17:46:53 +02:00
|
|
|
# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
|
2006-12-31 02:29:11 +01:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; version 2 of the License.
|
|
|
|
#
|
|
|
|
# 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
|
2010-08-12 17:19:57 +02:00
|
|
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2009-11-09 12:32:48 +01:00
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES(
|
|
|
|
${CMAKE_SOURCE_DIR}/include
|
|
|
|
${CMAKE_SOURCE_DIR}/sql
|
|
|
|
${CMAKE_SOURCE_DIR}/regex
|
|
|
|
${ZLIB_INCLUDE_DIR}
|
|
|
|
${SSL_INCLUDE_DIRS}
|
|
|
|
${CMAKE_BINARY_DIR}/sql
|
|
|
|
)
|
|
|
|
|
|
|
|
SET(GEN_SOURCES
|
2010-03-03 12:43:30 +01:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.h
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/sql_builtin.cc
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h
|
2006-08-14 23:45:48 +02:00
|
|
|
)
|
2006-01-31 14:52:16 +01:00
|
|
|
|
2009-11-09 12:32:48 +01:00
|
|
|
SET_SOURCE_FILES_PROPERTIES(${GEN_SOURCES} PROPERTIES GENERATED 1)
|
|
|
|
|
|
|
|
ADD_DEFINITIONS(-DMYSQL_SERVER -DHAVE_EVENT_SCHEDULER)
|
|
|
|
IF(SSL_DEFINES)
|
|
|
|
ADD_DEFINITIONS(${SSL_DEFINES})
|
|
|
|
ENDIF()
|
2006-03-27 23:19:56 +02:00
|
|
|
|
2006-01-31 14:52:16 +01:00
|
|
|
|
2009-06-10 10:59:49 +02:00
|
|
|
SET (SQL_SOURCE
|
2010-02-16 23:19:47 +01:00
|
|
|
../sql-common/client.c derror.cc des_key_file.cc
|
2008-06-18 18:17:15 +02:00
|
|
|
discover.cc ../libmysql/errmsg.c field.cc field_conv.cc
|
Backport of:
ChangeSet@1.2703, 2007-12-07 09:35:28-05:00, cmiller@zippy.cornsilk.net +40 -0
Bug#13174: SHA2 function
Patch contributed from Bill Karwin, paper unnumbered CLA in Seattle
Implement SHA2 functions.
Chad added code to make it work with YaSSL. Also, he removed the
(probable) bug of embedded server never using SSL-dependent
functions. (libmysqld/Makefile.am didn't read ANY autoconf defs.)
Function specification:
SHA2( string cleartext, integer hash_length )
-> string hash, or NULL
where hash_length is one of 224, 256, 384, or 512. If either is
NULL or a length is unsupported, then the result is NULL. The
resulting string is always the length of the hash_length parameter
or is NULL.
Include the canonical hash examples from the NIST in the test
results.
---
Polish and address concerns of reviewers.
2010-04-13 17:04:45 +02:00
|
|
|
filesort.cc gstream.cc sha2.cc
|
2010-07-25 19:30:18 +02:00
|
|
|
handler.cc hash_filo.h sql_plugin_services.h
|
2006-03-28 18:05:25 +02:00
|
|
|
hostname.cc init.cc item.cc item_buff.cc item_cmpfunc.cc
|
|
|
|
item_create.cc item_func.cc item_geofunc.cc item_row.cc
|
|
|
|
item_strfunc.cc item_subselect.cc item_sum.cc item_timefunc.cc
|
2010-04-27 11:37:46 +02:00
|
|
|
key.cc log.cc lock.cc
|
2007-06-12 09:38:30 +02:00
|
|
|
log_event.cc rpl_record.cc rpl_reporting.cc
|
2007-04-12 15:50:54 +02:00
|
|
|
log_event_old.cc rpl_record_old.cc
|
2006-03-28 18:05:25 +02:00
|
|
|
message.h mf_iocache.cc my_decimal.cc ../sql-common/my_time.c
|
2009-12-22 10:35:56 +01:00
|
|
|
mysqld.cc net_serv.cc keycaches.cc
|
2010-08-09 10:32:50 +02:00
|
|
|
../sql-common/client_plugin.c
|
2010-02-16 23:58:15 +01:00
|
|
|
opt_range.cc opt_range.h opt_sum.cc
|
2006-03-28 18:05:25 +02:00
|
|
|
../sql-common/pack.c parse_file.cc password.c procedure.cc
|
|
|
|
protocol.cc records.cc repl_failsafe.cc rpl_filter.cc set_var.cc
|
|
|
|
slave.cc sp.cc sp_cache.cc sp_head.cc sp_pcontext.cc
|
|
|
|
sp_rcontext.cc spatial.cc sql_acl.cc sql_analyse.cc sql_base.cc
|
|
|
|
sql_cache.cc sql_class.cc sql_client.cc sql_crypt.cc sql_crypt.h
|
|
|
|
sql_cursor.cc sql_db.cc sql_delete.cc sql_derived.cc sql_do.cc
|
|
|
|
sql_error.cc sql_handler.cc sql_help.cc sql_insert.cc sql_lex.cc
|
2010-07-23 22:14:35 +02:00
|
|
|
sql_list.cc sql_load.cc sql_manager.cc sql_parse.cc
|
2006-03-28 18:05:25 +02:00
|
|
|
sql_partition.cc sql_plugin.cc sql_prepare.cc sql_rename.cc
|
2009-09-29 17:38:40 +02:00
|
|
|
debug_sync.cc debug_sync.h
|
2006-03-28 18:05:25 +02:00
|
|
|
sql_repl.cc sql_select.cc sql_show.cc sql_state.c sql_string.cc
|
|
|
|
sql_table.cc sql_test.cc sql_trigger.cc sql_udf.cc sql_union.cc
|
|
|
|
sql_update.cc sql_view.cc strfunc.cc table.cc thr_malloc.cc
|
2010-03-31 16:05:33 +02:00
|
|
|
sql_time.cc tztime.cc uniques.cc unireg.cc item_xmlfunc.cc
|
2006-06-27 08:48:50 +02:00
|
|
|
rpl_tblmap.cc sql_binlog.cc event_scheduler.cc event_data_objects.cc
|
|
|
|
event_queue.cc event_db_repository.cc
|
2006-06-08 23:07:11 +02:00
|
|
|
sql_tablespace.cc events.cc ../sql-common/my_user.c
|
2006-09-11 10:19:11 +02:00
|
|
|
partition_info.cc rpl_utility.cc rpl_injector.cc sql_locale.cc
|
2009-12-15 20:52:47 +01:00
|
|
|
rpl_rli.cc rpl_mi.cc sql_servers.cc sql_audit.cc
|
2010-08-16 14:53:30 +02:00
|
|
|
sql_connect.cc scheduler.cc sql_partition_admin.cc
|
2010-08-16 16:25:23 +02:00
|
|
|
sql_profile.cc event_parse_data.cc sql_alter.cc
|
|
|
|
sql_signal.cc rpl_handler.cc mdl.cc sql_admin.cc
|
2010-05-25 22:01:38 +02:00
|
|
|
transaction.cc sys_vars.cc sql_truncate.cc datadict.cc
|
2010-08-13 11:51:48 +02:00
|
|
|
sql_reload.cc
|
2009-12-01 12:00:50 +01:00
|
|
|
${GEN_SOURCES}
|
2009-11-09 12:32:48 +01:00
|
|
|
${MYSYS_LIBWRAP_SOURCE})
|
|
|
|
|
2009-12-23 16:37:22 +01:00
|
|
|
MYSQL_ADD_PLUGIN(partition ha_partition.cc STORAGE_ENGINE DEFAULT STATIC_ONLY
|
|
|
|
RECOMPILE_FOR_EMBEDDED)
|
2009-12-01 12:00:50 +01:00
|
|
|
|
2009-12-11 15:51:39 +01:00
|
|
|
ADD_LIBRARY(sql STATIC ${SQL_SOURCE})
|
2010-08-09 21:47:26 +02:00
|
|
|
ADD_DEPENDENCIES(sql GenServerSource)
|
2009-12-11 15:51:39 +01:00
|
|
|
DTRACE_INSTRUMENT(sql)
|
|
|
|
TARGET_LINK_LIBRARIES(sql ${MYSQLD_STATIC_PLUGIN_LIBS}
|
|
|
|
mysys dbug strings vio regex
|
|
|
|
${LIBWRAP} ${LIBCRYPT} ${LIBDL}
|
|
|
|
${SSL_LIBRARIES})
|
|
|
|
|
|
|
|
|
2009-11-09 12:32:48 +01:00
|
|
|
|
|
|
|
IF(WIN32)
|
2010-04-29 22:33:06 +02:00
|
|
|
SET(MYSQLD_SOURCE main.cc nt_servc.cc nt_servc.h message.rc)
|
2009-11-09 12:32:48 +01:00
|
|
|
ELSE()
|
2009-12-11 15:51:39 +01:00
|
|
|
SET(MYSQLD_SOURCE main.cc ${DTRACE_PROBES_ALL})
|
|
|
|
ENDIF()
|
|
|
|
|
2010-02-10 20:23:24 +01:00
|
|
|
MYSQL_ADD_EXECUTABLE(mysqld ${MYSQLD_SOURCE} DESTINATION ${INSTALL_SBINDIR} COMPONENT Server)
|
2009-11-09 12:32:48 +01:00
|
|
|
|
|
|
|
IF(NOT WITHOUT_DYNAMIC_PLUGINS)
|
|
|
|
SET_TARGET_PROPERTIES(mysqld PROPERTIES ENABLE_EXPORTS TRUE)
|
2009-12-18 23:53:30 +01:00
|
|
|
GET_TARGET_PROPERTY(mysqld_link_flags mysqld LINK_FLAGS)
|
2009-12-25 03:22:23 +01:00
|
|
|
IF(NOT mysqld_link_flags)
|
|
|
|
SET(mysqld_link_flags)
|
|
|
|
ENDIF()
|
2009-11-09 12:32:48 +01:00
|
|
|
IF (MINGW OR CYGWIN)
|
2009-12-25 03:22:23 +01:00
|
|
|
SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_FLAGS "${mysqld_link_flags} -Wl,--export-all-symbols")
|
2009-11-09 12:32:48 +01:00
|
|
|
ENDIF()
|
|
|
|
IF(MSVC)
|
|
|
|
# Set module definition file. Also use non-incremental linker,
|
|
|
|
# incremental appears to crash from time to time,if used with /DEF option
|
2009-12-18 23:53:30 +01:00
|
|
|
SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_FLAGS "${mysqld_link_flags} /DEF:mysqld.def /INCREMENTAL:NO")
|
2009-11-09 12:32:48 +01:00
|
|
|
|
2009-12-01 12:00:50 +01:00
|
|
|
FOREACH (CORELIB sql mysys dbug strings)
|
2009-11-09 12:32:48 +01:00
|
|
|
GET_TARGET_PROPERTY(LOC ${CORELIB} LOCATION)
|
|
|
|
FILE(TO_NATIVE_PATH ${LOC} LOC)
|
|
|
|
SET (LIB_LOCATIONS ${LIB_LOCATIONS} ${LOC})
|
|
|
|
ENDFOREACH (CORELIB ${MYSQLD_CORE_LIBS})
|
2010-01-28 11:09:05 +01:00
|
|
|
SET(_PLATFORM x86)
|
|
|
|
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
SET(_PLATFORM x64)
|
|
|
|
ENDIF()
|
2009-11-09 12:32:48 +01:00
|
|
|
ADD_CUSTOM_COMMAND(TARGET mysqld PRE_LINK
|
2010-01-28 11:09:05 +01:00
|
|
|
COMMAND echo ${_PLATFORM} && cscript ARGS //nologo ${PROJECT_SOURCE_DIR}/win/create_def_file.js
|
|
|
|
${_PLATFORM} ${LIB_LOCATIONS} > mysqld.def
|
2009-11-09 12:32:48 +01:00
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
ADD_DEPENDENCIES(sql GenError)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
SET_TARGET_PROPERTIES(mysqld PROPERTIES ENABLE_EXPORTS TRUE)
|
2011-01-03 14:08:48 +01:00
|
|
|
TARGET_LINK_LIBRARIES(mysqld sql mysys)
|
2010-01-13 21:56:51 +01:00
|
|
|
|
2009-12-08 03:12:23 +01:00
|
|
|
# Provide plugins with minimal set of libraries
|
|
|
|
SET(INTERFACE_LIBS ${LIBRT})
|
|
|
|
IF(INTERFACE_LIBS)
|
|
|
|
SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_INTERFACE_LIBRARIES
|
|
|
|
"${INTERFACE_LIBS}")
|
|
|
|
ENDIF()
|
|
|
|
|
2009-12-11 19:33:00 +01:00
|
|
|
# On Solaris, some extra effort is required in order to get dtrace probes
|
|
|
|
# from static libraries
|
|
|
|
DTRACE_INSTRUMENT_STATIC_LIBS(mysqld
|
|
|
|
"sql;mysys;${MYSQLD_STATIC_PLUGIN_LIBS}")
|
2009-12-12 02:03:05 +01:00
|
|
|
|
2009-11-09 12:32:48 +01:00
|
|
|
|
2010-01-14 00:09:40 +01:00
|
|
|
SET(WITH_MYSQLD_LDFLAGS "" CACHE STRING "Additional linker flags for mysqld")
|
|
|
|
MARK_AS_ADVANCED(WITH_MYSQLD_LDFLAGS)
|
|
|
|
IF(WITH_MYSQLD_LDFLAGS)
|
2010-01-13 21:56:51 +01:00
|
|
|
GET_TARGET_PROPERTY(mysqld LINK_FLAGS MYSQLD_LINK_FLAGS)
|
|
|
|
IF(NOT MYSQLD_LINK_FLAGS)
|
|
|
|
SET(MYSQLD_LINK_FLAGS)
|
|
|
|
ENDIF()
|
|
|
|
SET_TARGET_PROPERTIES(mysqld PROPERTIES LINK_FLAGS
|
2010-01-14 00:09:40 +01:00
|
|
|
"${MYSQLD_LINK_FLAGS} ${WITH_MYSQLD_LDFLAGS}")
|
2010-01-13 21:56:51 +01:00
|
|
|
ENDIF()
|
2010-06-30 14:10:29 +02:00
|
|
|
INSTALL_DEBUG_TARGET(mysqld
|
|
|
|
DESTINATION ${INSTALL_SBINDIR}
|
|
|
|
PDB_DESTINATION ${INSTALL_SBINDIR}/debug
|
|
|
|
RENAME mysqld-debug)
|
2010-01-13 21:56:51 +01:00
|
|
|
|
2009-11-09 12:32:48 +01:00
|
|
|
# Handle out-of-source build from source package with possibly broken
|
|
|
|
# bison. Copy bison output to from source to build directory, if not already
|
|
|
|
# there
|
|
|
|
IF (NOT ${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/sql_yacc.cc)
|
|
|
|
IF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc)
|
|
|
|
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/sql_yacc.cc
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc COPYONLY)
|
|
|
|
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/sql_yacc.h
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.h COPYONLY)
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
|
|
|
|
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/bison.cmake)
|
|
|
|
RUN_BISON(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/sql_yacc.yy
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.cc
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.h
|
|
|
|
)
|
2009-06-10 10:59:49 +02:00
|
|
|
|
2009-11-09 12:32:48 +01:00
|
|
|
# Gen_lex_hash
|
|
|
|
ADD_EXECUTABLE(gen_lex_hash gen_lex_hash.cc)
|
2006-01-31 14:52:16 +01:00
|
|
|
|
|
|
|
ADD_CUSTOM_COMMAND(
|
2009-11-09 12:32:48 +01:00
|
|
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h
|
2010-07-25 19:30:18 +02:00
|
|
|
COMMAND gen_lex_hash > lex_hash.h
|
2010-08-09 21:47:26 +02:00
|
|
|
DEPENDS gen_lex_hash
|
2010-07-25 19:30:18 +02:00
|
|
|
)
|
2010-02-24 20:19:24 +01:00
|
|
|
|
|
|
|
MYSQL_ADD_EXECUTABLE(mysql_tzinfo_to_sql tztime.cc)
|
|
|
|
SET_TARGET_PROPERTIES(mysql_tzinfo_to_sql PROPERTIES COMPILE_FLAGS "-DTZINFO2SQL")
|
2010-07-25 19:30:18 +02:00
|
|
|
TARGET_LINK_LIBRARIES(mysql_tzinfo_to_sql mysys)
|
2010-02-24 20:19:24 +01:00
|
|
|
|
2009-11-09 12:32:48 +01:00
|
|
|
ADD_CUSTOM_TARGET(
|
|
|
|
GenServerSource
|
|
|
|
DEPENDS ${GEN_SOURCES}
|
|
|
|
)
|
2006-01-31 14:52:16 +01:00
|
|
|
|
2009-11-09 12:32:48 +01:00
|
|
|
#Need this only for embedded
|
|
|
|
SET_TARGET_PROPERTIES(GenServerSource PROPERTIES EXCLUDE_FROM_ALL TRUE)
|
|
|
|
|
2009-11-25 05:13:51 +01:00
|
|
|
IF(WIN32 OR HAVE_DLOPEN AND NOT DISABLE_SHARED)
|
2009-11-09 12:32:48 +01:00
|
|
|
ADD_LIBRARY(udf_example MODULE udf_example.c)
|
|
|
|
SET_TARGET_PROPERTIES(udf_example PROPERTIES PREFIX "")
|
|
|
|
# udf_example depends on strings
|
|
|
|
IF(WIN32)
|
|
|
|
IF(MSVC)
|
|
|
|
SET_TARGET_PROPERTIES(udf_example PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_SOURCE_DIR}/udf_example.def")
|
|
|
|
ENDIF()
|
|
|
|
TARGET_LINK_LIBRARIES(udf_example strings)
|
2009-11-09 19:14:33 +01:00
|
|
|
ELSE()
|
|
|
|
# udf_example is using safemutex exported by mysqld
|
|
|
|
TARGET_LINK_LIBRARIES(udf_example mysqld)
|
2009-11-09 12:32:48 +01:00
|
|
|
ENDIF()
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
FOREACH(tool glibtoolize libtoolize aclocal autoconf autoheader automake gtar
|
|
|
|
tar bzr)
|
|
|
|
STRING(TOUPPER ${tool} TOOL)
|
|
|
|
FIND_PROGRAM(${TOOL}_EXECUTABLE ${tool} DOC "path to the executable")
|
|
|
|
MARK_AS_ADVANCED(${TOOL}_EXECUTABLE)
|
|
|
|
ENDFOREACH()
|
|
|
|
|
|
|
|
CONFIGURE_FILE(
|
|
|
|
${CMAKE_SOURCE_DIR}/cmake/make_dist.cmake.in ${CMAKE_BINARY_DIR}/make_dist.cmake @ONLY)
|
|
|
|
|
|
|
|
ADD_CUSTOM_TARGET(dist
|
|
|
|
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/make_dist.cmake
|
|
|
|
DEPENDS ${CMAKE_BINARY_DIR}/sql/sql_yacc.cc ${CMAKE_BINARY_DIR}/sql/sql_yacc.h
|
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
|
|
|
)
|
2006-01-31 14:52:16 +01:00
|
|
|
|
2010-03-03 12:29:34 +01:00
|
|
|
ADD_CUSTOM_TARGET(distclean
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo WARNING: distclean target is not functional
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo Use 'bzr clean-tree' with --unknown and/or
|
|
|
|
--ignored parameter instead
|
|
|
|
VERBATIM
|
|
|
|
)
|
2009-11-09 12:32:48 +01:00
|
|
|
|
2010-01-24 16:23:16 +01:00
|
|
|
IF(INSTALL_LAYOUT STREQUAL "STANDALONE")
|
2009-11-09 12:32:48 +01:00
|
|
|
|
|
|
|
# We need to create empty directories (data/test) the installation.
|
|
|
|
# This does not work with current CPack due to http://www.cmake.org/Bug/view.php?id=8767
|
|
|
|
# Avoid completely empty directories and install dummy file instead.
|
|
|
|
SET(DUMMY_FILE ${CMAKE_CURRENT_BINARY_DIR}/.empty )
|
|
|
|
FILE(WRITE ${DUMMY_FILE} "")
|
2010-02-16 16:06:57 +01:00
|
|
|
INSTALL(FILES ${DUMMY_FILE} DESTINATION data/test COMPONENT DataFiles)
|
2009-11-09 12:32:48 +01:00
|
|
|
|
|
|
|
# Install initial database on windows
|
|
|
|
IF(NOT CMAKE_CROSSCOMPILING)
|
|
|
|
GET_TARGET_PROPERTY(MYSQLD_EXECUTABLE mysqld LOCATION)
|
|
|
|
ENDIF()
|
|
|
|
IF(WIN32 AND MYSQLD_EXECUTABLE)
|
|
|
|
CONFIGURE_FILE(
|
|
|
|
${CMAKE_SOURCE_DIR}/cmake/create_initial_db.cmake.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/create_initial_db.cmake
|
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
|
2009-11-16 14:45:06 +01:00
|
|
|
IF(MSVC_IDE OR CMAKE_GENERATOR MATCHES "Xcode")
|
|
|
|
SET (CONFIG_PARAM -DCONFIG=${CMAKE_CFG_INTDIR})
|
|
|
|
ENDIF()
|
2009-11-09 12:32:48 +01:00
|
|
|
MAKE_DIRECTORY(${CMAKE_CURRENT_BINARY_DIR}/data)
|
|
|
|
ADD_CUSTOM_COMMAND(
|
2010-08-05 18:38:24 +02:00
|
|
|
OUTPUT initdb.dep
|
2009-11-16 14:45:06 +01:00
|
|
|
COMMAND ${CMAKE_COMMAND}
|
2009-12-23 16:37:22 +01:00
|
|
|
${CONFIG_PARAM} -P ${CMAKE_CURRENT_BINARY_DIR}/create_initial_db.cmake
|
2009-11-09 12:32:48 +01:00
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data
|
2010-08-31 13:06:56 +02:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/initdb.dep
|
2009-11-09 12:32:48 +01:00
|
|
|
DEPENDS mysqld
|
|
|
|
)
|
|
|
|
ADD_CUSTOM_TARGET(initial_database
|
|
|
|
ALL
|
2010-08-05 18:38:24 +02:00
|
|
|
DEPENDS initdb.dep
|
2009-11-09 12:32:48 +01:00
|
|
|
)
|
2010-08-05 18:38:24 +02:00
|
|
|
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/data DESTINATION .
|
|
|
|
COMPONENT DataFiles PATTERN "initdb.dep" EXCLUDE PATTERN "bootstrap.sql" EXCLUDE)
|
2009-11-09 12:32:48 +01:00
|
|
|
ELSE()
|
|
|
|
# Not windows or cross compiling, just install an empty directory
|
2010-11-13 23:16:52 +01:00
|
|
|
INSTALL(FILES ${DUMMY_FILE} DESTINATION data/mysql COMPONENT DataFiles)
|
2009-11-09 19:14:33 +01:00
|
|
|
ENDIF()
|
2010-01-24 16:23:16 +01:00
|
|
|
ENDIF()
|
|
|
|
|
2010-11-20 15:47:50 +01:00
|
|
|
ADD_CUSTOM_TARGET(show-dist-name
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E echo "${CPACK_PACKAGE_FILE_NAME}"
|
|
|
|
)
|
|
|
|
|