I have a project structure as follows. A.dll depends on B.exe, B.exe depends on custom target C. The custom target C generates some files, which B.exe packages in an archive as a post build step on target B.
When I first build A.dll, since it is the first time B.exe gets built and as a post build step myArchieve.a gets built. From then on if I build the A.dll, B.exe doesn't get rebuilt, since it's an executable and it exists because of a previous build. The problems because of this are :
1. I always have a stale executable
2. If I make some changes to C and trigger a build of A.dll, cmake just rebuilds C and A. It doesn't rebuild B.exe and as a result it missed the archieve step and my archieve never gets updated.
Is there a solution to this problem ? I have read this link already and doesn't help much.