2026-10-19 18:08:35 +08:00
|
|
|
cmake_minimum_required(VERSION 3.12)
|
2026-10-22 15:33:18 +08:00
|
|
|
project(haining_card_reader LANGUAGES C CXX)
|
2026-10-19 18:08:35 +08:00
|
|
|
|
|
|
|
|
# Build with: cmake -A Win32 -T v141 ..
|
|
|
|
|
# This project targets 32-bit Windows 7 SP1 and later, subject to the vendor
|
|
|
|
|
# device drivers and their installed dependencies.
|
|
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
|
2026-10-22 15:33:18 +08:00
|
|
|
add_executable(HainingCardReader WIN32 src/main.cpp src/qrcodegen.c)
|
|
|
|
|
target_compile_definitions(HainingCardReader PRIVATE UNICODE _UNICODE WIN32_LEAN_AND_MEAN)
|
|
|
|
|
target_link_libraries(HainingCardReader PRIVATE ws2_32 comctl32)
|
2026-10-19 18:08:35 +08:00
|
|
|
|
|
|
|
|
if(MSVC)
|
2026-10-22 15:33:18 +08:00
|
|
|
target_compile_options(HainingCardReader PRIVATE /W4 /permissive- /utf-8 /MT)
|
2026-10-19 18:08:35 +08:00
|
|
|
# target_link_options was added after the CMake bundled with VS2017.
|
2026-10-22 15:33:18 +08:00
|
|
|
set_property(TARGET HainingCardReader APPEND_STRING PROPERTY LINK_FLAGS " /SUBSYSTEM:WINDOWS,6.01")
|
2026-10-19 18:08:35 +08:00
|
|
|
endif()
|