summaryrefslogtreecommitdiff
path: root/mysql-test/CMakeLists.txt
diff options
context:
space:
mode:
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()