build_samples.sh: detect cmake3 for CentOS (#14562)

Close https://github.com/openvinotoolkit/openvino/issues/14553
This commit is contained in:
Zlobin Vladimir 2022-12-12 17:23:56 +04:00 committed by GitHub
parent 4f9a8757c8
commit b07fea664f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

@ -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"