$ENV{OPJ_DATA_ROOT}
${CMAKE_SOURCE_DIR}/../data
)
-
- # For encoding tests we need the path to the ref decoder exe/lib (kakadu)
- SET (REF_DECODER_BIN_PATH "NOTFOUND" CACHE PATH "Single directory where find the reference decoder binaries to enable encoding test suite.")
- MARK_AS_ADVANCED(REF_DECODER_BIN_PATH)
+
+ # For encoding tests we need the path to the ref decoder exe/lib (kakadu)
+ FIND_PROGRAM(REF_DECODER_BIN
+ NAMES kdu_expand
+ DOC "Kakadu kdu_expand program used in encoder non-regression testing")
+ IF(REF_DECODER_BIN)
+ GET_FILENAME_COMPONENT(REF_DECODER_BIN_PATH ${REF_DECODER_BIN} PATH CACHE)
+ MARK_AS_ADVANCED(REF_DECODER_BIN_PATH)
+ ENDIF(REF_DECODER_BIN)
# Add repository where to find tests
ADD_SUBDIRECTORY(tests)
"${CMAKE_CURRENT_BINARY_DIR}/opj_ref_decode_cmd.sh"
@ONLY)
ENDIF (NOT WIN32)
-
-STRING(COMPARE EQUAL ${REF_DECODER_BIN_PATH} "NOTFOUND" REF_DECODER_NOTFOUND)
-IF (REF_DECODER_NOTFOUND)
- MESSAGE(STATUS "REF_DECODER_BIN_PATH not found, if you want all the encoding tests suite please provide a regular path")
-ENDIF (REF_DECODER_NOTFOUND)
+
+IF (NOT REF_DECODER_BIN_PATH)
+ MESSAGE(STATUS "REF_DECODER_BIN_PATH not set, if you want all the encoding tests suite provide the path to kdu_expand")
+ENDIF (NOT REF_DECODER_BIN_PATH)