summaryrefslogtreecommitdiff
path: root/scripts
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 /scripts
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.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/CMakeLists.txt36
1 files changed, 23 insertions, 13 deletions
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