I have some target - say it's a library - in a CMakeLists.txt
file of a repository I'm working on. I want to the following three to be separate:
- The target name I use in
CMakeLists.txt
; say it needs to befoo
. - The exported target name, which others will use after importing my installed repository: The prefix is
mypackage
, and I want the target name to be, saybar
, so together it will be used asmypackage::bar
by the importer. - The library file basename; I want it to be
libbaz
, notlibfoo
norlibbar
.
How can I achieve this?
I may be able to achieve two of these three using the ALIAS
modifier of the add_library()
command, but I want all three.