Created
February 19, 2024 18:36
-
-
Save saxbophone/6e7373eb9fadf55e82004d0a2831358b to your computer and use it in GitHub Desktop.
For transforming autoheader defines into CMake configure_file() defines
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
#include <iostream> | |
#include <regex> | |
#include <string> | |
int main() { | |
std::regex find_undefs{"(?:#undef\\s+)([_A-z][_0-9A-z]*)"}; | |
std::cout << std::regex_replace("#undef _1FOO_BAR_BAZ1234_", find_undefs, "#cmakedefine $1 1") << std::endl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment