mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 08:34:37 +08:00
Emit deprecation warning on unscoped import target usage
CMake will print the following warning: CMake Warning (dev) at CMakeLists.txt:n (target_link_libraries): The library that is being linked to, ceres, is marked as being deprecated by the owner. The message provided by the developer is: The unscoped import target `ceres' is deprecated and will be removed in a future Ceres Solver release. Please use the Ceres::ceres import target instead. This warning is for project developers. Use -Wno-dev to suppress it. Change-Id: I5abc875b1f61e1f47523375d1579a188047c45d4
This commit is contained in:
@@ -310,4 +310,10 @@ if (NOT TARGET ceres)
|
||||
# true ALIAS library in CMake terms as they cannot point to imported targets.
|
||||
add_library(ceres INTERFACE IMPORTED)
|
||||
set_target_properties(ceres PROPERTIES INTERFACE_LINK_LIBRARIES Ceres::ceres)
|
||||
|
||||
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.17)
|
||||
set_target_properties(ceres PROPERTIES DEPRECATION
|
||||
"The unscoped import target `ceres' is deprecated and will be removed in a \
|
||||
future Ceres Solver release. Please use the Ceres::ceres import target instead.")
|
||||
endif (CMAKE_VERSION VERSION_GREATER_EQUAL 3.17)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user