[trunk] search for kdu_expand in a more cmake-compliant way

This commit is contained in:
Julien Malik 2011-11-27 22:27:50 +00:00
parent 769982d058
commit 27ba604ad7
2 changed files with 13 additions and 9 deletions

View File

@ -219,10 +219,15 @@ IF(BUILD_TESTING)
$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)

View File

@ -17,11 +17,10 @@ CONFIGURE_FILE("opj_ref_decode_cmd.sh.in"
"${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)