Skip to content

Commit

Permalink
Frontend: flag -v for enabling verbose output from Makefile builds (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jjokella authored Nov 15, 2024
1 parent f8c1ab1 commit 8542bd2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion build_tsmp2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ set -eo pipefail
function help_tsmp2() {
echo "Usage: $0 [-v ] [--component_name] [--optionals]"
echo " -q, --quiet Write less output during shell execution"
echo " -v, --verbose Enable verbose output from Makefile builds using CMAKE_VERBOSE_MAKEFILE"
echo " --version Print $0 scipt version"
echo " --ICON Compile with ICON"
echo " --eCLM Compile with eCLM"
Expand Down Expand Up @@ -100,6 +101,7 @@ while [[ "$#" -gt 0 ]]; do
case "${1,,}" in
-h|--help) help_tsmp2;;
-q|--quiet) quiet=y;;
-v|--verbose) verbose_makefile=y;;
--version) echo "$0 version 0.1.0"; exit 1;;
--icon) icon=y;;
--eclm) eclm=y;;
Expand Down Expand Up @@ -200,6 +202,12 @@ else
cmake_install_dir="-DCMAKE_INSTALL_PREFIX=${install_dir}"
fi # install_dir

if [ -z "${verbose_makefile}" ]; then
cmake_verbose_makefile="" # equivalent to "-DCMAKE_VERBOSE_MAKEFILE=OFF"
else
cmake_verbose_makefile="-DCMAKE_VERBOSE_MAKEFILE=ON"
fi # Makefile verbosity

build_log="$(dirname ${cmake_build_dir})/${model_id}_$(date +%Y-%m-%d_%H-%M).log"

## source environment
Expand All @@ -223,14 +231,15 @@ message "TSMP2_ENV: $tsmp2_env"
message "BUILD_DIR: $cmake_build_dir"
message "INSTALL_DIR: $( echo "${cmake_install_dir}" |cut -d\= -f2)"
message "CMAKE command:"
message "cmake -S ${cmake_tsmp2_dir} -B ${cmake_build_dir} ${cmake_build_type} ${cmake_comp_str} ${cmake_compsrc_str} ${cmake_compiler} ${cmake_install_dir} |& tee ${build_log} "
message "cmake -S ${cmake_tsmp2_dir} -B ${cmake_build_dir} ${cmake_build_type} ${cmake_comp_str} ${cmake_compsrc_str} ${cmake_compiler} ${cmake_install_dir} ${cmake_verbose_makefile} |& tee ${build_log} "
message "== CMAKE GENERATE PROJECT start"

cmake -S ${cmake_tsmp2_dir} -B ${cmake_build_dir} \
${cmake_build_type} \
${cmake_comp_str} \
${cmake_compsrc_str} \
${cmake_compiler} ${cmake_install_dir} \
${cmake_verbose_makefile} \
|& tee ${build_log}

message "== CMAKE GENERATE PROJECT finished"
Expand Down

0 comments on commit 8542bd2

Please sign in to comment.