Remove the alias target

In some cases the definition of the alias target fails, because of
target visibility problems.
This commit is contained in:
Dennis Klein 2018-05-22 14:18:23 +02:00 committed by Mohammad Al-Turany
parent cc4a8b8f7f
commit e54db27242
2 changed files with 1 additions and 6 deletions

View File

@ -80,7 +80,7 @@ set(CMAKE_PREFIX_PATH /path/to/FairMQ_install_prefix ${CMAKE_PREFIX_PATH})
find_package(FairMQ) find_package(FairMQ)
``` ```
`find_package(FairMQ)` will define an imported target `FairMQ::FairMQ` (An alias `FairRoot::FairMQ` is also defined (if you use CMake 3.11+) for backwards compatibility, but it is deprecated). `find_package(FairMQ)` will define an imported target `FairMQ::FairMQ`.
In order to succesfully compile and link against the `FairMQ::FairMQ` target, you need to discover its public package dependencies, too. In order to succesfully compile and link against the `FairMQ::FairMQ` target, you need to discover its public package dependencies, too.

View File

@ -32,9 +32,4 @@ set(CMAKE_MODULE_PATH ${@PROJECT_NAME@_CMAKEMODDIR} ${CMAKE_MODULE_PATH})
### Import targets ### Import targets
include(@PACKAGE_CMAKE_INSTALL_PREFIX@/@PACKAGE_INSTALL_DESTINATION@/@PROJECT_EXPORT_SET@.cmake) include(@PACKAGE_CMAKE_INSTALL_PREFIX@/@PACKAGE_INSTALL_DESTINATION@/@PROJECT_EXPORT_SET@.cmake)
### Alias target for backwards compat (DEPRECATED)
if((NOT TARGET FairRoot::@PROJECT_NAME@) AND (CMAKE_VERSION VERSION_GREATER 3.10.99))
add_library(FairRoot::@PROJECT_NAME@ ALIAS @PROJECT_NAME@::@PROJECT_NAME@)
endif()
@PACKAGE_COMPONENTS@ @PACKAGE_COMPONENTS@