Merge pull request #201 from vpicaver/master

Properly exported the defines for CMake users
This commit is contained in:
Nikos Ftylitakis 2021-08-01 15:30:01 +03:00 committed by GitHub
commit 8a36df7f57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 39 additions and 0 deletions

View File

@ -38,6 +38,10 @@ if(QZXING_USE_QML)
add_definitions(-DQZXING_QML)
endif(QZXING_USE_QML)
if(QZXING_USE_ENCODER)
add_definitions(-DENABLE_ENCODER_GENERIC -DENABLE_ENCODER_QR_CODE)
endif(QZXING_USE_ENCODER)
add_library(qzxing "" ${SOURCES})
if(WIN32)
@ -49,6 +53,10 @@ if(WIN32)
add_definitions(-DNO_ICONV)
endif(WIN32)
if(ANDROID)
add_definitions(-DNO_ICONV)
endif()
if(VS_WINRT_COMPONENT)
add_definitions(-DNO_ICONV)
endif(VS_WINRT_COMPONENT)
@ -61,6 +69,7 @@ target_link_libraries(qzxing Qt5::Core Qt5::Gui)
if(QZXING_MULTIMEDIA)
target_link_libraries(qzxing Qt5::Multimedia)
target_compile_definitions(qzxing PUBLIC -DQZXING_MULTIMEDIA)
endif(QZXING_MULTIMEDIA)
if(QZXING_USE_QML)
@ -68,8 +77,38 @@ if(QZXING_USE_QML)
Qt5::Svg
Qt5::Quick
Qt5::QuickControls2)
target_compile_definitions(qzxing PUBLIC -DQZXING_QML)
endif(QZXING_USE_QML)
if(QZXING_USE_ENCODER)
target_compile_definitions(qzxing PUBLIC -DENABLE_ENCODER_GENERIC -DENABLE_ENCODER_QR_CODE)
endif(QZXING_USE_ENCODER)
if(QZXING_USE_DECODER_QR_CODE)
target_compile_definitions(qzxing PRIVATE -DENABLE_DECODER_QR_CODE)
endif()
if(QZXING_USE_DECODER_1D_BARCODES)
target_compile_definitions(qzxing PRIVATE -DENABLE_DECODER_1D_BARCODES)
endif()
if(QZXING_USE_DECODER_DATA_MATRIX)
target_compile_definitions(qzxing PRIVATE -DENABLE_DECODER_DATA_MATRIX)
endif()
if(QZXING_USE_DECODER_AZTEC)
target_compile_definitions(qzxing PRIVATE -DENABLE_DECODER_AZTEC)
endif()
if(QZXING_USE_DECODER_PDF17)
target_compile_definitions(qzxing PRIVATE -DENABLE_DECODER_PDF17)
endif()
if(QZXING_USE_DECODER_1D_BARCODES)
target_compile_definitions(qzxing PRIVATE -DENABLE_DECODER_1D_BARCODES)
endif()
# Change Global Definitions depending on how you want to use the library
target_compile_definitions(qzxing PUBLIC DISABLE_LIBRARY_FEATURES)