1/40 second is a pretty slow shutter speed for sun-lit pictures.
This is suggestive that you are using a very small aperture, like f/22, which will give you a soft image due to diffraction. On an APS-C sized sensor, f/13 is about the smallest aperture you can use for reasonable sharpness. As a rule of thumb for inexpensive to mid-priced lenses, landscape should use an aperture around f/8. This is a sweet spot for many f/4 lenses and gives you a reasonable depth of field.
Also, hand-holding a camera at 1/40 seconds with a 24mm lens is on the edge of sanity for a person experienced at shooting slow shutter speeds unless you have image stabilization.
You could also be focusing on the wrong thing, perhaps something closer than the scenery.
[Edit]
In regards to the comments why I believe the shutter speed forced the OP to use a small aperture:
Going by the sunny-16 rule which states on a sunny day the shutter speed is the reciprocal of ISO when using an aperture of f/16.
At f/16 and a shutter speed of 1/40 seconds gives an ISO of 40 (going by the sunny-16 rule).
The difference between f/16 and f/8 (as claimed by the OP) is 2-stops.
Thus, the ISO sensitivity on the camera would need to be 10 as Euri points out in the comments, around 3.3-stops off. The 70D minimum ISO is 100.
Perhaps the OP meant to say the shutter speed was 1/400 seconds. Without EXIF data, it's hard to make a reasonable guess as to why the image looks soft.