ENH: Do the proper thing for static/shared
This commit is contained in:
parent
f31d963a64
commit
23eeec8769
|
@ -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})
|
||||
|
|
|
@ -21,11 +21,14 @@ SET(OpenJPEG_SRCS
|
|||
tgt.c
|
||||
)
|
||||
|
||||
# Pass proper definition to preprocessor to generate
|
||||
# shared lib
|
||||
IF(WIN32 AND BUILD_SHARED_LIBS)
|
||||
# Pass proper definition to preprocessor to generate shared lib
|
||||
IF(WIN32)
|
||||
IF(BUILD_SHARED_LIBS)
|
||||
ADD_DEFINITIONS(-DOPJ_EXPORTS)
|
||||
ENDIF(WIN32 AND BUILD_SHARED_LIBS)
|
||||
ELSE(BUILD_SHARED_LIBS)
|
||||
ADD_DEFINITIONS(-DOPJ_STATIC)
|
||||
ENDIF(BUILD_SHARED_LIBS)
|
||||
ENDIF(WIN32)
|
||||
|
||||
# Create the library
|
||||
ADD_LIBRARY(${OPJ_PREFIX}openjpeg ${OpenJPEG_SRCS})
|
||||
|
|
Loading…
Reference in New Issue