Simplify code. Use standard find_package call instead. ctest script will need to handle this now

This commit is contained in:
Mathieu Malaterre 2011-12-02 15:30:19 +00:00
parent d7388d7e80
commit d4e5366fe6
8 changed files with 34 additions and 47 deletions

View File

@ -7,6 +7,7 @@ What's New for OpenJPEG
December 2, 2011 December 2, 2011
+ [mathieu] Adding CPack mechanism + [mathieu] Adding CPack mechanism
* [mathieu] remove hack with bash around kdu_expand
December 1, 2011 December 1, 2011
* [mickael] fix a bug during the creation of the codestream index * [mickael] fix a bug during the creation of the codestream index

19
CMake/FindKAKADU.cmake Normal file
View File

@ -0,0 +1,19 @@
#
# this module looks for KAKADu
# http://www.kakadusoftware.com/
#
#
# Copyright (c) 2006-2011 Mathieu Malaterre <mathieu.malaterre@gmail.com>
#
# Redistribution and use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
FIND_PROGRAM(KDU_EXPAND_EXECUTABLE
kdu_expand
)
MARK_AS_ADVANCED(
KDU_EXPAND_EXECUTABLE
)

View File

@ -224,15 +224,6 @@ IF(BUILD_TESTING)
${CMAKE_SOURCE_DIR}/../data ${CMAKE_SOURCE_DIR}/../data
) )
# 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 repository where to find tests
ADD_SUBDIRECTORY(tests) ADD_SUBDIRECTORY(tests)

View File

@ -1,9 +1,9 @@
ifdef jpipserver ifdef jpipserver
CFLAGS = -O3 -Wall -m32 -DSERVER CFLAGS = -g -Wall -DSERVER
LIBNAME = libopenjpip_server.a LIBNAME = libopenjpip_server.a
else else
J2KINCDIR = ../../../libopenjpeg J2KINCDIR = ../../../libopenjpeg
CFLAGS = -O3 -Wall -I$(J2KINCDIR) CFLAGS = -g -Wall -I$(J2KINCDIR)
LIBNAME = libopenjpip_local.a LIBNAME = libopenjpip_local.a
endif endif

View File

@ -1,12 +1,12 @@
JPIPLIBDIR = ../libopenjpip JPIPLIBDIR = ../libopenjpip
SLIBFNAME = $(JPIPLIBDIR)/libopenjpip_server.a SLIBFNAME = $(JPIPLIBDIR)/libopenjpip_server.a
SCFLAGS = -O3 -Wall -m32 -I$(JPIPLIBDIR) -DSERVER -DQUIT_SIGNAL=\"quitJPIP\" SCFLAGS = -g -Wall -I$(JPIPLIBDIR) -DSERVER -DQUIT_SIGNAL=\"quitJPIP\"
SLDFLAGS = -L$(JPIPLIBDIR) -lm -lfcgi -lopenjpip_server SLDFLAGS = -L$(JPIPLIBDIR) -lm -lfcgi -lopenjpip_server
J2KINCDIR = ../../../libopenjpeg J2KINCDIR = ../../../libopenjpeg
J2KLIBDIR = $(J2KINCDIR)/.libs J2KLIBDIR = $(J2KINCDIR)/../bin/bin
LIBFNAME = $(JPIPLIBDIR)/libopenjpip_local.a $(J2KLIBDIR)/libopenjpeg.a LIBFNAME = $(JPIPLIBDIR)/libopenjpip_local.a $(J2KLIBDIR)/libopenjpeg.so
CFLAGS = -O3 -Wall -I$(JPIPLIBDIR) CFLAGS = -O3 -Wall -I$(JPIPLIBDIR)
LDFLAGS = -L$(JPIPLIBDIR) -L$(J2KLIBDIR) -lm -lopenjpip_local LDFLAGS = -L$(JPIPLIBDIR) -L$(J2KLIBDIR) -lm -lopenjpip_local

View File

@ -1 +1 @@
opj_viewer-20111026.jar opj_viewer-20111124.jar

View File

@ -11,19 +11,8 @@ SET(INPUT_NR_PATH ${INPUT_NR})
SET(TEMP_PATH ${TEMP}) SET(TEMP_PATH ${TEMP})
SET(INPUT_CONF_PATH ${OPJ_DATA_ROOT}/input/conformance) SET(INPUT_CONF_PATH ${OPJ_DATA_ROOT}/input/conformance)
# FIXME: should be corectly manage with a find kakadu # need kdu_expand if possible
IF (NOT WIN32) find_package(KAKADU)
CONFIGURE_FILE("opj_ref_decode_cmd.sh.in"
"${CMAKE_CURRENT_BINARY_DIR}/opj_ref_decode_cmd.sh"
@ONLY)
ENDIF (NOT WIN32)
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)
######################################################################### #########################################################################
# GENERATION OF THE TEST SUITE (DUMP) # GENERATION OF THE TEST SUITE (DUMP)
@ -264,21 +253,12 @@ FOREACH(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST})
NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-dump) NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-dump)
# Decode the encoding file with kakadu expand command # Decode the encoding file with kakadu expand command
IF (REF_DECODER_BIN_PATH) IF (KDU_EXPAND_EXECUTABLE)
IF (NOT WIN32) ADD_TEST(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-decode-ref
# Need a bash script to export the path of the kakadu library into PATH ${KDU_EXPAND_EXECUTABLE}
ADD_TEST( NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-decode-ref -i ${OUTPUT_FILENAME}
bash ${CMAKE_CURRENT_BINARY_DIR}/opj_ref_decode_cmd.sh -o ${OUTPUT_FILENAME}.raw
-i ${OUTPUT_FILENAME}
-o ${OUTPUT_FILENAME}.raw
) )
ELSE (NOT WIN32)
ADD_TEST(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-decode-ref
${REF_DECODER_BIN_PATH}/kdu_expand
-i ${OUTPUT_FILENAME}
-o ${OUTPUT_FILENAME}.raw
)
ENDIF (NOT WIN32)
SET_TESTS_PROPERTIES(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-decode-ref SET_TESTS_PROPERTIES(NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-decode-ref
PROPERTIES DEPENDS PROPERTIES DEPENDS
@ -295,7 +275,7 @@ FOREACH(OPJ_TEST_CMD_LINE ${OPJ_TEST_CMD_LINE_LIST})
PROPERTIES DEPENDS PROPERTIES DEPENDS
NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-decode-ref) NR-ENC-${INPUT_FILENAME_NAME}-${IT_TEST_ENC}-decode-ref)
ENDIF(REF_DECODER_BIN_PATH) ENDIF()
ENDIF(FAILED_TEST_FOUND) ENDIF(FAILED_TEST_FOUND)
# DECODER TEST SUITE # DECODER TEST SUITE

View File

@ -1,4 +0,0 @@
#!/bin/bash
export LD_LIBRARY_PATH="@REF_DECODER_BIN_PATH@"
echo run following command: @REF_DECODER_BIN_PATH@/kdu_expand $@
@REF_DECODER_BIN_PATH@/kdu_expand $@