-
Notifications
You must be signed in to change notification settings - Fork 0
/
bundle_dep.pro
39 lines (34 loc) · 1.07 KB
/
bundle_dep.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
;+
; PURPOSE:
; Attempt to use finddep_all to bundle all dependencies needed to run
; a given IDL program.
;
; INPUTS:
; file: The name of an IDL source file to bundle
; output_dir: The name of a directory in which to copy 'file' and its
; dependencies. It will be created if it doesn't exist
;
; RESTRICTIONS:
; The program uses finddep_all to find dependencies, and it
; isn't perfect. See its documentation for details.
;
; MODIFICATION HISTORY:
; July 2011: Written by Chris Beaumont
;-
pro bundle_dep, file, output_dir
if n_params() ne 2 then begin
print, 'calling sequence'
print, 'bundle_dep, file, output_dir'
return
endif
if size(file, /type) ne 7 || size(output_dir, /type) ne 7 $
then message, 'file and output_dir must be strings'
if ~file_test(file) then $
message, 'File does not exist: '+file
dep = finddep_all(file, /only_source)
;- compile all of the unique source files
src = dep.source
src = src[uniq(src, sort(src))]
if ~file_test(output_dir) then file_mkdir, output_dir
file_copy, src, output_dir, /over
end