ENH: Do the proper thing for static/shared

This commit is contained in:
Mathieu Malaterre 2006-02-05 21:39:19 +00:00
parent f31d963a64
commit 23eeec8769
2 changed files with 14 additions and 5 deletions

View File

@ -30,6 +30,12 @@ INCLUDE_DIRECTORIES(
${OPENJPEG_SOURCE_DIR}/libopenjpeg
)
# Do the proper thing when building static...if only there was configured
# headers or def files instead
IF(NOT BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_STATIC)
ENDIF(NOT BUILD_SHARED_LIBS)
# Loop over all executables:
FOREACH(exe j2k_to_image image_to_j2k)
ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})

View File

@ -21,11 +21,14 @@ SET(OpenJPEG_SRCS
tgt.c
)
# Pass proper definition to preprocessor to generate
# shared lib
IF(WIN32 AND BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_EXPORTS)
ENDIF(WIN32 AND BUILD_SHARED_LIBS)
# Pass proper definition to preprocessor to generate shared lib
IF(WIN32)
IF(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_EXPORTS)
ELSE(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DOPJ_STATIC)
ENDIF(BUILD_SHARED_LIBS)
ENDIF(WIN32)
# Create the library
ADD_LIBRARY(${OPJ_PREFIX}openjpeg ${OpenJPEG_SRCS})