cmake_minimum_required(VERSION 3.12) project(haining_card_reader LANGUAGES C CXX) # 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) 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) if(MSVC) target_compile_options(HainingCardReader PRIVATE /W4 /permissive- /utf-8 /MT) # target_link_options was added after the CMake bundled with VS2017. set_property(TARGET HainingCardReader APPEND_STRING PROPERTY LINK_FLAGS " /SUBSYSTEM:WINDOWS,6.01") endif()