diff --git a/SConstruct b/SConstruct index 7ed02b71b6..4c9f9d3120 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)