Invalid order of files in precompiled header
Let's say we have two targets: "target1" and "target2".
"target1" has public or interface precompiled headers.
"target2" also has precompiled headers and links "target1".
As a result "target2" generates "cmake_pch.hxx" and first includes its own headers in it, and only then the headers of "target1".
Since "target2" headers use definitions from "target1" headers I have to explicitly include "target1" headers into "target2" headers even though they are already included in the pch.
That would be really helpful if "cmake_pch.hxx" had headers from linked libraries first. This way it makes more sense.
Please see sample project attached.
cmakesample.zip
Edited by Valentin Garaschuk