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

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to