Update dev-builds.yml
[inav.git] / cmake / docker.sh
blob843e03a48a25122c6d8931bd158812836ed486c4
1 #!/bin/bash
2 set -e
4 LAST_CMAKE_AT_REV_FILE="docker_cmake.rev"
5 CURR_REV="$(git rev-parse HEAD)"
7 initialize_cmake() {
8 echo -e "*** CMake was not initialized yet, doing it now.\n"
9 cmake -GNinja ..
10 echo "$CURR_REV" > "$LAST_CMAKE_AT_REV_FILE"
13 # Check if CMake has never been initialized
14 if [ ! -f Makefile ]; then
15 initialize_cmake
18 # Check if CMake was initialized for a different Git revision (new targets may have been added)
19 if [ -f "$LAST_CMAKE_AT_REV_FILE" ]; then
20 LAST_CMAKE_AT_REV="$(cat $LAST_CMAKE_AT_REV_FILE)"
21 if [[ "$LAST_CMAKE_AT_REV" != "SKIP" ]] && [[ "$LAST_CMAKE_AT_REV" != "$CURR_REV" ]]; then
22 initialize_cmake
24 else
25 initialize_cmake
28 # Let Make handle the arguments coming from the build script
29 ninja "$@"