2022-04-11 06:44:18 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-09-11 14:03:33 +00:00
|
|
|
wclean && wmake $@ > log.wmake 2>&1
|
|
|
|
# if [ ! -f "log.wmake" ]
|
|
|
|
# then
|
|
|
|
# echo "wmake > log.wmake"
|
|
|
|
# wmake $@ >log.wmake 2>&1
|
|
|
|
# fi
|
2022-04-11 06:44:18 +00:00
|
|
|
|
2024-09-11 13:19:50 +00:00
|
|
|
# Find the Python executable in the system
|
|
|
|
PYTHON_EXEC=$(which python3)
|
2022-04-11 06:44:18 +00:00
|
|
|
|
2024-09-11 13:19:50 +00:00
|
|
|
# Check if python3 is found
|
|
|
|
if [ -z "$PYTHON_EXEC" ]; then
|
|
|
|
echo "python3 not found"
|
|
|
|
exit 1
|
2022-04-11 08:08:01 +00:00
|
|
|
fi
|
|
|
|
|
2024-09-11 13:19:50 +00:00
|
|
|
# Get the Python version
|
|
|
|
PYTHON_VERSION=$($PYTHON_EXEC -c 'import sys; print(".".join(map(str, sys.version_info[:3])))')
|
2022-04-11 06:44:18 +00:00
|
|
|
|
2024-09-11 13:19:50 +00:00
|
|
|
# Split the version number
|
|
|
|
IFS='.' read -r -a version_parts <<< "$PYTHON_VERSION"
|
2022-04-11 06:44:18 +00:00
|
|
|
|
2024-09-11 13:19:50 +00:00
|
|
|
# Compare major and minor versions
|
|
|
|
if [ "${version_parts[0]}" -gt 3 ] || { [ "${version_parts[0]}" -eq 3 ] && [ "${version_parts[1]}" -ge 6 ]; }; then
|
|
|
|
script_dir=$(cd "$(dirname "$0")" && pwd)
|
|
|
|
$PYTHON_EXEC $script_dir/wmakelog2cmakelists.py
|
2022-04-11 13:15:18 +00:00
|
|
|
else
|
2024-09-11 13:19:50 +00:00
|
|
|
echo "Python version must be greater than 3.6, current version is: $PYTHON_VERSION"
|
|
|
|
exit 1
|
|
|
|
fi
|