Move the TurboJPEG DLLs back into the system directory on Windows platforms. For Windows, it doesn't really simplify the build system to install these libraries in c:\libjpeg-turbo*, and it introduces potential problems with loading the JNI library. Specifically, if a user linked their Java app against the 64-bit libjpeg-turbo SDK and then used a 32-bit JVM at run time, they would not be able to load the 32-bit turbojpeg.dll without manipulating java.library.path or the PATH environment (and vice versa for building against the 32-bit libjpeg-turbo SDK and using a 64-bit JVM at run time.)

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@949 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
DRC
2013-04-24 05:26:42 +00:00
parent 9e646118bc
commit 4c0c6ffee0
2 changed files with 16 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C)2011, 2013 D. R. Commander. All Rights Reserved. * Copyright (C)2011 D. R. Commander. All Rights Reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
@@ -30,10 +30,6 @@ package org.libjpegturbo.turbojpeg;
final class TJLoader { final class TJLoader {
static void load() { static void load() {
try { System.loadLibrary("@TURBOJPEG_DLL_NAME@");
System.loadLibrary("@TURBOJPEG_DLL_NAME@");
} catch (java.lang.UnsatisfiedLinkError e) {
System.load("@CMAKE_INSTALL_PREFIX@/bin/@TURBOJPEG_DLL_NAME@.dll");
}
} }
}; };

View File

@@ -19,23 +19,31 @@ Section "@CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ (required)"
!endif !endif
SectionIn RO SectionIn RO
!ifdef GCC !ifdef GCC
IfFileExists $INSTDIR/bin/libturbojpeg.dll exists 0 IfFileExists $SYSDIR/libturbojpeg.dll exists 0
!else !else
IfFileExists $INSTDIR/bin/turbojpeg.dll exists 0 IfFileExists $SYSDIR/turbojpeg.dll exists 0
!endif !endif
goto notexists goto notexists
exists: exists:
!ifdef GCC
MessageBox MB_OK "An existing version of the @CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ is already installed. Please uninstall it first." MessageBox MB_OK "An existing version of the @CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ is already installed. Please uninstall it first."
!else
MessageBox MB_OK "An existing version of the @CMAKE_PROJECT_NAME@ SDK for @INST_PLATFORM@ or the TurboJPEG SDK is already installed. Please uninstall it first."
!endif
quit quit
notexists: notexists:
SetOutPath $SYSDIR
!ifdef GCC
File "@CMAKE_BINARY_DIR@\libturbojpeg.dll"
!else
File "@CMAKE_BINARY_DIR@\${BUILDDIR}turbojpeg.dll"
!endif
SetOutPath $INSTDIR\bin SetOutPath $INSTDIR\bin
!ifdef GCC !ifdef GCC
File "/oname=libjpeg-@DLL_VERSION@.dll" "@CMAKE_BINARY_DIR@\sharedlib\libjpeg-*.dll" File "/oname=libjpeg-@DLL_VERSION@.dll" "@CMAKE_BINARY_DIR@\sharedlib\libjpeg-*.dll"
File "@CMAKE_BINARY_DIR@\libturbojpeg.dll"
!else !else
File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}jpeg@DLL_VERSION@.dll" File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}jpeg@DLL_VERSION@.dll"
File "@CMAKE_BINARY_DIR@\${BUILDDIR}turbojpeg.dll"
!endif !endif
File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}cjpeg.exe" File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}cjpeg.exe"
File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}djpeg.exe" File "@CMAKE_BINARY_DIR@\sharedlib\${BUILDDIR}djpeg.exe"
@@ -97,14 +105,14 @@ Section "Uninstall"
!ifdef GCC !ifdef GCC
Delete $INSTDIR\bin\libjpeg-@DLL_VERSION@.dll Delete $INSTDIR\bin\libjpeg-@DLL_VERSION@.dll
Delete $INSTDIR\bin\libturbojpeg.dll Delete $SYSDIR\libturbojpeg.dll
Delete $INSTDIR\lib\libturbojpeg.dll.a" Delete $INSTDIR\lib\libturbojpeg.dll.a"
Delete $INSTDIR\lib\libturbojpeg.a" Delete $INSTDIR\lib\libturbojpeg.a"
Delete $INSTDIR\lib\libjpeg.dll.a" Delete $INSTDIR\lib\libjpeg.dll.a"
Delete $INSTDIR\lib\libjpeg.a" Delete $INSTDIR\lib\libjpeg.a"
!else !else
Delete $INSTDIR\bin\jpeg@DLL_VERSION@.dll Delete $INSTDIR\bin\jpeg@DLL_VERSION@.dll
Delete $INSTDIR\bin\turbojpeg.dll Delete $SYSDIR\turbojpeg.dll
Delete $INSTDIR\lib\jpeg.lib Delete $INSTDIR\lib\jpeg.lib
Delete $INSTDIR\lib\jpeg-static.lib Delete $INSTDIR\lib\jpeg-static.lib
Delete $INSTDIR\lib\turbojpeg.lib Delete $INSTDIR\lib\turbojpeg.lib