[cmake-developers] daemon-mode: Project structure

Tobias Hunger Tobias.Hunger at qt.io
Thu Jun 9 10:37:43 EDT 2016


On Do, 2016-06-09 at 09:47 -0400, Brad King wrote:
> 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.

OK, I'll remove GLOBAL_TARGETs completely from the output. You can already
limited the target types that are going to be listed, and I intended to use that
mechanism to suppress GLOBAL_TARGETs when using the daemon-mode from Qt Creator.

> > 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.

I just renamed the target's "buildDirectory" to "artifactDirectory". It is
populated like this:
    const cmGeneratorTarget::OutputInfo* output =
      target->GetOutputInfo(config);
    if (output) {
      result[ARTIFACT_DIRECTORY_KEY] = output->OutDir;
    }

I assume that is the directory where (main?) artifacts will end up in?

Should I dump the other values of OutputInfo, too?
	
> > 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.

I will look into that next.

Best Regards,
Tobias

-- 
Tobias Hunger, Senior Software Engineer | The Qt Company
The Qt Company GmbH, Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Mika Harjuaho. Sitz der
Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B


More information about the cmake-developers mailing list