Skip to content

Commit

Permalink
CMake: modify optioin variable
Browse files Browse the repository at this point in the history
  • Loading branch information
KangLin committed Oct 18, 2021
1 parent a68853c commit 44c3c09
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ SET(CMAKE_VERBOSE_MAKEFILE ON)
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
include(GenerateExportHeader)
include(CMakeDependentOption)

SET(BIGINT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zxing/bigint)
SET(WIN32_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zxing/win32/zxing)
Expand Down Expand Up @@ -86,15 +87,17 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE
# Need qt components
SET(QT_COMPONENTS Core Gui)

option(QZXING_MULTIMEDIA "Use multimedia" ON)
if(NOT DEFINED QZXING_MULTIMEDIA)
option(QZXING_MULTIMEDIA "Use multimedia" ON)
endif()
if(QZXING_MULTIMEDIA)
target_sources(${PROJECT_NAME} PRIVATE QZXingFilter.cpp QZXingFilter.h)
target_compile_definitions(${PROJECT_NAME} PRIVATE QZXING_MULTIMEDIA)
LIST(APPEND QT_COMPONENTS Multimedia)
SET(QZXING_QML ON)
endif(QZXING_MULTIMEDIA)

option(QZXING_QML "Use qml" ${QZXING_QML})
cmake_dependent_option(QZXING_QML "Use qml" ON
QZXING_MULTIMEDIA OFF)
if(QZXING_QML)
target_sources(${PROJECT_NAME} PRIVATE QZXingImageProvider.cpp QZXingImageProvider.h)
LIST(APPEND EXPORT_DEFINES QZXING_QML)
Expand Down

0 comments on commit 44c3c09

Please sign in to comment.