Created
September 30, 2019 04:10
-
-
Save smutch/26e80a593b6afbec33053b6dab1244e6 to your computer and use it in GitHub Desktop.
sh: Generate the appropriate contents of CMAKE_PREFIX_PATH for the loaded set of modules.
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
#!/usr/bin/env bash | |
# Generate the appropriate contents of CMAKE_PREFIX_PATH for the loaded set of modules. | |
# Author: S. Mutch (2019) | |
# | |
# Usage: | |
# CMAKE_PREFIX_PATH=`cmake_prefix_path` cmake .. | |
cmake_prefix_path="" | |
modules=$(module list -t 2>&1 | tail -n +2) | |
for module in $modules; do | |
cmake_prefix_path+=$(module show $module 2>&1 | grep ' LIBRARY_PATH' | cut -d' ' -f 3 | sed 's/\(.*\)\/lib.*/\1:/g') | |
done | |
cmake_prefix_path=$(echo $cmake_prefix_path | sed 's/: /:/g') | |
echo $cmake_prefix_path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment