summaryrefslogtreecommitdiff
path: root/mysql-test/CMakeLists.txt
diff options
context:
space:
mode:
authorBjorn Munch <bjorn.munch@oracle.com>2011-09-29 10:42:23 +0200
committerBjorn Munch <bjorn.munch@oracle.com>2011-09-29 10:42:23 +0200
commit8da99509449498658468051551eef820f92199d7 (patch)
tree625143c91068761da45017af6c2a78e8dcebeaed /mysql-test/CMakeLists.txt
parent9fb56539d055375b5881ded8d31131af5a81816c (diff)
downloadmariadb-git-8da99509449498658468051551eef820f92199d7.tar.gz
Bug #12373393 PB2 SHOULD ALLOW TO CREATE COLLECTIONS AS SUPER SET OF EXISTING COLLECTIONS
Let CMake parse files with a ".in" suffix containing includes Added default.release.in to replace default.release Explained in README New patch: replace 'include' with '#include' to avoid accidental matches
Diffstat (limited to 'mysql-test/CMakeLists.txt')
-rw-r--r--mysql-test/CMakeLists.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt
index 655d8e086eb..954e9c44311 100644
--- a/mysql-test/CMakeLists.txt
+++ b/mysql-test/CMakeLists.txt
@@ -132,3 +132,26 @@ ADD_CUSTOM_TARGET(test-bt-debug
COMMAND ${MTR_FORCE} --comment=debug --timer --skip-ndbcluster --skip-rpl --report-features ${EXP}
)
+# Process .in files with includes in collections/
+
+MACRO(PROCESS_COLLECTION_INCLUDE collin collection)
+ FILE(STRINGS ${collin} inlines)
+ FOREACH(line ${inlines})
+ IF(${line} MATCHES "#include .*")
+ STRING(REPLACE "#include " "collections/" incfile ${line})
+ FILE(READ ${incfile} contents)
+ FILE(APPEND ${collection} "${contents}")
+ ELSE()
+ FILE(APPEND ${collection} "${line}\n")
+ ENDIF()
+ ENDFOREACH()
+ENDMACRO()
+
+FILE(GLOB infiles "collections/*.in")
+FOREACH(collin ${infiles})
+ STRING(REPLACE ".in" "" collection ${collin})
+ # Only generate file once
+ IF(NOT EXISTS ${collection})
+ PROCESS_COLLECTION_INCLUDE(${collin} ${collection})
+ ENDIF()
+ENDFOREACH()