  One of the important goals at the future $e^+e^-$ colliders is to measure the
top-quark mass and width in a scan of the pair production threshold. However,
the shape of the pair-production cross section at the threshold depends also on
other model parameters, as the top Yukawa coupling, and the measurement is a
subject to many systematic uncertainties. Presented in this work is the study
of the top-quark mass determination from the threshold scan at CLIC. The most
general approach is used with all relevant model parameters and selected
systematic uncertainties included in the fit procedure. Expected constraints
from other measurements are also taken into account. It is demonstrated that
the top-quark mass can be extracted with precision of the order of 30 to 40
MeV, including considered systematic uncertainties, already for 100 fb$^{-1}$
of data collected at the threshold. Additional improvement is possible, if the
running scenario is optimised. With the optimisation procedure based on the
genetic algorithm the statistical uncertainty of the mass measurement can be
reduced by about 20-30%. Influence of the collider luminosity spectra on the
expected precision of the measurement is also studied.
