Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 022f0ba

Browse files
committedJan 9, 2016
Merge pull request #5 from mdaus/fix_j2k_header_install
j2k_config.h was getting installed via copyfile rather than the normal clean way
2 parents f9d46f3 + 8266f61 commit 022f0ba

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed
 

‎modules/c/j2k/wscript

+9-13
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,18 @@ def build(bld):
6868

6969
# install j2k_config.h
7070
if env['install_headers']:
71-
moduleName = 'j2k'
72-
d = {}
7371
for line in env['header_builddir']:
7472
split = line.split('=')
75-
k = split[0]
76-
v = join(bld.bldnode.abspath(), split[1])
77-
d[k] = v
73+
if split[0] == 'j2k':
74+
subdir = split[1]
75+
76+
hdrTarget = bld(features='install_tgt',
77+
files=['j2k_config.h'],
78+
dir=bld.bldnode.make_node(subdir),
79+
install_path=join(env['install_includedir'], 'j2k'))
7880

79-
from shutil import copyfile
80-
installDir = join(bld.env['PREFIX'], 'include', 'j2k')
81-
destFile = join(installDir, 'j2k_config.h')
82-
sourceFile = join(bld.bldnode.abspath(), d[moduleName], 'j2k_config.h')
83-
if not exists(installDir):
84-
makedirs(installDir)
85-
if not exists(destFile):
86-
copyfile(sourceFile, destFile)
81+
lib.features += ' add_targets'
82+
lib.targets_to_add = [hdrTarget]
8783

8884
#j2k-only tests
8985
j2k_only_tests = ['test_j2k_header', 'test_j2k_read_tile', 'test_j2k_read_region',

0 commit comments

Comments
 (0)
Please sign in to comment.