|
|
@@ -32,12 +32,53 @@ bool cmGetTargetPropertyCommand::InitialPass(
|
|
|
if ( i != targets.end())
|
|
|
{
|
|
|
cmTarget& target = i->second;
|
|
|
- const char *prop = target.GetProperty(args[2].c_str());
|
|
|
- if (prop)
|
|
|
+ if ( args[2] == "LOCATION" )
|
|
|
{
|
|
|
- m_Makefile->AddDefinition(var, prop);
|
|
|
+ std::string target_location;
|
|
|
+ switch( target.GetType() )
|
|
|
+ {
|
|
|
+ case cmTarget::STATIC_LIBRARY:
|
|
|
+ case cmTarget::MODULE_LIBRARY:
|
|
|
+ case cmTarget::SHARED_LIBRARY:
|
|
|
+ target_location = m_Makefile->GetSafeDefinition("LIBRARY_OUTPUT_PATH");
|
|
|
+ break;
|
|
|
+ case cmTarget::EXECUTABLE:
|
|
|
+ target_location = m_Makefile->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH");
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ m_Makefile->AddDefinition(var, "NOTFOUND");
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if ( target_location.size() == 0 )
|
|
|
+ {
|
|
|
+ target_location += m_Makefile->GetCurrentOutputDirectory();
|
|
|
+ }
|
|
|
+ if ( target_location.size() > 0 )
|
|
|
+ {
|
|
|
+ target_location += "/";
|
|
|
+ }
|
|
|
+ const char* cfgid = m_Makefile->GetDefinition("CMAKE_CFG_INTDIR");
|
|
|
+ if ( cfgid && strcmp(cfgid, ".") != 0 )
|
|
|
+ {
|
|
|
+ target_location += cfgid;
|
|
|
+ target_location += "/";
|
|
|
+ }
|
|
|
+
|
|
|
+ cmLocalGenerator* lg = m_Makefile->GetLocalGenerator();
|
|
|
+ target_location += lg->GetFullTargetName(targetName, target);
|
|
|
+ m_Makefile->AddDefinition(var, target_location.c_str());
|
|
|
return true;
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ const char *prop = 0;
|
|
|
+ prop = target.GetProperty(args[2].c_str());
|
|
|
+ if (prop)
|
|
|
+ {
|
|
|
+ m_Makefile->AddDefinition(var, prop);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
m_Makefile->AddDefinition(var, "NOTFOUND");
|
|
|
return true;
|