# Build the demo app, small examples
+
+ if(COMMAND cmake_policy)
+ cmake_policy(SET CMP0003 NEW)
+ endif(COMMAND cmake_policy)
+
+
# First thing define the common source:
SET(common_SRCS
convert.c
${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)
+#FOREACH(exe j2k_to_image image_to_j2k)
+FOREACH(exe image_to_j2k)
ADD_EXECUTABLE(${exe} ${exe}.c ${common_SRCS})
TARGET_LINK_LIBRARIES(${exe} ${OPJ_PREFIX}openjpeg)
+ # On unix you need to link to the math library:
IF(UNIX)
TARGET_LINK_LIBRARIES(${exe} -lm)
ENDIF(UNIX)