- use `install/strip` target for release build
- CMake used in Ubuntu bionic (currently used to build
redistributable packages, old enough to be older than
most of the commonly used distributions) does not
support -S option yet
build_dir="${project_source_dir}/build${SUBDIR:+/${SUBDIR}}"
install_dir="${project_source_dir}/install${SUBDIR:+/${SUBDIR}}"
+install_target='install/strip'
build_type='Release'
declare -a cmake_opts
declare -a cmake_user_opts
while [ ! -z "${1}" ]
do
- case "${1}" in
- '-j'*)
- job_count="${1:2}"
- shift
- ;;
- '--debug')
- build_type='Debug'
- shift
- ;;
- *)
+ case "${1}" in
+ '-j'*)
+ job_count="${1:2}"
+ shift
+ ;;
+ '--debug')
+ install_target='install'
+ build_type='Debug'
+ shift
+ ;;
+ *)
cmake_user_opts[${#cmake_user_opts[@]}]="${1}"
shift
- ;;
- esac
+ ;;
+ esac
done
declare -a fetch_submodules_cmd
-D'CMAKE_INSTALL_PREFIX'="${install_dir}" \
-D'CMAKE_BUILD_TYPE'="${build_type}" \
"${cmake_opts[@]}" \
- "${cmake_user_opts[@]}"
+ "${cmake_user_opts[@]}" \
+ "${project_source_dir}"
cmake \
--build "${build_dir}" \
-- \
-j"${job_count}" \
- install
+ "${install_target}"