From a61bfc5eb246e5b2ae36bf31d7122fabcb87fb71 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 29 Sep 2022 16:55:04 +0200 Subject: [PATCH] FindSQLite3: Add SQLite::SQLite3 ALIAS for compatibility with CMake's upstream FindSQLite3 Workaround for https://github.com/gazebosim/gz-cmake/issues/312 . Signed-off-by: Silvio --- cmake/FindSQLite3.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/FindSQLite3.cmake b/cmake/FindSQLite3.cmake index 75e279ad..8fd39a78 100644 --- a/cmake/FindSQLite3.cmake +++ b/cmake/FindSQLite3.cmake @@ -23,6 +23,8 @@ # Variables defined by this module: # # SQLite3::SQLite3 Imported target for sqlite3 +# SQLite::SQLite3 Imported target for sqlite3, for +# compatibility with upstream CMake # SQLite3_FOUND System has sqlite3 library and headers if(SQLite3_FIND_VERSION) @@ -54,3 +56,8 @@ if(MSVC) ign_import_target(SQLite3) endif() + +# Workaround for https://github.com/gazebosim/gz-cmake/issues/312 +if(TARGET SQLite3::SQLite3 AND NOT TARGET SQLite::SQLite3) + add_library(SQLite::SQLite3 ALIAS SQLite3::SQLite3) +endif()