Skip to content

Commit 53e31fd

Browse files
FIX install windows script
1 parent 5f0c787 commit 53e31fd

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

install_windows.ps1

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,31 +39,28 @@ if (-not (Test-Path $BUILD_DIR)) {
3939

4040
# Step 4: Install dependencies with Conan
4141
Write-Host "${YELLOW}Installing dependencies with Conan...${NC}"
42-
try {
43-
conan install . --output-folder=$BUILD_DIR --build=missing
42+
if (conan install . --output-folder=$BUILD_DIR --build=missing) {
4443
Write-Host "${GREEN}SUCCESS: Dependencies installed successfully.${NC}"
45-
} catch {
44+
} else {
4645
Write-Host "${RED}ERROR: Conan failed to install dependencies.${NC}"
4746
exit 1
4847
}
4948

5049
# Step 5: Configure the project with CMake
5150
Write-Host "${YELLOW}Configuring the project with CMake...${NC}"
5251
cd $BUILD_DIR
53-
try {
54-
cmake .. -G "Visual Studio 15 2017" -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake"
52+
if (cmake .. -DCMAKE_TOOLCHAIN_FILE="build/Release/generators/conan_toolchain.cmake" -DCMAKE_BUILD_TYPE=Release) {
5553
Write-Host "${GREEN}SUCCESS: CMake configuration completed.${NC}"
56-
} catch {
54+
} else {
5755
Write-Host "${RED}ERROR: CMake configuration failed.${NC}"
5856
exit 1
5957
}
6058

6159
# Step 6: Build the project
6260
Write-Host "${YELLOW}Building the project...${NC}"
63-
try {
64-
cmake --build . --config Release
61+
if (cmake --build .) {
6562
Write-Host "${GREEN}SUCCESS: Project built successfully.${NC}"
66-
} catch {
63+
} else {
6764
Write-Host "${RED}ERROR: Build failed.${NC}"
6865
exit 1
6966
}

0 commit comments

Comments
 (0)