diff --git a/Makefile b/Makefile index ce76123e1f..8cb305e935 100644 --- a/Makefile +++ b/Makefile @@ -76,7 +76,12 @@ endif srcDir := $(shell dirname '$(subst /Volumes/Macintosh HD/,/,$(realpath $(lastword $(MAKEFILE_LIST))))') buildDir := $(srcDir)/build/build_$(config) -outDir := $(srcDir)/build/$(config) + +# get outDir from CMake install file or fall back to default if the file doesn't exist +outDir := $(subst /libponyrt.tests,,$(shell grep -o -s '$(srcDir)\/build\/$(config).*\/libponyrt.tests' $(buildDir)/cmake_install.cmake)) +ifeq ($(outDir),) + outDir := $(srcDir)/build/$(config) +endif libsSrcDir := $(srcDir)/lib libsBuildDir := $(srcDir)/build/build_libs