From 43d02e95e30e7414d1d836be1a48724b5f0b5a7d Mon Sep 17 00:00:00 2001 From: Ingmar Schoegl Date: Mon, 4 Nov 2019 10:05:54 -0600 Subject: [PATCH] [Scons] prevent installation to source directory --- SConstruct | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SConstruct b/SConstruct index 7ed02b71b..4c9f9d312 100644 --- a/SConstruct +++ b/SConstruct @@ -729,6 +729,11 @@ print() # *** Configure system-specific properties *** # ******************************************** +# Prevent setting prefix for Cantera installation to source directory +if os.path.abspath(env['prefix']) == Dir('.').abspath: + print('ERROR: cannot install Cantera into source directory.') + exit(1) + # Copy in external environment variables if env['env_vars'] == 'all': env['ENV'].update(os.environ)