Skip to content

Commit 46e67f9

Browse files
CMakeLists.txt
1 parent bce9052 commit 46e67f9

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

ner_environment/build_system/build_system.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,19 @@ def build(profile: str = typer.Option(None, "--profile", "-p", callback=unsuppor
5454
is_cmake = os.path.exists("CMakeLists.txt")
5555

5656
if is_cmake: # Repo uses CMake, so execute CMake commands.
57-
print("[bold blue]CMake project detected.\n")
57+
print("[bold blue]CMake project detected.")
58+
59+
# If CMakeCache.txt doesn't exist or has wrong paths, configure CMake
60+
if not os.path.exists("build/CMakeCache.txt"):
61+
print("[blue]No CMake cache found. Configuring CMake...[/blue]")
62+
run_command(["docker", "compose", "run", "--rm", "ner-gcc-arm", "bash", "-c", "cd /home/app && mkdir -p build && cd build && cmake .."], stream_output=True)
63+
5864
if clean:
5965
run_command(["docker", "compose", "run", "--rm", "ner-gcc-arm", "cmake", "--build", "build", "--target", "clean"], stream_output=True)
6066
else:
6167
run_command(["docker", "compose", "run", "--rm", "ner-gcc-arm", "cmake", "--build", "build"], stream_output=True)
6268
else: # Repo uses Make, so execute Make commands.
63-
print("[bold blue]Makefile project detected.\n")
69+
print("[bold blue]Makefile project detected.")
6470
if clean:
6571
run_command(["docker", "compose", "run", "--rm", "ner-gcc-arm", "make", "clean"], stream_output=True)
6672
else:

0 commit comments

Comments
 (0)