function (config_value value default)
    if("${${value}}" STREQUAL "")
        message(STATUS "Using default value for ${value} (-D${value}=${default})")
        set(${value} ${default} PARENT_SCOPE)
    endif()
endfunction()

config_value(CHUNK_DELAY 5)
config_value(CHUNK_AMOUNT 3)
config_value(TICKS_TO_INACTIVE 0)
config_value(LAMPORT_THRESHOLD 50)

if (LAMPORT_SIZE)
    if (NOT ${LAMPORT_SIZE} IN_LIST "1;2;4")
        message(SEND_ERROR "LAMPORT_SIZE value should be 1, 2 or 4.")
    endif()
else()
    config_value(LAMPORT_SIZE 4)
endif()