From b07fea664f8dc1a1e05b49aff34722cbfcc04cfb Mon Sep 17 00:00:00 2001 From: Zlobin Vladimir Date: Mon, 12 Dec 2022 17:23:56 +0400 Subject: [PATCH] build_samples.sh: detect cmake3 for CentOS (#14562) Close https://github.com/openvinotoolkit/openvino/issues/14553 --- samples/cpp/build_samples.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/samples/cpp/build_samples.sh b/samples/cpp/build_samples.sh index 15f30890396..4b27c33f8cb 100755 --- a/samples/cpp/build_samples.sh +++ b/samples/cpp/build_samples.sh @@ -70,7 +70,12 @@ else source "$INTEL_OPENVINO_DIR/setupvars.sh" || true fi -if ! command -v cmake &>/dev/null; then +# CentOS 7 has two packages: cmake of version 2.8 and cmake3. install_openvino_dependencies.sh installs cmake3 +if command -v cmake3 &>/dev/null; then + CMAKE_EXEC=cmake3 +elif command -v cmake &>/dev/null; then + CMAKE_EXEC=cmake +else printf "\n\nCMAKE is not installed. It is required to build OpenVINO Runtime samples. Please install it. \n\n" exit 1 fi @@ -88,11 +93,11 @@ if [ -e "$build_dir/CMakeCache.txt" ]; then fi mkdir -p "$build_dir" -cmake -DCMAKE_BUILD_TYPE=Release -S "$SAMPLES_PATH" -B "$build_dir" -cmake --build "$build_dir" --config Release --parallel $NUM_THREADS +$CMAKE_EXEC -DCMAKE_BUILD_TYPE=Release -S "$SAMPLES_PATH" -B "$build_dir" +$CMAKE_EXEC --build "$build_dir" --config Release --parallel $NUM_THREADS if [ "$sample_install_dir" != "" ]; then - cmake -DCMAKE_INSTALL_PREFIX="$sample_install_dir" -DCOMPONENT=samples_bin -P "$build_dir/cmake_install.cmake" + $CMAKE_EXEC -DCMAKE_INSTALL_PREFIX="$sample_install_dir" -DCOMPONENT=samples_bin -P "$build_dir/cmake_install.cmake" printf "\nBuild completed, you can find binaries for all samples in the %s/samples_bin subfolder.\n\n" "$sample_install_dir" else printf "\nBuild completed, you can find binaries for all samples in the $build_dir/%s/Release subfolder.\n\n" "$OS_PATH"