Skip to content

Commit

Permalink
Skip the build if binary folder already exists.
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuwch committed Jul 31, 2017
1 parent 5cece17 commit 3f4f819
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def install(UE4_dir):
else:
shutil.rmtree(abs_tgt_unrealcv_folder)

print('Copy the plugin from %s to %s' % (abs_src_unrealcv_folder, abs_tgt_unrealcv_folder))
shutil.copytree(abs_src_unrealcv_folder, abs_tgt_unrealcv_folder)
print('Installation of UnrealCV is successful.')

Expand All @@ -86,12 +87,16 @@ def install(UE4_dir):
platform_name = get_platform_name()
script_dir = os.path.dirname(os.path.realpath(__file__))

subprocess.call([
abs_UAT_path, 'BuildPlugin',
'-plugin=%s' % abs_unrealcv_descriptor,
'-package=%s' % abs_output_folder,
'-rocket', '-targetplatforms=%s' % platform_name
], cwd = script_dir)
if os.path.isdir(abs_output_folder):
print('Output folder "%s" already exists, skip compilation.' % abs_output_folder)
print('Remove this folder if you want to compile the plugin with a different UE4 version.')
else:
subprocess.call([
abs_UAT_path, 'BuildPlugin',
'-plugin=%s' % abs_unrealcv_descriptor,
'-package=%s' % abs_output_folder,
'-rocket', '-targetplatforms=%s' % platform_name
], cwd = script_dir)

if need_install:
install(UE4_dir)

0 comments on commit 3f4f819

Please sign in to comment.