You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
764 B
29 lines
764 B
#!/bin/bash
|
|
set -e
|
|
|
|
LAST_CMAKE_AT_REV_FILE="docker_cmake.rev"
|
|
CURR_REV="$(git rev-parse HEAD)"
|
|
|
|
initialize_cmake() {
|
|
echo -e "*** CMake was not initialized yet, doing it now.\n"
|
|
cmake ..
|
|
echo "$CURR_REV" > "$LAST_CMAKE_AT_REV_FILE"
|
|
}
|
|
|
|
# Check if CMake has never been initialized
|
|
if [ ! -f Makefile ]; then
|
|
initialize_cmake
|
|
fi
|
|
|
|
# Check if CMake was initialized for a different Git revision (new targets may have been added)
|
|
if [ -f "$LAST_CMAKE_AT_REV_FILE" ]; then
|
|
LAST_CMAKE_AT_REV="$(cat $LAST_CMAKE_AT_REV_FILE)"
|
|
if [[ "$LAST_CMAKE_AT_REV" != "SKIP" ]] && [[ "$LAST_CMAKE_AT_REV" != "$CURR_REV" ]]; then
|
|
initialize_cmake
|
|
fi
|
|
else
|
|
initialize_cmake
|
|
fi
|
|
|
|
# Let Make handle the arguments coming from the build script
|
|
make "$@"
|