diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9bf7e89..2c597a9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,6 +11,7 @@ SET(WIN32_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zxing/win32/zxing) SET(ZXING_DIR ${CMAKE_CURRENT_SOURCE_DIR}/zxing/zxing) set(CMAKE_AUTOMOC ON) +set(CMAKE_WARN_ON) set(SOURCES @@ -39,8 +40,21 @@ endif(QZXING_USE_QML) add_library(qzxing "" ${SOURCES}) +if(WIN32) + add_subdirectory(zxing/win32) + if(MSVC) + add_definitions(-D__STDC_LIMIT_MACROS) + endif(MSVC) + + add_definitions(-DNO_ICONV) +endif(WIN32) + +if(VS_WINRT_COMPONENT) + add_definitions(-DNO_ICONV) +endif(VS_WINRT_COMPONENT) + add_subdirectory(zxing/bigint) -add_subdirectory(zxing/win32) + add_subdirectory(zxing/zxing) target_link_libraries(qzxing Qt5::Core Qt5::Gui) @@ -56,7 +70,6 @@ if(QZXING_USE_QML) Qt5::QuickControls2) endif(QZXING_USE_QML) - # Change Global Definitions depending on how you want to use the library target_compile_definitions(qzxing PUBLIC DISABLE_LIBRARY_FEATURES) diff --git a/src/zxing/win32/CMakeLists.txt b/src/zxing/win32/CMakeLists.txt index 48cacc2..b6b0a9e 100644 --- a/src/zxing/win32/CMakeLists.txt +++ b/src/zxing/win32/CMakeLists.txt @@ -4,8 +4,10 @@ SET(SOURCES zxing/iconv.h zxing/win_iconv.c - zxing/msvc/stdint.h +) - ) +if(MSVC) + LIST(APPEND SOURCES zxing/msvc/stdint.h) +endif(MSVC) target_sources(qzxing PRIVATE ${SOURCES})