Skip to content

Commit dc92d70

Browse files
authored
Add ALIAS target "apriltag" for "apriltag::apriltag" to achieve backwards compatibility (#167)
* apriltagConfig: Indentation * apriltagConfig: Add ALIAS target apriltag of apriltag::apriltag to achieve backwards compatibility for #166 In order to maintain backwards compatibility with versions 3.1.2 and earlier where target "apriltag" existed, add an ALIAS target to the new target with namespace ("apriltag::apriltag") introduced in commit 35f4ef2
1 parent a0b37ad commit dc92d70

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

CMake/apriltagConfig.cmake.in

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
@PACKAGE_INIT@
22

3-
if (NOT MSVC)
4-
include(CMakeFindDependencyMacro)
5-
find_dependency(Threads)
3+
if(NOT MSVC)
4+
include(CMakeFindDependencyMacro)
5+
find_dependency(Threads)
66
endif()
77

88
include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
9-
check_required_components("@PROJECT_NAME@")
9+
check_required_components("@PROJECT_NAME@")
10+
11+
if(NOT TARGET apriltag)
12+
# Make imported target globally visible in order to create an ALIAS
13+
set_target_properties(apriltag::apriltag PROPERTIES IMPORTED_GLOBAL TRUE)
14+
# Create alias for backwards compatibility with 3.1.2 and earlier (will be removed in the future - please migrate to apriltag::apriltag)
15+
add_library(apriltag ALIAS apriltag::apriltag)
16+
endif()

0 commit comments

Comments
 (0)