From: malaterre Date: Mon, 24 Oct 2005 20:53:31 +0000 (+0000) Subject: COMP: Fix static lib on win32, plus add a comment about conformance X-Git-Tag: OpenJPEG.Version1.2~193 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=761a1bb4651d9058436cb75dc74c6508ea7ba89b;p=gdcm.git COMP: Fix static lib on win32, plus add a comment about conformance --- diff --git a/src/gdcmopenjpeg/CMakeLists.txt b/src/gdcmopenjpeg/CMakeLists.txt index 5a0d2b3e..2c96d486 100644 --- a/src/gdcmopenjpeg/CMakeLists.txt +++ b/src/gdcmopenjpeg/CMakeLists.txt @@ -14,3 +14,6 @@ SUBDIRS( libopenjpeg #codec ) + +# TODO, technically we should not have to ... +# http://www.crc.ricoh.com/~gormish/jpeg2000conformance/ diff --git a/src/gdcmopenjpeg/libopenjpeg/CMakeLists.txt b/src/gdcmopenjpeg/libopenjpeg/CMakeLists.txt index 43d01117..22d64a6d 100644 --- a/src/gdcmopenjpeg/libopenjpeg/CMakeLists.txt +++ b/src/gdcmopenjpeg/libopenjpeg/CMakeLists.txt @@ -19,9 +19,21 @@ SET(openjpeg_SRCS jpt.c jp2.c ) + +IF (WIN32) + IF (BUILD_SHARED_LIBS) + ADD_DEFINITIONS(-DOPENJPEGDLL) + #SET(JPEGDLL 1) + ELSE (BUILD_SHARED_LIBS) + ADD_DEFINITIONS(-DOPENJPEGSTATIC) + #SET(JPEGSTATIC 1) + ENDIF (BUILD_SHARED_LIBS) +ENDIF (WIN32) + + ADD_LIBRARY(gdcmopenjpeg ${openjpeg_SRCS}) -## $Id: CMakeLists.txt,v 1.3 2005/10/24 15:58:35 malaterre Exp $ +## $Id: CMakeLists.txt,v 1.4 2005/10/24 20:53:32 malaterre Exp $ ## ## makefile for OpenJPEG library # diff --git a/src/gdcmopenjpeg/libopenjpeg/j2k.h b/src/gdcmopenjpeg/libopenjpeg/j2k.h index 7c31d207..17e13d1a 100644 --- a/src/gdcmopenjpeg/libopenjpeg/j2k.h +++ b/src/gdcmopenjpeg/libopenjpeg/j2k.h @@ -28,7 +28,7 @@ #define VERSION "0.0.8" -#ifdef _WIN32 /*DAVID_WIN32*/ +#if defined(_WIN32) && defined (OPENJPEGDLL) #ifdef gdcmopenjpeg_EXPORTS /*LIBJ2K_EXPORTS*/ #define LIBJ2K_API __declspec(dllexport) #else @@ -38,6 +38,12 @@ #define LIBJ2K_API #endif +#if defined(_WIN32) && defined (OPENJPEGSTATIC) +#define LIBJ2K_API __declspec(dllexport) +#else +#define LIBJ2K_API extern +#endif + #ifndef __J2K_H #define __J2K_H