In this paper, we study the CP violating processes in a general two-Higgs-doublet model (2HDM) with tree-level flavor changing neutral currents. In this model, sizable Yukawa couplings involving top and charm quarks are still allowed by the collider and flavor experiments, while the other couplings are strongly constrained experimentally. The sizable couplings, in general, have imaginary parts and could largely contribute to the CP violating observables concerned with the $B$ and $K$ mesons. In particular, the contribution may be so large that it affects the direct CP violating $K$ meson decay, where the discrepancy between the experimental result and the Standard Model prediction is reported. We discuss how well the anomaly is resolved in the 2HDM, based on study of the other flavor observables. We also propose the way to test our 2HDM at the LHC.