On 05/26/2015 05:14 PM, Stephen Kelly wrote:
>> This would amount to a separate task of making IMPORTED_LOCATION
>> an error on an INTERFACE library.
> 
> Actually this is already an error case because IMPORTED_LOCATION is not 
> whitelisted, so nothing more to do.

Great.

> +        " property value\n  " + value + "\nmay not start in '-'.");
> 
> should be "may not start with ..."

Fixed.

> It seems that the meaning of INTERFACE libraries is being overloaded
> with the opposite of their meaning.

The meaning of INTERFACE is that it specifies usage requirements
without itself building anything.  Specifying a library name to
be placed on the link line is a usage requirement.  The target
does not build the named library.  I've updated the documentation
to use better wording for this:

 An interface library builds no library file itself but does specify
 usage requirements for its consumers.  The ``IMPORTED_LIBNAME``
 property may be set to specify a single library name to be placed
 on the link line in place of the interface library target name as
 a requirement for using the interface.

> How about allowing the IMPORTED_LIBNAME for only 'UNKNOWN IMPORTED' 
> libraries instead.

We already allow $<TARGET_FILE:...> for UNKNOWN IMPORTED libraries
so they need an IMPORTED_LOCATION with a full path like any other.

> Also the changes regarding MAP_IMPORTED_CONFIG for INTERFACE libraries can 
> be implemented separately if they make sense (I don't know what's motivating 
> them) instead having them as a side effect of the branch as it is currently.

They are needed to select the proper IMPORTED_LIBNAME_<CONFIG>
possibly mapped from the consuming project's configuration.
The fact that this could be done with just the hunk

 -  std::string const locPropBase = "IMPORTED_LOCATION";
 +  std::string const locPropBase =
 +    this->GetType() == INTERFACE_LIBRARY?
 +    "IMPORTED_LIBNAME" : "IMPORTED_LOCATION";

shows how purely IMPORTED_LIBNAME corresponds to IMPORTED_LOCATION.

The commit with the above revisions is here:

 Allow imported INTERFACE libraries to specify a link library name
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=91b38b03

Thanks,
-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