summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladislav Vaintroub <vvaintroub@mysql.com>2010-03-03 12:29:34 +0100
committerVladislav Vaintroub <vvaintroub@mysql.com>2010-03-03 12:29:34 +0100
commitcd03a4625fbf481deeb6c32c8cb6ff74d900098b (patch)
treecb883ffd7d056d99712bf0a248cbb068e96287d5
parent0139908c7ebcec8b40255c5d38c8c2583ed0f1c1 (diff)
downloadmariadb-git-cd03a4625fbf481deeb6c32c8cb6ff74d900098b.tar.gz
Bug #51488 :missing features and change behavior in cmake runs compared to
autotools runs - Fix recognition of --with-debug=full in configure wrapper - Remove CMakeCache.txt in configure wrapper, to match the original - Fix recognition of max-no-ndb - Fix broken dependencies of mysql_fix_privilege_table.sql from mysql_system_tables.sql and mysql_system_tables_fix.sql - Add "distclean target" that informs user about appropriate bzr command cmake/configure.pl: - Recognize --with-debug=full, map to WITH_DEBUG_FULL - remove CMakeCache.txt, so the configuration is no more sticky (to match the original configure behavior) cmake/plugin.cmake: - Recognize WITH_MAX_NO_NDB, this fixes missing storage engines after BUILD/*max-no-ndb scripts mysql-test/CMakeLists.txt: test-force uses the same macros (MTR_FORCE) as test-bt* now scripts/CMakeLists.txt: - Fix broken dependency when producing mysql_fix_privilege_tables.sql, reported by Davi. We now concatenate 2 scripts in custom command that has dependency on both scripts rather than concatenating them at cmake time. sql/CMakeLists.txt: Address frequently asked question "where is distclean" by implementing distclean target that does nothing except pointing to appropriate bzr command. It is better not to call "bzr clean-tree" automatically, without user consent. It could clean new files that were meant to be added.
-rw-r--r--cmake/configure.pl6
-rw-r--r--cmake/plugin.cmake5
-rw-r--r--mysql-test/CMakeLists.txt12
-rwxr-xr-xscripts/CMakeLists.txt36
-rwxr-xr-xsql/CMakeLists.txt8
5 files changed, 45 insertions, 22 deletions
diff --git a/cmake/configure.pl b/cmake/configure.pl
index 7f21810a8f2..fba417365fc 100644
--- a/cmake/configure.pl
+++ b/cmake/configure.pl
@@ -179,6 +179,11 @@ foreach my $option (@ARGV)
$cmakeargs = $cmakeargs." -DMYSQL_DATADIR=".substr($option,14);
next;
}
+ if ($option =~ /with-debug=full/)
+ {
+ $cmakeargs = $cmakeargs." -DWITH_DEBUG_FULL=1";
+ next;
+ }
$option = uc($option);
$option =~ s/-/_/g;
@@ -186,5 +191,6 @@ foreach my $option (@ARGV)
}
print("configure.pl : calling cmake $srcdir $cmakeargs\n");
+unlink("CMakeCache.txt");
my $rc = system("cmake $srcdir $cmakeargs");
exit($rc);
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index d6411641192..30a7932a0d7 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -52,6 +52,11 @@ MACRO(MYSQL_ADD_PLUGIN)
SET(WITH_${plugin} 1)
ENDIF()
+ IF(WITH_MAX_NO_NDB)
+ SET(WITH_MAX 1)
+ SET(WITHOUT_NDBCLUSTER 1)
+ ENDIF()
+
IF(WITH_${plugin}_STORAGE_ENGINE
OR WITH_{$plugin}
OR WITH_ALL
diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt
index 794f286ac56..2cc65a9c82f 100644
--- a/mysql-test/CMakeLists.txt
+++ b/mysql-test/CMakeLists.txt
@@ -64,12 +64,6 @@ ELSE()
ENDIF()
-ADD_CUSTOM_TARGET(test-force
- COMMAND ${SETCONFIG_COMMAND}
- COMMAND ${SETOS_COMMAND}
- COMMAND perl mysql-test-run.pl --force
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-)
SET(EXP --experimental=collections/default.experimental)
IF(WIN32)
@@ -100,6 +94,11 @@ SET(TEST_BT_START
COMMAND ${SET_ENV} MTR_BUILD_THREAD=auto
)
+ADD_CUSTOM_TARGET(test-force
+ ${TEST_BT_START}
+ COMMAND ${MTR_FORCE}
+)
+
ADD_CUSTOM_TARGET(test-bt
${TEST_BT_START}
COMMAND ${MTR_FORCE} --comment=normal --timer --skip-ndbcluster --report-features ${EXP}
@@ -124,4 +123,3 @@ ADD_CUSTOM_TARGET(test-bt-debug
COMMAND ${MTR_FORCE} --comment=debug --timer --skip-ndbcluster --skip-rpl --report-features ${EXP}
)
-
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index f838d27a241..26dfb243897 100755
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -20,31 +20,41 @@ IF(NOT CMAKE_CROSSCOMPILING)
TARGET_LINK_LIBRARIES(comp_sql)
ENDIF()
-SET(FIX_PRIVS_IN
- ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables.sql
- ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables_fix.sql
-)
-SET(FIX_PRIVILEGES_SQL
- ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables.sql
-)
# Build mysql_fix_privilege_tables.sql (concatenate 2 sql scripts)
-FILE(WRITE ${FIX_PRIVILEGES_SQL} "")
-FOREACH(FILENAME ${FIX_PRIVS_IN})
- FILE(READ "${FILENAME}" CONTENTS)
- FILE(APPEND ${FIX_PRIVILEGES_SQL} "${CONTENTS}")
-ENDFOREACH()
+IF(NOT WIN32 OR CMAKE_CROSSCOMPILING)
+ FIND_PROGRAM(CAT_EXECUTABLE cat DOC "path to the executable")
+ENDIF()
+IF(CAT_EXECUTABLE)
+ SET(CAT_COMMAND COMMAND
+ ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}
+ ${CAT_EXECUTABLE} mysql_system_tables.sql mysql_system_tables_fix.sql >
+ ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables.sql
+ )
+ELSEIF(WIN32)
+ FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables.sql
+ native_outfile )
+ SET(CAT_COMMAND
+ COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}
+ cmd /c copy /b mysql_system_tables.sql + mysql_system_tables_fix.sql
+ ${native_outfile} )
+ELSE()
+ MESSAGE(FATAL_ERROR "Cannot concatenate files")
+ENDIF()
# Build mysql_fix_privilege_tables.c
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables_sql.c
+ ${CAT_COMMAND}
COMMAND comp_sql
mysql_fix_privilege_tables
mysql_fix_privilege_tables.sql
mysql_fix_privilege_tables_sql.c
- DEPENDS comp_sql
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS comp_sql
+ ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables.sql
+ ${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables_fix.sql
)
# Add target for the above to be built
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 8399b0c7219..ed092b4ede4 100755
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -238,8 +238,12 @@ ADD_CUSTOM_TARGET(dist
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
-
-
+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
+ )
IF(INSTALL_LAYOUT STREQUAL "STANDALONE")