mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
#223 Use cmake options to interface command line parameters, props Schaich Alonso
This commit is contained in:
parent
20663b4eed
commit
14f67331c2
@ -19,10 +19,10 @@ add_definitions(-DZINT_VERSION=\"${ZINT_VERSION}\")
|
|||||||
|
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
|
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
|
||||||
|
|
||||||
set(ZINT_DEBUG FALSE CACHE BOOL "Set debug compile flag")
|
option(ZINT_DEBUG "Set debug compile flag" OFF)
|
||||||
set(ZINT_SANITIZE FALSE CACHE BOOL "Set sanitize compile/link flags")
|
option(ZINT_SANITIZE "Set sanitize compile/link flags" OFF)
|
||||||
set(ZINT_TEST FALSE CACHE BOOL "Set test compile flag")
|
option(ZINT_TEST "Set test compile flag" OFF)
|
||||||
set(ZINT_STATIC FALSE CACHE BOOL "Build static library")
|
option(ZINT_STATIC "Build static library" OFF)
|
||||||
|
|
||||||
include(SetPaths.cmake)
|
include(SetPaths.cmake)
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ INTERNAL int png_pixel_plot(struct zint_symbol *symbol, unsigned char *pixelbuf)
|
|||||||
bg_alpha = 0xff;
|
bg_alpha = 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
num_palette = num_trans = 0;
|
num_trans = 0;
|
||||||
if (symbol->symbology == BARCODE_ULTRA) {
|
if (symbol->symbology == BARCODE_ULTRA) {
|
||||||
static const int ultra_chars[8] = { 'W', 'C', 'B', 'M', 'R', 'Y', 'G', 'K' };
|
static const int ultra_chars[8] = { 'W', 'C', 'B', 'M', 'R', 'Y', 'G', 'K' };
|
||||||
static png_color ultra_colours[8] = {
|
static png_color ultra_colours[8] = {
|
||||||
|
@ -10,9 +10,9 @@ enable_testing()
|
|||||||
|
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
||||||
|
|
||||||
set(ZINT_DEBUG FALSE CACHE BOOL "Set debug compile flag")
|
option(ZINT_DEBUG "Set debug compile flag" OFF)
|
||||||
set(ZINT_SANITIZE FALSE CACHE BOOL "Set sanitize compile/link flags")
|
option(ZINT_SANITIZE "Set sanitize compile/link flags" OFF)
|
||||||
set(ZINT_TEST FALSE CACHE BOOL "Set test compile flag")
|
option(ZINT_TEST "Set test compile flag" OFF)
|
||||||
|
|
||||||
find_package(LibZint REQUIRED)
|
find_package(LibZint REQUIRED)
|
||||||
find_package(PNG)
|
find_package(PNG)
|
||||||
|
@ -6,7 +6,7 @@ To make, first make libzint with ZINT_TEST defined:
|
|||||||
cd <project-dir>
|
cd <project-dir>
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DZINT_TEST:BOOL=1 ..
|
cmake -DZINT_TEST=ON ..
|
||||||
make
|
make
|
||||||
|
|
||||||
Then make the tests:
|
Then make the tests:
|
||||||
@ -15,7 +15,7 @@ Then make the tests:
|
|||||||
cd backend/tests
|
cd backend/tests
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -DZINT_TEST:BOOL=1 ..
|
cmake -DZINT_TEST=ON ..
|
||||||
make
|
make
|
||||||
|
|
||||||
(ZINT_TEST is needed to export INTERNAL functions for use and testing.)
|
(ZINT_TEST is needed to export INTERNAL functions for use and testing.)
|
||||||
@ -62,35 +62,35 @@ To make with gcc sanitize, first set for libzint and make:
|
|||||||
|
|
||||||
cd <project-dir>
|
cd <project-dir>
|
||||||
cd build
|
cd build
|
||||||
cmake -DZINT_SANITIZE:BOOL=1 ..
|
cmake -DZINT_SANITIZE=ON ..
|
||||||
make && sudo make install
|
make && sudo make install
|
||||||
|
|
||||||
Then set for tests and make:
|
Then set for tests and make:
|
||||||
|
|
||||||
cd <project-dir>
|
cd <project-dir>
|
||||||
cd backend/tests/build
|
cd backend/tests/build
|
||||||
cmake -DZINT_SANITIZE:BOOL=1 ..
|
cmake -DZINT_SANITIZE=ON ..
|
||||||
make
|
make
|
||||||
|
|
||||||
Similarly to make with gcc debug:
|
Similarly to make with gcc debug:
|
||||||
|
|
||||||
cd <project-dir>
|
cd <project-dir>
|
||||||
cd build
|
cd build
|
||||||
cmake -DZINT_DEBUG:BOOL=1 ..
|
cmake -DZINT_DEBUG=ON ..
|
||||||
make && sudo make install
|
make && sudo make install
|
||||||
|
|
||||||
cd <project-dir>
|
cd <project-dir>
|
||||||
cd backend/tests/build
|
cd backend/tests/build
|
||||||
cmake -DZINT_DEBUG:BOOL=1 ..
|
cmake -DZINT_DEBUG=ON ..
|
||||||
make
|
make
|
||||||
|
|
||||||
To undo sanitize/debug, remake each after setting:
|
To undo sanitize/debug, remake each after setting:
|
||||||
|
|
||||||
cmake -DZINT_SANITIZE:BOOL=0 ..
|
cmake -DZINT_SANITIZE=OFF ..
|
||||||
cmake -DZINT_DEBUG:BOOL=0 ..
|
cmake -DZINT_DEBUG=OFF ..
|
||||||
|
|
||||||
To get a clean libzint, set the above and also:
|
To get a clean libzint, set the above and also:
|
||||||
|
|
||||||
cmake -DZINT_TEST:BOOL=0 ..
|
cmake -DZINT_TEST=OFF ..
|
||||||
|
|
||||||
(The tests will now fail to link.)
|
(The tests will now fail to link.)
|
||||||
|
Loading…
Reference in New Issue
Block a user