[trunk] split into two config files config options related to the lib and to the application.
This commit is contained in:
parent
efaefa21fc
commit
e7bc30b409
|
@ -180,7 +180,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# opj_config.h generation (1/2)
|
# opj_config.h generation
|
||||||
include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
|
include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
|
||||||
CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
|
CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
|
||||||
CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
|
CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
|
||||||
|
@ -197,6 +197,12 @@ CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
|
||||||
include(TestLargeFiles)
|
include(TestLargeFiles)
|
||||||
OPJ_TEST_LARGE_FILES(OPJ_HAVE_LARGEFILES)
|
OPJ_TEST_LARGE_FILES(OPJ_HAVE_LARGEFILES)
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjp2/opj_config.h.cmake.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/src/lib/openjp2/opj_config.h
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Build Library
|
# Build Library
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
@ -226,14 +232,6 @@ if(BUILD_CODEC OR BUILD_MJ2)
|
||||||
endif ()
|
endif ()
|
||||||
add_subdirectory(wrapping)
|
add_subdirectory(wrapping)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
|
||||||
# opj_config.h generation (2/2)
|
|
||||||
configure_file(
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjp2/opj_config.h.cmake.in
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/src/lib/openjp2/opj_config.h
|
|
||||||
@ONLY
|
|
||||||
)
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Build DOCUMENTATION (not in ALL target and only if Doxygen is found)
|
# Build DOCUMENTATION (not in ALL target and only if Doxygen is found)
|
||||||
option(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF)
|
option(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF)
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
#-----------------------------------------------------------------------------
|
||||||
|
# opj_apps_config.h generation
|
||||||
|
configure_file(
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/opj_apps_config.h.cmake.in
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/opj_apps_config.h
|
||||||
|
@ONLY
|
||||||
|
)
|
|
@ -34,14 +34,14 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "opj_config.h"
|
#include "opj_apps_config.h"
|
||||||
#include "openjpeg.h"
|
#include "openjpeg.h"
|
||||||
#include "color.h"
|
#include "color.h"
|
||||||
|
|
||||||
#ifdef HAVE_LIBLCMS2
|
#ifdef OPJ_HAVE_LIBLCMS2
|
||||||
#include <lcms2.h>
|
#include <lcms2.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LIBLCMS1
|
#ifdef OPJ_HAVE_LIBLCMS1
|
||||||
#include <lcms.h>
|
#include <lcms.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
/* create opj_apps_config.h for CMake */
|
||||||
|
|
||||||
|
#cmakedefine OPJ_HAVE_LIBPNG @HAVE_LIBPNG@
|
||||||
|
#cmakedefine OPJ_HAVE_PNG_H @HAVE_PNG_H@
|
||||||
|
#cmakedefine OPJ_HAVE_LIBTIFF @HAVE_LIBTIFF@
|
||||||
|
#cmakedefine OPJ_HAVE_TIFF_H @HAVE_TIFF_H@
|
||||||
|
|
||||||
|
#cmakedefine OPJ_HAVE_LIBLCMS1
|
||||||
|
#cmakedefine OPJ_HAVE_LIBLCMS2
|
||||||
|
#cmakedefine OPJ_HAVE_LCMS1_H
|
||||||
|
#cmakedefine OPJ_HAVE_LCMS2_H
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ set(common_SRCS
|
||||||
# Headers file are located here:
|
# Headers file are located here:
|
||||||
include_directories(
|
include_directories(
|
||||||
${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h
|
${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h
|
||||||
|
${OPENJPEG_BINARY_DIR}/src/bin/common # opj_apps_config.h
|
||||||
${OPENJPEG_SOURCE_DIR}/src/lib/openjp2
|
${OPENJPEG_SOURCE_DIR}/src/lib/openjp2
|
||||||
${OPENJPEG_SOURCE_DIR}/src/bin/common
|
${OPENJPEG_SOURCE_DIR}/src/bin/common
|
||||||
${LCMS_INCLUDE_DIRNAME}
|
${LCMS_INCLUDE_DIRNAME}
|
||||||
|
|
|
@ -29,21 +29,21 @@
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include "opj_config.h"
|
#include "opj_apps_config.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#ifdef HAVE_LIBTIFF
|
#ifdef OPJ_HAVE_LIBTIFF
|
||||||
#include <tiffio.h>
|
#include <tiffio.h>
|
||||||
#endif /* HAVE_LIBTIFF */
|
#endif /* OPJ_HAVE_LIBTIFF */
|
||||||
|
|
||||||
#ifdef HAVE_LIBPNG
|
#ifdef OPJ_HAVE_LIBPNG
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#include <png.h>
|
#include <png.h>
|
||||||
#endif /* HAVE_LIBPNG */
|
#endif /* OPJ_HAVE_LIBPNG */
|
||||||
|
|
||||||
#include "openjpeg.h"
|
#include "openjpeg.h"
|
||||||
#include "convert.h"
|
#include "convert.h"
|
||||||
|
@ -2074,7 +2074,7 @@ int imagetopnm(opj_image_t * image, const char *outfile)
|
||||||
return 0;
|
return 0;
|
||||||
}/* imagetopnm() */
|
}/* imagetopnm() */
|
||||||
|
|
||||||
#ifdef HAVE_LIBTIFF
|
#ifdef OPJ_HAVE_LIBTIFF
|
||||||
/* -->> -->> -->> -->>
|
/* -->> -->> -->> -->>
|
||||||
|
|
||||||
TIFF IMAGE FORMAT
|
TIFF IMAGE FORMAT
|
||||||
|
@ -2795,7 +2795,7 @@ opj_image_t* tiftoimage(const char *filename, opj_cparameters_t *parameters)
|
||||||
|
|
||||||
}/* tiftoimage() */
|
}/* tiftoimage() */
|
||||||
|
|
||||||
#endif /* HAVE_LIBTIFF */
|
#endif /* OPJ_HAVE_LIBTIFF */
|
||||||
|
|
||||||
/* -->> -->> -->> -->>
|
/* -->> -->> -->> -->>
|
||||||
|
|
||||||
|
@ -3085,7 +3085,7 @@ int imagetorawl(opj_image_t * image, const char *outfile)
|
||||||
return imagetoraw_common(image, outfile, OPJ_FALSE);
|
return imagetoraw_common(image, outfile, OPJ_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBPNG
|
#ifdef OPJ_HAVE_LIBPNG
|
||||||
|
|
||||||
#define PNG_MAGIC "\x89PNG\x0d\x0a\x1a\x0a"
|
#define PNG_MAGIC "\x89PNG\x0d\x0a\x1a\x0a"
|
||||||
#define MAGIC_SIZE 8
|
#define MAGIC_SIZE 8
|
||||||
|
@ -3624,4 +3624,4 @@ fin:
|
||||||
|
|
||||||
return fails;
|
return fails;
|
||||||
}/* imagetopng() */
|
}/* imagetopng() */
|
||||||
#endif /* HAVE_LIBPNG */
|
#endif /* OPJ_HAVE_LIBPNG */
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif /* _WIN32 */
|
#endif /* _WIN32 */
|
||||||
|
|
||||||
#include "opj_config.h"
|
#include "opj_apps_config.h"
|
||||||
#include "openjpeg.h"
|
#include "openjpeg.h"
|
||||||
#include "opj_getopt.h"
|
#include "opj_getopt.h"
|
||||||
#include "convert.h"
|
#include "convert.h"
|
||||||
|
@ -1727,7 +1727,7 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef HAVE_LIBTIFF
|
#ifdef OPJ_HAVE_LIBTIFF
|
||||||
case TIF_DFMT:
|
case TIF_DFMT:
|
||||||
image = tiftoimage(parameters.infile, ¶meters);
|
image = tiftoimage(parameters.infile, ¶meters);
|
||||||
if (!image) {
|
if (!image) {
|
||||||
|
@ -1735,7 +1735,7 @@ int main(int argc, char **argv) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif /* HAVE_LIBTIFF */
|
#endif /* OPJ_HAVE_LIBTIFF */
|
||||||
|
|
||||||
case RAW_DFMT:
|
case RAW_DFMT:
|
||||||
image = rawtoimage(parameters.infile, ¶meters, &raw_cp);
|
image = rawtoimage(parameters.infile, ¶meters, &raw_cp);
|
||||||
|
@ -1761,7 +1761,7 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef HAVE_LIBPNG
|
#ifdef OPJ_HAVE_LIBPNG
|
||||||
case PNG_DFMT:
|
case PNG_DFMT:
|
||||||
image = pngtoimage(parameters.infile, ¶meters);
|
image = pngtoimage(parameters.infile, ¶meters);
|
||||||
if (!image) {
|
if (!image) {
|
||||||
|
@ -1769,11 +1769,11 @@ int main(int argc, char **argv) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif /* HAVE_LIBPNG */
|
#endif /* OPJ_HAVE_LIBPNG */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Can happen if input file is TIFF or PNG
|
/* Can happen if input file is TIFF or PNG
|
||||||
* and HAVE_LIBTIF or HAVE_LIBPNG is undefined
|
* and HAVE_LIBTIF or OPJ_HAVE_LIBPNG is undefined
|
||||||
*/
|
*/
|
||||||
if( !image) {
|
if( !image) {
|
||||||
fprintf(stderr, "Unable to load file: got no image\n");
|
fprintf(stderr, "Unable to load file: got no image\n");
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include "opj_config.h"
|
#include "opj_apps_config.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -888,7 +888,7 @@ int main(int argc, char **argv)
|
||||||
fprintf(stdout,"Generated Outfile %s\n",parameters.outfile);
|
fprintf(stdout,"Generated Outfile %s\n",parameters.outfile);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifdef HAVE_LIBTIFF
|
#ifdef OPJ_HAVE_LIBTIFF
|
||||||
case TIF_DFMT: /* TIFF */
|
case TIF_DFMT: /* TIFF */
|
||||||
if(imagetotif(image, parameters.outfile)){
|
if(imagetotif(image, parameters.outfile)){
|
||||||
fprintf(stdout,"Outfile %s not generated\n",parameters.outfile);
|
fprintf(stdout,"Outfile %s not generated\n",parameters.outfile);
|
||||||
|
@ -897,7 +897,7 @@ int main(int argc, char **argv)
|
||||||
fprintf(stdout,"Generated Outfile %s\n",parameters.outfile);
|
fprintf(stdout,"Generated Outfile %s\n",parameters.outfile);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif /* HAVE_LIBTIFF */
|
#endif /* OPJ_HAVE_LIBTIFF */
|
||||||
case RAW_DFMT: /* RAW */
|
case RAW_DFMT: /* RAW */
|
||||||
if(imagetoraw(image, parameters.outfile)){
|
if(imagetoraw(image, parameters.outfile)){
|
||||||
fprintf(stdout,"Error generating raw file. Outfile %s not generated\n",parameters.outfile);
|
fprintf(stdout,"Error generating raw file. Outfile %s not generated\n",parameters.outfile);
|
||||||
|
@ -924,7 +924,7 @@ int main(int argc, char **argv)
|
||||||
fprintf(stdout,"Successfully generated Outfile %s\n",parameters.outfile);
|
fprintf(stdout,"Successfully generated Outfile %s\n",parameters.outfile);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifdef HAVE_LIBPNG
|
#ifdef OPJ_HAVE_LIBPNG
|
||||||
case PNG_DFMT: /* PNG */
|
case PNG_DFMT: /* PNG */
|
||||||
if(imagetopng(image, parameters.outfile)){
|
if(imagetopng(image, parameters.outfile)){
|
||||||
fprintf(stdout,"Error generating png file. Outfile %s not generated\n",parameters.outfile);
|
fprintf(stdout,"Error generating png file. Outfile %s not generated\n",parameters.outfile);
|
||||||
|
@ -933,9 +933,9 @@ int main(int argc, char **argv)
|
||||||
fprintf(stdout,"Successfully generated Outfile %s\n",parameters.outfile);
|
fprintf(stdout,"Successfully generated Outfile %s\n",parameters.outfile);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif /* HAVE_LIBPNG */
|
#endif /* OPJ_HAVE_LIBPNG */
|
||||||
/* Can happen if output file is TIFF or PNG
|
/* Can happen if output file is TIFF or PNG
|
||||||
* and HAVE_LIBTIF or HAVE_LIBPNG is undefined
|
* and HAVE_LIBTIF or OPJ_HAVE_LIBPNG is undefined
|
||||||
*/
|
*/
|
||||||
default:
|
default:
|
||||||
fprintf(stderr,"Outfile %s not generated\n",parameters.outfile);
|
fprintf(stderr,"Outfile %s not generated\n",parameters.outfile);
|
||||||
|
|
|
@ -11,20 +11,12 @@
|
||||||
#cmakedefine HAVE_SYS_STAT_H @HAVE_SYS_STAT_H@
|
#cmakedefine HAVE_SYS_STAT_H @HAVE_SYS_STAT_H@
|
||||||
#cmakedefine HAVE_SYS_TYPES_H @HAVE_SYS_TYPES_H@
|
#cmakedefine HAVE_SYS_TYPES_H @HAVE_SYS_TYPES_H@
|
||||||
#cmakedefine HAVE_UNISTD_H @HAVE_UNISTD_H@
|
#cmakedefine HAVE_UNISTD_H @HAVE_UNISTD_H@
|
||||||
#cmakedefine HAVE_LIBPNG @HAVE_LIBPNG@
|
|
||||||
#cmakedefine HAVE_PNG_H @HAVE_PNG_H@
|
|
||||||
#cmakedefine HAVE_LIBTIFF @HAVE_LIBTIFF@
|
|
||||||
#cmakedefine HAVE_TIFF_H @HAVE_TIFF_H@
|
|
||||||
|
|
||||||
#cmakedefine _LARGEFILE_SOURCE
|
#cmakedefine _LARGEFILE_SOURCE
|
||||||
#cmakedefine _LARGE_FILES
|
#cmakedefine _LARGE_FILES
|
||||||
#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@
|
#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@
|
||||||
#cmakedefine HAVE_FSEEKO @HAVE_FSEEKO@
|
#cmakedefine HAVE_FSEEKO @HAVE_FSEEKO@
|
||||||
|
|
||||||
#cmakedefine HAVE_LIBLCMS1
|
|
||||||
#cmakedefine HAVE_LIBLCMS2
|
|
||||||
#cmakedefine HAVE_LCMS1_H
|
|
||||||
#cmakedefine HAVE_LCMS2_H
|
|
||||||
|
|
||||||
/* Byte order. */
|
/* Byte order. */
|
||||||
/* All compilers that support Mac OS X define either __BIG_ENDIAN__ or
|
/* All compilers that support Mac OS X define either __BIG_ENDIAN__ or
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
# Tests
|
# Tests
|
||||||
include_directories(
|
include_directories(
|
||||||
${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h
|
${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h
|
||||||
|
${OPENJPEG_BINARY_DIR}/src/bin/common # opj_apps_config.h
|
||||||
${OPENJPEG_SOURCE_DIR}/src/lib/openjp2
|
${OPENJPEG_SOURCE_DIR}/src/lib/openjp2
|
||||||
${OPENJPEG_SOURCE_DIR}/src/bin/jp2
|
${OPENJPEG_SOURCE_DIR}/src/bin/jp2
|
||||||
${OPENJPEG_SOURCE_DIR}/src/bin/common
|
${OPENJPEG_SOURCE_DIR}/src/bin/common
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "opj_config.h"
|
#include "opj_apps_config.h"
|
||||||
#include "opj_getopt.h"
|
#include "opj_getopt.h"
|
||||||
|
|
||||||
#include "openjpeg.h"
|
#include "openjpeg.h"
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
double* parseToleranceValues( char* inArg, const int nbcomp);
|
double* parseToleranceValues( char* inArg, const int nbcomp);
|
||||||
void comparePGXimages_help_display(void);
|
void comparePGXimages_help_display(void);
|
||||||
opj_image_t* readImageFromFilePGX(char* filename, int nbFilenamePGX, char *separator);
|
opj_image_t* readImageFromFilePGX(char* filename, int nbFilenamePGX, char *separator);
|
||||||
#ifdef HAVE_LIBPNG
|
#ifdef OPJ_HAVE_LIBPNG
|
||||||
int imageToPNG(const opj_image_t* image, const char* filename, int num_comp_select);
|
int imageToPNG(const opj_image_t* image, const char* filename, int num_comp_select);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -464,7 +464,7 @@ opj_image_t* readImageFromFilePGX(char* filename, int nbFilenamePGX, char *separ
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
*
|
*
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
#ifdef HAVE_LIBPNG
|
#ifdef OPJ_HAVE_LIBPNG
|
||||||
int imageToPNG(const opj_image_t* image, const char* filename, int num_comp_select)
|
int imageToPNG(const opj_image_t* image, const char* filename, int num_comp_select)
|
||||||
{
|
{
|
||||||
opj_image_cmptparm_t param_image_write;
|
opj_image_cmptparm_t param_image_write;
|
||||||
|
@ -756,7 +756,7 @@ int main(int argc, char **argv)
|
||||||
printf("<DartMeasurement name=\"NumberOfPixelsWithDifferences_%d\" type=\"numeric/int\"> %d </DartMeasurement> \n", it_comp, nbPixelDiff);
|
printf("<DartMeasurement name=\"NumberOfPixelsWithDifferences_%d\" type=\"numeric/int\"> %d </DartMeasurement> \n", it_comp, nbPixelDiff);
|
||||||
printf("<DartMeasurement name=\"ComponentError_%d\" type=\"numeric/double\"> %f </DartMeasurement> \n", it_comp, sumDiff);
|
printf("<DartMeasurement name=\"ComponentError_%d\" type=\"numeric/double\"> %f </DartMeasurement> \n", it_comp, sumDiff);
|
||||||
|
|
||||||
#ifdef HAVE_LIBPNG
|
#ifdef OPJ_HAVE_LIBPNG
|
||||||
sprintf(it_compc, "_%i", it_comp);
|
sprintf(it_compc, "_%i", it_comp);
|
||||||
strcat(it_compc,".png");
|
strcat(it_compc,".png");
|
||||||
strcat(filenamePNGbase_it_comp, it_compc);
|
strcat(filenamePNGbase_it_comp, it_compc);
|
||||||
|
|
Loading…
Reference in New Issue