opj_jp2_read_header(): move setting icc_profile here instead in opj_jp2_decode()...
[openjpeg.git] / tests / unit / CMakeLists.txt
index 984cedc349caeb983a392ba0dace1cdb7749ba41..652643e614bf8be8458498f034d88f54d754de45 100644 (file)
@@ -1,14 +1,21 @@
-# UNIT TESTS 
+# UNIT TESTS
 
 include_directories(
   ${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h
   ${OPENJPEG_SOURCE_DIR}/src/lib/openjp2
 )
 
-add_executable(testempty1 testempty1.c)
-add_executable(testempty2 testempty2.c)
-target_link_libraries(testempty1 openjp2)
-target_link_libraries(testempty2 openjp2)
+set(unit_test
+  testempty0
+  testempty1
+  testempty2
+)
+foreach(ut ${unit_test})
+  add_executable(${ut} ${ut}.c)
+  target_link_libraries(${ut} openjp2)
+  add_test(NAME ${ut} COMMAND ${ut})
+endforeach()
 
-add_test(testempty1 ${EXECUTABLE_OUTPUT_PATH}/testempty1)
-add_test(testempty2 ${EXECUTABLE_OUTPUT_PATH}/testempty2)
+add_executable(testjp2 testjp2.c)
+target_link_libraries(testjp2 openjp2)
+add_test(NAME testjp2 COMMAND testjp2 ${OPJ_DATA_ROOT})