summaryrefslogtreecommitdiff
path: root/applications/codec
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2011-12-21 15:19:46 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2011-12-21 15:19:46 +0000
commit6b1e9d1b4e3487a576dd62a99736f73aaef1599d (patch)
tree3a9a5535949502109662a6d6267607a40bc88abe /applications/codec
parentd88dfc34728f718a112ea3935cbc848d75d75767 (diff)
Attempt to fix building of universal exe
Diffstat (limited to 'applications/codec')
-rw-r--r--applications/codec/CMakeLists.txt11
1 files changed, 9 insertions, 2 deletions
diff --git a/applications/codec/CMakeLists.txt b/applications/codec/CMakeLists.txt
index 77759f7b..31009c34 100644
--- a/applications/codec/CMakeLists.txt
+++ b/applications/codec/CMakeLists.txt
@@ -30,7 +30,14 @@ ENDIF(WIN32)
FOREACH(exe j2k_to_image image_to_j2k j2k_dump)
ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
TARGET_LINK_LIBRARIES(${exe} ${OPENJPEG_LIBRARY_NAME}
-${Z_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME} ${LCMS_LIBNAME} )
+ ${PNG_LIBNAME} ${TIFF_LIBNAME} ${LCMS_LIBNAME}
+ )
+ # To support universal exe:
+ IF(ZLIB_FOUND AND APPLE)
+ TARGET_LINK_LIBRARIES(${exe} z)
+ ELSe(ZLIB_FOUND AND APPLE)
+ TARGET_LINK_LIBRARIES(${exe} ${Z_LIBNAME})
+ ENDIF(ZLIB_FOUND AND APPLE)
# On unix you need to link to the math library:
IF(UNIX)
@@ -89,4 +96,4 @@ IF(BUILD_JPWL)
INSTALL(TARGETS JPWL_image_to_j2k JPWL_j2k_to_image
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
)
-ENDIF(BUILD_JPWL) \ No newline at end of file
+ENDIF(BUILD_JPWL)