Files
sethLabels/backends/barcode/CMakeLists.txt
T
Jaye Evins 1c902230fe Big-Ugly Style Update (#278)
* Bulk replaced tabs with spaces
* Bulk removed trailing whitespace from lines
* Replaced c-style comments with c++-style comments in file banners
* Replace nested namespace definitions with single concise definitions (C++17), this keeps the indentation more manageable
* Cleanup ordering and spacing of include directives
* Bulk renaming of header file extensions from '.h' to '.hpp'.
* Update CODING-STYLE.md
* Update target_compile_features from cxx_std_11 to cxx_std_20.
* Refresh .clang-format file.  Still needs a lot of tweaking.
2026-01-07 19:43:34 -05:00

68 lines
1.3 KiB
CMake

project (Barcode LANGUAGES CXX)
#=======================================
# Handle optional dependencies
#=======================================
if (${GNUBARCODE_FOUND})
add_definitions (-DHAVE_GNU_BARCODE=1)
set (OPTIONAL_GNUBARCODE GNU::BARCODE)
else ()
set (OPTIONAL_GNUBARCODE "")
endif ()
if (${LIBQRENCODE_FOUND})
add_definitions (-DHAVE_QRENCODE=1)
set (OPTIONAL_QRENCODE QRENCODE::QRENCODE)
else ()
set (OPTIONAL_QRENCODE "")
endif ()
if (${LIBZINT_FOUND})
add_definitions (-DHAVE_ZINT=1)
add_definitions (-DHAVE_ZINT=1 -DLIBZINT_VERSION=${LIBZINT_VERSION})
set (OPTIONAL_ZINT ZINT::ZINT)
else ()
set (OPTIONAL_ZINT "")
endif ()
#=======================================
# Sources
#=======================================
set (barcode_sources
Backends.cpp
Style.cpp
GnuBarcode.cpp
QrEncode.cpp
Zint.cpp
)
set (barcode_qobject_headers
Backends.hpp
)
qt6_wrap_cpp (barcode_moc_sources ${barcode_qobject_headers})
#=====================================
# Target
#=====================================
add_library (Barcode STATIC
${barcode_sources}
${barcode_moc_sources}
)
target_compile_features (Barcode
PUBLIC cxx_std_20
)
target_include_directories (Barcode
PUBLIC ..
)
target_link_libraries (Barcode
glbarcode
Qt6::Core
${OPTIONAL_GNUBARCODE}
${OPTIONAL_ZINT}
${OPTIONAL_QRENCODE}
)