[cmake-developers] daemon-mode: Project structure

Brad King brad.king at kitware.com
Thu Jun 9 09:47:11 EDT 2016


On 06/09/2016 09:27 AM, Tobias Hunger wrote:
> I am using the output of cmState::GetTargetTypeName.

Okay.  We could consider excluding GLOBAL_TARGET targets from the
output.  They never have source files and are nebulously defined.

> How can I get the directory a library/executable will be put into during the
> build?

See the cmGeneratorTarget::GetFullPath.  That is one place that has
been cleaned up to be consistent across generators.

> For libraries the directory should be enough -- that suffices to set up
> LD_LIBRARY_PATH or whatever is needed for the system to look up libraries. For
> executables (which I need the full path of), the fullName combined with an
> artifact directory is probably enough.

For shared libraries there can be two separate directories on Windows.
The .lib and .dll parts can be in different directories.  I think it
is simpler to enumerate the artifacts with some meta-data about the
type of each one.  The clients can compute from that the directories
or runtime path information that they need.

> I would also like to put the location after "make install"

The information is not associated with cmTarget or cmGeneratorTarget.
Each target may have more than one install rule, so the destinations
are associated with the install rules generated by the install()
command.

See cmInstallTargetGenerator and cmExportInstallFileGenerator for
some of that infrastructure.

-Brad



More information about the cmake-developers mailing list