[CMake] Complete Include Build Link Details

Micha Hergarden micha.hergarden at gmail.com
Tue Sep 19 13:22:20 EDT 2017


On 19-09-17 16:24, Satya Prakash Prasad wrote:
>
> We have a project which we compile it thru CMAKE utility. Our projects
> has submodules and recently it was found that developers where
> introducing code dependency across sub modules.
>
> Say we have submodule A and submodule B while main module C compiles
> both A and B and generates all the executable. As per the issue
> submodule B code is being used in submodule A. Though the code is
> compiling fine but this is highly dangerous of the dependency across
> sub modules.
>
> Now how can I know via CMAKE (logs / report / traces / build etc
> anyway) utility which includes path / link paths are involved in which
> binaries. The over all objective is to break the dependency if any.
>
> Is there a way to get any kind of details via CMAKE build process -
> the include / linking path level used for each binary (to trace libs
> across submodules being used for binaries)?
>
>
>
Hello Satya,

Unfortunately you didn't say what language & buildsystem you are using?
In my answer I am assuming c or c++: as far as I'm aware this list
cannot (easily) be obtained from CMake. However, I suggest a tool such
as 'include-what-you-use' from the Clang toolchain.
One of the issues with using CMake in this case is that it is possible
to get a working build without adding a dependency for all the necessary
files to the cmake files (e.g. by just assuming the needed files are in
a certain location and including them directly in the source files).

Hth,
Micha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170919/abd023c9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 525 bytes
Desc: OpenPGP digital signature
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170919/abd023c9/attachment.sig>


More information about the CMake mailing list