Last active
October 12, 2016 22:39
-
-
Save rpavlik/6ffbcf00d09c94fd756ba7867dd3e3e4 to your computer and use it in GitHub Desktop.
Somewhat hacky, but semi-functional, way of searching for included CMake modules from a directory.
This file contains 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
#!/bin/sh | |
# first grab the lines that have an include command, | |
# then filter out the ones where it might be commented out (this might over-filter - can drop this stage) | |
# then, use sed to grab just the stuff in between () in the include statement | |
# and finally, sort/uniq. | |
ag --nofilename 'include[(].*' | \ | |
grep -v '#.*include[(]' | \ | |
sed -r -n 's/.*include[(]([^)]+)[)]/\1/p' | \ | |
sort --unique |
This file contains 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
#!/bin/sh | |
# first grab the lines that have an find_package command, | |
# then filter out the ones where it might be commented out (this might over-filter - can drop this stage) | |
# then, use sed to grab just the first word in the () | |
# and finally, sort/uniq. | |
ag --nofilename 'find_package[(].*' | \ | |
grep -v '#.*find_package[(]' | \ | |
sed -r -n 's/.*find_package[(]([^) ]+).*/\1/p' | \ | |
sort --unique |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment