Created
May 6, 2019 09:05
-
-
Save chfast/d738c74d710d29bcb05de42c948be41a to your computer and use it in GitHub Desktop.
Covert CMake list into C array of string literals
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generated file: | |
const char* allTests[] = | |
{ | |
"A", | |
"B", | |
"C", | |
"D", | |
"E", | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const char* allTests[] = | |
{ | |
@ALL_TESTS@ | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set(tests_list A;B;C;D;E) | |
foreach(t ${tests_list}) | |
set(ALL_TESTS "${ALL_TESTS} \"${t}\",\n") | |
endforeach() | |
configure_file(all_tests.h.in all_tests.h) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment