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
|
${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:
|
# Loop over all executables:
|
||||||
FOREACH(exe j2k_to_image image_to_j2k)
|
FOREACH(exe j2k_to_image image_to_j2k)
|
||||||
ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
|
ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
|
||||||
|
|
|
@ -21,11 +21,14 @@ SET(OpenJPEG_SRCS
|
||||||
tgt.c
|
tgt.c
|
||||||
)
|
)
|
||||||
|
|
||||||
# Pass proper definition to preprocessor to generate
|
# Pass proper definition to preprocessor to generate shared lib
|
||||||
# shared lib
|
IF(WIN32)
|
||||||
IF(WIN32 AND BUILD_SHARED_LIBS)
|
IF(BUILD_SHARED_LIBS)
|
||||||
ADD_DEFINITIONS(-DOPJ_EXPORTS)
|
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
|
# Create the library
|
||||||
ADD_LIBRARY(${OPJ_PREFIX}openjpeg ${OpenJPEG_SRCS})
|
ADD_LIBRARY(${OPJ_PREFIX}openjpeg ${OpenJPEG_SRCS})
|
||||||
|
|
Loading…
Reference in New Issue