tgt.c
)
-# Handle the dllimport/dllexport for building shared lib on Win32
-IF (WIN32)
- IF (BUILD_SHARED_LIBS)
- ADD_DEFINITIONS(-DOPJ_SHARED)
- ELSE (BUILD_SHARED_LIBS)
- ADD_DEFINITIONS(-DOPJ_STATIC)
- ENDIF (BUILD_SHARED_LIBS)
-ENDIF (WIN32)
+IF(WIN32 AND BUILD_SHARED_LIBS)
+ SET(UNDERSCORE)
+ IF(BORLAND)
+ SET(UNDERSCORE "_")
+ ENDIF(BORLAND)
+ CONFIGURE_FILE(
+ ${OPENJPEG_SOURCE_DIR}/libopenjpeg/openjpeg.def.in
+ ${OPENJPEG_BINARY_DIR}/libopenjpeg/openjpeg.def
+ @ONLY IMMEDIATE
+ )
+ IF(NOT BORLAND)
+ SET(OpenJPEG_SRCS ${OpenJPEG_SRCS}
+ ${OPENJPEG_BINARY_DIR}/libopenjpeg/openjpeg.def
+ )
+ ENDIF(NOT BORLAND)
+ENDIF(WIN32 AND BUILD_SHARED_LIBS)
# Create the library
ADD_LIBRARY(${OPJ_PREFIX}openjpeg ${OpenJPEG_SRCS})
# Install library
INSTALL_TARGETS(/lib/ ${OPJ_PREFIX}openjpeg)
+
--- /dev/null
+LIBRARY openjpeg.dll
+EXPORTS @UNDERSCORE@opj_image_create
+ @UNDERSCORE@opj_image_destroy
+ @UNDERSCORE@opj_cio_open
+ @UNDERSCORE@opj_cio_close
+ @UNDERSCORE@cio_tell
+ @UNDERSCORE@opj_set_event_mgr
+ @UNDERSCORE@opj_create_decompress
+ @UNDERSCORE@opj_destroy_decompress
+ @UNDERSCORE@opj_set_default_decoder_parameters
+ @UNDERSCORE@opj_setup_decoder
+ @UNDERSCORE@opj_decode
+ @UNDERSCORE@opj_create_compress
+ @UNDERSCORE@opj_destroy_compress
+ @UNDERSCORE@opj_set_default_encoder_parameters
+ @UNDERSCORE@opj_setup_encoder
+ @UNDERSCORE@opj_encode
#define OPENJPEG_VERSION "1.0.0"
-#if defined(_WIN32) && !defined (OPJ_STATIC)
-#ifdef OPJ_SHARED
-#define OPJ_EXPORT __declspec(dllexport)
-#else
-#define OPJ_EXPORT __declspec(dllimport)
-#endif
-#else
-#ifdef OPJ_STATIC
-#define OPJ_EXPORT extern
-#else
#define OPJ_EXPORT
-#endif
-#endif
/*
==========================================================