diff --git a/CMakeLists.txt b/CMakeLists.txt index 48509a8..9a9108c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,13 +12,15 @@ set(EXE_NAME "qr_${CMAKE_PROJECT_VERSION}-${ARCH}") project( qr - VERSION 1.0.0 + VERSION 1.0.1 LANGUAGES CXX ) message(STATUS "ARCH:: ${ARCH}") -file(GLOB_RECURSE sources main.cpp src/*.hpp src/*.cpp lib/*.hpp lib/*.cpp) +configure_file(main.cpp main_substitute.cpp) + +file(GLOB_RECURSE sources main_substitute.cpp src/*.hpp src/*.cpp lib/*.hpp lib/*.cpp) add_executable(qr ${sources}) set_target_properties(qr PROPERTIES OUTPUT_NAME ${EXE_NAME}) diff --git a/main.cpp b/main.cpp index 4a0dc62..2114099 100644 --- a/main.cpp +++ b/main.cpp @@ -7,7 +7,8 @@ #define UNUSED(var) (void) var; -constexpr const char* VERSION = "1.0.0"; +// Version is injected through cmake +constexpr const char* VERSION = "@qr_VERSION@"; void printHelp() { std::string helpText = R"EOF( @@ -22,6 +23,9 @@ Usage: -o --output output file name -s --size desired output file size in pixels -t --type output QR code type. can be one of "small, medium, large" + +In pixel based renderers (i.e. PNG), the output size may not be exactly as +specified but be the nearest multiple of the actual cell size for the QR code. )EOF"; std::cout << "qr " << VERSION; std::cout << helpText << std::endl;