The quantitative description of the Meissner effect can be done by means of the current-density functional theory for superconductors (sc-CDFT), as pointed out by W Kohn. Here, we propose a calculation scheme of the sc-CDFT. In this scheme, the superconducting gap and attractive interaction between electrons are treated as variables, while experimental data are used for the penetration depth. The variables are determined by solving the gap equation of the sc-CDFT simultaneously with the relation between energy gains of the superconducting state in the zero and nonzero magnetic field cases. This scheme is applied to homogeneous electron gas systems immersed in a magnetic field that correspond to simple models for aluminum, tin and indium immersed in a magnetic field. The magnetic field and temperature dependences of the superconducting gap are well reproduced for each case. It is also found that the attractive interaction changes with the magnetic field and temperature, which is consistent with the change in the superconducting gap.