VCPKG_TOOLCHAIN := D:/Projects/temp/vcpkg/scripts/buildsystems/vcpkg.cmake

.PHONY: debug
debug:
	@echo "Building the project..."
	@cmake -B build -S . \
	    -DCMAKE_TOOLCHAIN_FILE=$(VCPKG_TOOLCHAIN) \
	    -DVCPKG_TARGET_TRIPLET=x64-windows \
	    -DCMAKE_BUILD_TYPE=Debug
	@echo "Configuration done. Now building..."
	@cmake --build build --config Debug
	@echo "Build completed."

.PHONY: release
release:
	@echo "Building the project..."
	@cmake -B build -S . \
	    -DCMAKE_TOOLCHAIN_FILE=$(VCPKG_TOOLCHAIN) \
	    -DVCPKG_TARGET_TRIPLET=x64-windows-release \
	    -DCMAKE_BUILD_TYPE=Release
	@echo "Configuration done. Now building..."
	@cmake --build build --config Release
	@echo "Build completed."

.PHONY: static-debug
static-debug:
	@echo "Building the project..."
	@cmake -B build-static -S . \
	    -DCMAKE_TOOLCHAIN_FILE=$(VCPKG_TOOLCHAIN) \
	    -DVCPKG_TARGET_TRIPLET=x64-windows-static \
	    -DCMAKE_BUILD_TYPE=Debug \
	    -DUSE_STATIC_RUNTIME=ON
	@echo "Configuration done. Now building..."
	@cmake --build build-static --config Debug
	@echo "Build completed."

.PHONY: static-release
static-release:
	@echo "Building the project..."
	@cmake -B build-static -S . \
	    -DCMAKE_TOOLCHAIN_FILE=$(VCPKG_TOOLCHAIN) \
	    -DVCPKG_TARGET_TRIPLET=x64-windows-static \
	    -DCMAKE_BUILD_TYPE=Release \
	    -DUSE_STATIC_RUNTIME=ON
	@echo "Configuration done. Now building..."
	@cmake --build build-static --config Release
	@echo "Build completed."

.PHONY: static-md-debug
static-md-debug:
	@echo "Building the project..."
	@cmake -B build-static-md -S . \
	    -DCMAKE_TOOLCHAIN_FILE=$(VCPKG_TOOLCHAIN) \
	    -DVCPKG_TARGET_TRIPLET=x64-windows-static-md \
	    -DCMAKE_BUILD_TYPE=Debug
	@echo "Configuration done. Now building..."
	@cmake --build build-static-md --config Debug
	@echo "Build completed."

.PHONY: static-md-release
static-md-release:
	@echo "Building the project..."
	@cmake -B build-static-md -S . \
	    -DCMAKE_TOOLCHAIN_FILE=$(VCPKG_TOOLCHAIN) \
	    -DVCPKG_TARGET_TRIPLET=x64-windows-static-md \
	    -DCMAKE_BUILD_TYPE=Release
	@echo "Configuration done. Now building..."
	@cmake --build build-static-md --config Release
	@echo "Build completed."

.PHONY: clean
clean:
	@echo "Cleaning the project..."
	@rm -rf build
	@rm -rf build-static
	@rm -rf build-static-md
	@echo "Clean completed."
