[sqlite3] Namespaced targets with unofficial:: (#12516)

* [sqlite3] Namespaced targets with unofficial::

* Fix failure ports

* Update the targets name

* Update related docs
This commit is contained in:
Phoebe 2020-08-06 01:36:25 +08:00 committed by GitHub
parent 6a83b5365e
commit f3221c0405
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 24 additions and 20 deletions

View File

@ -47,8 +47,8 @@ Total elapsed time: 12.04 s
The package sqlite3:x86-windows provides CMake targets:
find_package(sqlite3 CONFIG REQUIRED)
target_link_libraries(main PRIVATE sqlite3)
find_package(unofficial-sqlite3 CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3))
```
@ -118,11 +118,11 @@ Now let's make a simple CMake project with a main file.
cmake_minimum_required(VERSION 3.0)
project(test)
find_package(sqlite3 CONFIG REQUIRED)
find_package(unofficial-sqlite3 CONFIG REQUIRED)
add_executable(main main.cpp)
target_link_libraries(main PRIVATE sqlite3)
target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3)
```
```cpp
// main.cpp

View File

@ -55,8 +55,8 @@ Total elapsed time: 44.82 s
The package sqlite3:x64-linux-dynamic provides CMake targets:
find_package(sqlite3 CONFIG REQUIRED)
target_link_libraries(main PRIVATE sqlite3)
find_package(unofficial-sqlite3 CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3)
```
Overlay triplets enables your custom triplet files when using `vcpkg install`, `vcpkg update`, `vcpkg upgrade`, and `vcpkg remove`.
@ -115,8 +115,8 @@ Total elapsed time: 44.82 s
The package sqlite3:x64-linux provides CMake targets:
find_package(sqlite3 CONFIG REQUIRED)
target_link_libraries(main PRIVATE sqlite3)
find_package(unofficial-sqlite3 CONFIG REQUIRED)
target_link_libraries(main PRIVATE unofficial::sqlite3::sqlite3)
```
Note that the default triplet is masked by your custom triplet:

View File

@ -4,7 +4,7 @@ project (libgpod C)
option(WITH_INTERNAL_GCHECKSUM OFF)
find_package(sqlite3 CONFIG REQUIRED)
find_package(unofficial-sqlite3 CONFIG REQUIRED)
include(SelectLibraryConfigurations)
find_path(glib_PATH glib.h PATHS include)
@ -66,7 +66,7 @@ if (WITH_INTERNAL_GCHECKSUM)
endif()
target_compile_definitions(libgpod PRIVATE -DLIBGPOD_BLOB_DIR=\"${LIBGPOD_BLOB_DIR}\" -DGETTEXT_PACKAGE="libgpod")
target_link_libraries(libgpod PRIVATE ${glib_LIBRARY} ${plist_LIBRARY} sqlite3)
target_link_libraries(libgpod PRIVATE ${glib_LIBRARY} ${plist_LIBRARY} unofficial::sqlite3::sqlite3)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/itdb.h DESTINATION include/libgpod/gpod)

View File

@ -1,5 +1,6 @@
Source: libgpod
Version: 2019-08-29
Port-Version: 1
Homepage: https://github.com/fadingred/libgpod
Description: libgpod is a library meant to abstract access to an iPod content.
Build-Depends: glib, libplist, sqlite3

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.0)
project(libodb-sqlite VERSION 2.4.0 LANGUAGES CXX)
find_package(odb 2.4.0 REQUIRED COMPONENTS libodb)
find_package(sqlite3 CONFIG)
find_package(unofficial-sqlite3 CONFIG)
configure_file(config.unix.h.in odb/sqlite/details/config.h COPYONLY)
set(LIBODB_INSTALL_HEADERS ON CACHE BOOL "Install the header files (a debug install)")
@ -17,7 +17,7 @@ target_include_directories(libodb-sqlite
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
)
target_link_libraries(libodb-sqlite PRIVATE odb::libodb sqlite3)
target_link_libraries(libodb-sqlite PRIVATE odb::libodb unofficial::sqlite3::sqlite3)
if(BUILD_SHARED_LIBS)
target_compile_definitions(libodb-sqlite PRIVATE
-DLIBODB_SQLITE_DYNAMIC_LIB

View File

@ -1,5 +1,6 @@
Source: libodb-sqlite
Version: 2.4.0-6
Version: 2.4.0
Port-Version: 7
Homepage: https://www.codesynthesis.com/products/odb/
Description: Sqlite support for the ODB ORM library
Build-Depends: libodb, sqlite3

View File

@ -46,11 +46,11 @@ endif()
install(
TARGETS sqlite3
EXPORT sqlite3
EXPORT unofficial-sqlite3-targets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
install(FILES sqlite3.h sqlite3ext.h DESTINATION include CONFIGURATIONS Release)
install(EXPORT sqlite3 FILE sqlite3-targets.cmake DESTINATION share/sqlite3)
install(EXPORT unofficial-sqlite3-targets NAMESPACE unofficial::sqlite3:: FILE unofficial-sqlite3-targets.cmake DESTINATION share/unofficial-sqlite3)

View File

@ -1,5 +1,6 @@
Source: sqlite3
Version: 3.32.3
Port-Version: 1
Homepage: https://sqlite.org/
Description: SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.

View File

@ -30,7 +30,7 @@ vcpkg_configure_cmake(
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets()
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-${PORT} TARGET_PATH share/unofficial-${PORT})
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
@ -40,7 +40,7 @@ endif()
configure_file(
${CMAKE_CURRENT_LIST_DIR}/sqlite3-config.in.cmake
${CURRENT_PACKAGES_DIR}/share/sqlite3/sqlite3-config.cmake
${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-sqlite3-config.cmake
@ONLY
)

View File

@ -4,4 +4,4 @@ if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static" AND NOT WIN32)
find_dependency(Threads)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/sqlite3-targets.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/unofficial-sqlite3-targets.cmake)

View File

@ -7,10 +7,10 @@ index 9363c0d..0f47f0f 100644
target_link_libraries(SQLiteCpp PUBLIC sqlite3)
else (SQLITECPP_INTERNAL_SQLITE)
- find_package (SQLite3 REQUIRED)
+ find_package(sqlite3 CONFIG)
+ find_package(unofficial-sqlite3 CONFIG)
message(STATUS "Link to sqlite3 system library")
- target_link_libraries(SQLiteCpp PUBLIC SQLite::SQLite3)
+ target_link_libraries(SQLiteCpp PRIVATE sqlite3)
+ target_link_libraries(SQLiteCpp PRIVATE unofficial::sqlite3::sqlite3)
if(SQLite3_VERSION VERSION_LESS "3.19")
set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-DSQLITECPP_HAS_MEM_STRUCT")
endif()

View File

@ -1,5 +1,6 @@
Source: sqlitecpp
Version: 3.0.0
Port-Version: 1
Build-Depends: sqlite3
Homepage: https://github.com/SRombauts/SQLiteCpp
Description: SQLiteC++ (SQLiteCpp) is a smart and easy to use C++ SQLite3 wrapper.