diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt index 1b81ad06..3e7ea256 100644 --- a/backend/CMakeLists.txt +++ b/backend/CMakeLists.txt @@ -5,7 +5,7 @@ project(zint) find_package(PNG) find_package(Qr) -set(zint_COMMON_SRCS common.c png.c library.c ps.c large.c reedsol.c) +set(zint_COMMON_SRCS common.c library.c ps.c large.c reedsol.c) set(zint_ONEDIM_SRCS code.c code128.c 2of5.c upcean.c telepen.c medical.c plessey.c rss.c) set(zint_POSTAL_SRCS postal.c auspost.c imail.c) set(zint_TWODIM_SRCS code16k.c blockf.c dmatrix.c dm200.c pdf417.c qr.c maxicode.c composite.c aztec.c) @@ -13,6 +13,7 @@ set(zint_SRCS ${zint_COMMON_SRCS} ${zint_ONEDIM_SRCS} ${zint_POSTAL_SRCS} ${zint if(PNG_FOUND) include_directories( ${PNG_INCLUDES} ) + set(zint_SRCS ${zint_SRCS} png.c) else(PNG_FOUND) add_definitions (-DNO_PNG) endif(PNG_FOUND) diff --git a/backend/aztec.c b/backend/aztec.c index 01283f7c..26a8e584 100644 --- a/backend/aztec.c +++ b/backend/aztec.c @@ -1016,4 +1016,4 @@ int aztec(struct zint_symbol *symbol, unsigned char source[]) } return err_code; -} \ No newline at end of file +} diff --git a/backend/library.c b/backend/library.c index 51448f57..e65058dc 100644 --- a/backend/library.c +++ b/backend/library.c @@ -109,7 +109,10 @@ extern int codablock(struct zint_symbol *symbol, unsigned char source[]); /* Cod extern int daft_code(struct zint_symbol *symbol, unsigned char source[]); /* DAFT Code */ extern int ean_14(struct zint_symbol *symbol, unsigned char source[]); /* EAN-14 */ +#ifndef NO_PNG extern int png_plot(struct zint_symbol *symbol); +#endif + extern int ps_plot(struct zint_symbol *symbol); int ZBarcode_Encode(struct zint_symbol *symbol, unsigned char *input) diff --git a/backend/png.c b/backend/png.c index 771cf6eb..a8e5f049 100644 --- a/backend/png.c +++ b/backend/png.c @@ -55,7 +55,6 @@ static void writepng_error_handler(png_structp png_ptr, png_const_charp msg) int png_to_file(struct zint_symbol *symbol, int image_height, int image_width, char *pixelbuf, int rotate_angle) { -#ifndef NO_PNG struct mainprog_info_type wpng_info; struct mainprog_info_type *graphic; unsigned char outdata[image_width * 3]; @@ -270,7 +269,6 @@ int png_to_file(struct zint_symbol *symbol, int image_height, int image_width, c /* make sure we have disengaged */ if (png_ptr && info_ptr) png_destroy_write_struct(&png_ptr, &info_ptr); fclose(wpng_info.outfile); -#endif return 0; } diff --git a/backend_qt4/CMakeLists.txt b/backend_qt4/CMakeLists.txt index 72844281..4431c27d 100644 --- a/backend_qt4/CMakeLists.txt +++ b/backend_qt4/CMakeLists.txt @@ -2,7 +2,7 @@ project(QZint) -include_directories(BEFORE ../backend ) +include_directories(BEFORE "${CMAKE_SOURCE_DIR}/backend" ) set(QZint_SRCS qzint.cpp) @@ -19,7 +19,7 @@ set_target_properties(QZint PROPERTIES VERSION ${ZINT_VERSION} add_dependencies(QZint zint) -link_directories( "../backend" ) +link_directories( "${CMAKE_BINARY_DIR}/backend" ) target_link_libraries(QZint zint ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY} )