-
Notifications
You must be signed in to change notification settings - Fork 7.5k
[odbccpp] Add new port #50152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[odbccpp] Add new port #50152
Changes from all commits
a7ea7ea
937cdc4
c95f982
8810753
b763f24
af41392
44e8c9e
2ac765b
03d31da
f5087a4
8615dfb
8078683
d6459cc
fc3442f
906eaf6
53ab57e
3d4c8e9
b01fd81
cb172d5
cf9cbe1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO SAP/odbc-cpp-wrapper | ||
| REF "v${VERSION}" | ||
| SHA512 c36d83b0ec5a560c2e845001594f549d1cc39d721e25345cbc6525458ec1591e01e5ae49cacd01807eed86db38ed717d55d63c94d7e7179010752044855bf838 | ||
| HEAD_REF master | ||
| PATCHES | ||
| use-vcpkg-unixodbc.patch | ||
| ) | ||
|
|
||
| vcpkg_list(SET options) | ||
| if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) | ||
| list(APPEND options -DODBCCPP_USE_UNIXODBC=ON) | ||
| endif() | ||
|
|
||
| vcpkg_cmake_configure( | ||
| SOURCE_PATH "${SOURCE_PATH}" | ||
| OPTIONS | ||
| -DCMAKE_DISABLE_FIND_PACKAGE_GTest=ON | ||
| -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON | ||
| ${options} | ||
| ) | ||
|
|
||
| vcpkg_cmake_install() | ||
|
|
||
| vcpkg_copy_pdbs() | ||
|
|
||
| file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
|
|
||
| vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT}) | ||
|
|
||
| vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -4,7 +4,15 @@ SET(CMAKE_CXX_STANDARD 11) | ||
|
|
||
| INCLUDE(GNUInstallDirs) | ||
| INCLUDE(CMakePackageConfigHelpers) | ||
|
|
||
| -FIND_PACKAGE(ODBC REQUIRED) | ||
| +IF(ODBCCPP_USE_UNIXODBC) | ||
| + FIND_PACKAGE(unofficial-unixodbc CONFIG REQUIRED) | ||
| + SET(ODBC_TARGET unofficial::unixodbc::unixodbc) | ||
| + ADD_LIBRARY(ODBC::ODBC ALIAS ${ODBC_TARGET}) | ||
| +ELSE() | ||
| + FIND_PACKAGE(ODBC REQUIRED) | ||
| + SET(ODBC_TARGET ODBC::ODBC) | ||
| +ENDIF() | ||
|
Comment on lines
+8
to
+16
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This must match the dependencies expressed in the manifests. I have more suggestions once the manifest dependency question is answered.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, this is wrongfully adapted. Depending on the result of the other comment, this probably should be IF(LINUX OR APPLE).
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The safest wiring would be an option which is controlled by the portfile. Here (project mode): if(ODBCCPP_USE_UNIXODBC)
FIND_PACKAGE(unofficial-unixodbc CONFIG REQUIRED)
SET(ODBC_TARGET unofficial::unixodbc::unixodbc)
ELSE()
...and in the portfile (vcpkg script mode): vcpkg_list(SET options)
if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX)
list(APPEND options -DODBCCPP_USE_UNIXODBC=ON)
endif()
vcpkg_cmake_configure(
...
OPTIONS
${options}
...
)
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the careful check. I added a config file to odbccpp, this is a good thing anyway. Also, I added your suggestions, I hope it fits now. |
||
| + | ||
| FIND_PACKAGE(Doxygen) | ||
| FIND_PACKAGE(GTest) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "name": "odbccpp", | ||
| "version": "1.6", | ||
| "description": "An object-oriented C++ wrapper of the ODBC API from SAP", | ||
| "homepage": "https://github.com/SAP/odbc-cpp-wrapper", | ||
| "license": "Apache-2.0", | ||
| "supports": "!uwp & !android", | ||
| "dependencies": [ | ||
| { | ||
| "name": "unixodbc", | ||
| "platform": "linux | osx" | ||
| }, | ||
| { | ||
| "name": "vcpkg-cmake", | ||
| "host": true | ||
| }, | ||
| { | ||
| "name": "vcpkg-cmake-config", | ||
| "host": true | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "versions": [ | ||
| { | ||
| "git-tree": "4cf05da841cdd917850bf0f5d90a6f2fa4f6da87", | ||
| "version": "1.6", | ||
| "port-version": 0 | ||
| } | ||
| ] | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.