Skip to content

Commit

Permalink
[sqlite-orm] Update to latest version (microsoft#12999)
Browse files Browse the repository at this point in the history
  • Loading branch information
NancyLi1013 authored Aug 20, 2020
1 parent a6ca1a5 commit d48e2bd
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 7 deletions.
2 changes: 2 additions & 0 deletions ports/sqlite-orm/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Source: sqlite-orm
Version: 1.5
Port-Version: 1
Homepage: https://github.com/fnc12/sqlite_orm
Build-Depends: sqlite3
Description: SQLite ORM light header only library for modern C++
13 changes: 13 additions & 0 deletions ports/sqlite-orm/disable-examples.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ffbdf3..ba22109 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,7 +75,7 @@ if(SqliteOrm_BuildTests AND BUILD_TESTING)
add_subdirectory(tests)
endif()

-add_subdirectory(examples)
+#add_subdirectory(examples)

install(TARGETS sqlite_orm EXPORT "${ProjectName}Targets"
INCLUDES DESTINATION "${INCLUDE_INSTALL_DIR}" COMPONENT Development
18 changes: 18 additions & 0 deletions ports/sqlite-orm/fix-includes-not-found.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ffbdf3..a6b2659 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,11 +43,11 @@ set(SqliteOrm_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/include")
add_library(sqlite_orm INTERFACE)

target_sources(sqlite_orm INTERFACE
- $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include/sqlite_orm/sqlite_orm.h>
+ $<BUILD_INTERFACE:${SqliteOrm_INCLUDE}/include/sqlite_orm/sqlite_orm.h>
$<INSTALL_INTERFACE:include/sqlite_orm/sqlite_orm.h>)

target_include_directories(sqlite_orm INTERFACE
- $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
+ $<BUILD_INTERFACE:${SqliteOrm_INCLUDE}/include>
$<INSTALL_INTERFACE:include>)

include(ucm)
29 changes: 22 additions & 7 deletions ports/sqlite-orm/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
include(vcpkg_common_functions)
# header-only library

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO fnc12/sqlite_orm
REF e8a9e9416f421303f4b8970caab26dadf8bae98b # v1.5
SHA512 9774345e0209482a137e5f3058e2f27db55ea72fd08c44e67c0989df8927fee896cb789dcb2cd21167689c2f2be1c126bd730a6ea1083a48e6dd58fb048c6f5e
REF b30ddc6a50dc582c93cd49d8d0cf8f5025ba1d2b # 1.5
SHA512 faeeef88aef11e89e9565850c23087925fb4d75ef48a16434055f18831db8e230d044c81574d840dacca406d7095cb83a113afc326996e289ab11a02d8caa2f4
HEAD_REF master
PATCHES
fix-includes-not-found.patch
disable-examples.patch
)

file(COPY ${SOURCE_PATH}/include/sqlite_orm DESTINATION ${CURRENT_PACKAGES_DIR}/include/)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DSQLITE_ORM_ENABLE_CXX_17=OFF
-DSqliteOrm_BuildTests=OFF
-DBUILD_TESTING=OFF
)

vcpkg_install_cmake()

vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/sqlite_orm TARGET_PATH share/SqliteOrm)

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib)

file(INSTALL
${SOURCE_PATH}/LICENSE
DESTINATION ${CURRENT_PACKAGES_DIR}/share/sqlite-orm RENAME copyright)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

0 comments on commit d48e2bd

Please sign in to comment.