From 81af4bf9d7908beb0b3567a91e8482bc2792c21b Mon Sep 17 00:00:00 2001 From: wiredfool Date: Thu, 5 Jun 2014 22:17:47 +0000 Subject: [PATCH] successful build of openjpeg -- unsuccessful linking --- winbuild/build_dep.py | 44 +++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/winbuild/build_dep.py b/winbuild/build_dep.py index 33443b4f8..ff4546fe1 100644 --- a/winbuild/build_dep.py +++ b/winbuild/build_dep.py @@ -46,8 +46,16 @@ def extract(src, dest): return untar(src, dest) def fetch_libs(): - for lib in libs.values(): - extract(check_hash(fetch(lib['url']),lib['hash']),build_dir) + for name,lib in libs.items(): + if name == 'openjpeg': + filename = check_hash(fetch(lib['url']),lib['hash']) + for compiler in compilers.values(): + if not os.path.exists(os.path.join(build_dir,lib['dir']+compiler['inc_dir'])): + extract(filename, build_dir) + os.rename(os.path.join(build_dir,lib['dir']), + os.path.join(build_dir,lib['dir']+compiler['inc_dir'])) + else: + extract(check_hash(fetch(lib['url']),lib['hash']),build_dir) def cp_tk(): return r""" @@ -78,6 +86,21 @@ def end_compiler(): endlocal """ +def nmake_openjpeg(compiler): + return r""" +rem build openjpeg +setlocal +@echo on +cd /D %%OPENJPEG%%%(inc_dir)s +%%CMAKE%% -DBUILD_THIRDPARTY:BOOL=ON -G "NMake Makefiles" . +nmake -f Makefile clean +nmake -f Makefile +copy /Y /B bin\* %%INCLIB%% +mkdir %%INCLIB%%\openjpeg-2.0 +copy /Y /B src\lib\openjp2\*.h %%INCLIB%%\openjpeg-2.0 +endlocal +""" % compiler + def nmake_libs(compiler): # undone -- pre, makes, headers, libs return r""" @@ -115,13 +138,13 @@ endlocal rem build openjpeg setlocal -cd /D %%OPENJPEG%% -%%CMAKE%% -DBUILD_THIRDPARTY:BOOL=ON . -nmake -f Makefile.vc clean -nmake -f Makefile.vc -copy /Y /B bin/* %%INCLIB%% -copy /Y /B src/lib/openjp2/openjpeg.h %%INCLIB%% -copy /Y /B src/lib/openjp2/opj_stdint.h %%INCLIB%% +cd /D %%OPENJPEG%%%(inc_dir)s +%%CMAKE%% -DBUILD_THIRDPARTY:BOOL=ON -G "NMake Makefiles" . +nmake -f Makefile clean +nmake -f Makefile +copy /Y /B bin\* %%INCLIB%% +mkdir %%INCLIB%%\openjpeg-2.0 +copy /Y /B src\lib\openjp2\*.h %%INCLIB%%\openjpeg-2.0 endlocal rem Build libtiff @@ -169,13 +192,14 @@ endlocal mkdirs() fetch_libs() -script = [header(), cp_tk()] +script = [header()] #, cp_tk()] for compiler in compilers.values(): #if True: # compiler = compilers[(7,64)] script.append(setup_compiler(compiler)) script.append(nmake_libs(compiler)) +# script.append(nmake_openjpeg(compiler)) script.append(msbuild_libs(compiler)) script.append(end_compiler())