diff options
author | Bjorn Munch <bjorn.munch@oracle.com> | 2011-09-29 10:42:23 +0200 |
---|---|---|
committer | Bjorn Munch <bjorn.munch@oracle.com> | 2011-09-29 10:42:23 +0200 |
commit | a7f0fae6ab8fe6aa5f30f1cb072b96907ec77eaf (patch) | |
tree | 625143c91068761da45017af6c2a78e8dcebeaed /mysql-test/CMakeLists.txt | |
parent | ae41b0073ba1e3eb04e6a7e56a52f47bcd27c2fe (diff) | |
download | mariadb-git-a7f0fae6ab8fe6aa5f30f1cb072b96907ec77eaf.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.txt | 23 |
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() |