Skip to content

[odbccpp] Add new port#50152

Draft
florsap wants to merge 9 commits intomicrosoft:masterfrom
florsap:add-odbccpp
Draft

[odbccpp] Add new port#50152
florsap wants to merge 9 commits intomicrosoft:masterfrom
florsap:add-odbccpp

Conversation

@florsap
Copy link

@florsap florsap commented Feb 24, 2026

  • Changes comply with the maintainer guide.
  • The packaged project shows strong association with the chosen port name. Check this box if at least one of the following criteria is met:
    • The project is amongst the first web search results for "" or " C++". Include a screenshot of the search engine results in the PR.
Screenshot 2026-02-24 at 09 25 00
  • Optional dependencies of the build are all controlled by the port. A dependency is controlled if it is declared an unconditional dependency in vcpkg.json, or explicitly disabled through patches or build system arguments such as CMAKE_DISABLE_FIND_PACKAGE_Xxx or VCPKG_LOCK_FIND_PACKAGE
  • The versioning scheme in vcpkg.json matches what upstream says.
  • The license declaration in vcpkg.json matches what upstream says.
  • The source code of the component installed comes from an authoritative source.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.

@florsap
Copy link
Author

florsap commented Feb 24, 2026

@microsoft-github-policy-service agree [company="SAP"]

@florsap
Copy link
Author

florsap commented Feb 24, 2026

@microsoft-github-policy-service agree company="SAP"

@JavierMatosD JavierMatosD marked this pull request as draft February 24, 2026 15:20
"dependencies": [
{
"name": "unixodbc",
"platform": "linux | osx"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is ODBC provided on other platforms which are not !windows?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking a look. In general I oriented on nanodbc and freetds, but I took the platform here from the supports config of unixodbc (https://github.com/microsoft/vcpkg/blob/b2f068faf45a3f04145bec0f52a66526ad590227/ports/unixodbc/vcpkg.json). For other platforms it must be provided by the system. Let me know if I miss something, I have no issue to change it to !windows if it makes sense.

Comment on lines +9 to +19
-FIND_PACKAGE(ODBC REQUIRED)
+IF(UNIX)
+ FIND_PACKAGE(unixodbc CONFIG)
+ IF(unixodbc_FOUND)
+ SET(ODBC_TARGET UNIX::odbc)
+ ENDIF()
+ENDIF()
+IF(NOT ODBC_TARGET)
+ FIND_PACKAGE(ODBC REQUIRED)
+ SET(ODBC_TARGET ODBC::ODBC)
+ENDIF()
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Author

Choose a reason for hiding this comment

The 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).

@florsap
Copy link
Author

florsap commented Feb 27, 2026

Hey, Odbccpp is an open source wrapper for the odbc api to use in c++. Currently, it is mostly used for two other open source projects GDAL and QGIS, it would be cool for them to have it available in vcpkg.
I hope the change is fine, I tried to orient on available ports and hopefully didn't miss anything in the maintainer guide. Thanks for taking a look and maybe considering it.

@florsap florsap marked this pull request as ready for review February 27, 2026 16:16
@florsap florsap marked this pull request as draft February 27, 2026 18:36
@florsap florsap marked this pull request as ready for review March 2, 2026 08:14
Copy link
Contributor

@JavierMatosD JavierMatosD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tagging team review to discuss the proper find_package call


-FIND_PACKAGE(ODBC REQUIRED)
+IF(UNIX)
+ FIND_PACKAGE(unixodbc CONFIG)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. https://github.com/microsoft/vcpkg/blob/master/ports/unixodbc/usage#L4 I'll need to consult the team since this ports exports unofficial targets. Tagging vcpkg-team-review

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, it seems this is allowed and this should use the vcpkg provided configs instead.

Comment on lines +14 to +15
-DGTEST_FOUND=OFF
-DDOXYGEN_FOUND=OFF
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-DGTEST_FOUND=OFF
-DDOXYGEN_FOUND=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_GTest=ON
-DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON

)

vcpkg_cmake_install()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
vcpkg_copy_pdbs()

"dependencies": [
{
"name": "unixodbc",
"platform": "!windows"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The port in vcpkg supports "linux | osx"

@JavierMatosD JavierMatosD added requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. and removed requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. labels Mar 2, 2026
@JavierMatosD JavierMatosD marked this pull request as draft March 2, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants