An exemplary camera module includes a barrel and a holder. The holder includes an accommodating space defined therein. The barrel is received in the accommodating space of the holder. Independent grooves are formed in one of the outer cylindrical surface of the barrel and the inner cylindrical surface the holder. Stripe-shaped protrusions are formed on the other of the outer cylindrical surface of the barrel and the inner cylindrical surface the holder. Each stripe-shaped protrusion is engaged in a respective groove.