revert to previous behaviour for cmake: builds (and links) dynamically by default. Static build only if -DBUILD_SHARED_LIBS is set to OFF.

This commit is contained in:
Antonin Descampe
2010-12-05 15:19:57 +00:00
parent cf39198a9a
commit 59d9b97ffe
9 changed files with 53 additions and 135 deletions

View File

@@ -14,10 +14,6 @@ IF(DONT_HAVE_GETOPT)
)
ENDIF(DONT_HAVE_GETOPT)
# Do the proper thing when building static...if only there was configured
# headers or def files instead
ADD_DEFINITIONS(-DOPJ_STATIC)
# Headers file are located here:
INCLUDE_DIRECTORIES(
${OPENJPEG_SOURCE_DIR}/libopenjpeg
@@ -33,7 +29,7 @@ ENDIF(TIFF_FOUND)
# Loop over all executables:
FOREACH(exe j2k_to_image image_to_j2k j2k_dump)
ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
TARGET_LINK_LIBRARIES(${exe} ${OPENJPEG_LIBRARY_NAME}.static ${LCMS_LIB})
TARGET_LINK_LIBRARIES(${exe} ${OPENJPEG_LIBRARY_NAME} ${LCMS_LIB})
IF(PNG_FOUND)
TARGET_LINK_LIBRARIES(${exe} ${PNG_LIBRARIES})
ENDIF(PNG_FOUND)