[CMake] What is the proper way to export targets that will be split into separate binary packages?

Nils Gladitz nilsgladitz at gmail.com
Tue Apr 28 06:21:37 EDT 2015


On 04/28/2015 11:57 AM, Nils Gladitz wrote:
>> install(TARGETS plplot1 EXPORT export_plplot1 ...)
>> install(EXPORT export_plplot1 DESTINATION ${LIB_DIR}/cmake/plplot)
>> [...]
>> install(TARGETS plplotN EXPORT export_plplotN ...)
>> install(EXPORT export_plplotN DESTINATION ${LIB_DIR}/cmake/plplot)
>>
>> (i.e., N pairs of install(TARGETS...) install(EXPORT...) signatures
>> with each pair having a unique export name)?
>
> Yes, unique/distinct export names and export files.

Perhaps to clarify unique/distinct export files at the granularity you 
actually require which doesn't necessarily mean one per target unless 
you intend to package each target independently.

Nils


More information about the CMake mailing list