-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
[openxlsx] Add new port #41150
base: master
Are you sure you want to change the base?
[openxlsx] Add new port #41150
Conversation
@microsoft-github-policy-service agree |
Why add CMakeLists.txt for libxml? It's already provided upstream. |
New port
Then run
The modification needs to meet the requirements: maintainer-guide |
ports/openxlsx/usage
Outdated
find_package(OpenXLSX CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE OpenXLSX::OpenXLSX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find_package(OpenXLSX CONFIG REQUIRED) | |
target_link_libraries(main PRIVATE OpenXLSX::OpenXLSX) | |
OpenXLSX provides CMake targets: | |
find_package(OpenXLSX CONFIG REQUIRED) | |
target_link_libraries(main PRIVATE OpenXLSX::OpenXLSX) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last empty line is a format requirement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for clarifying that to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow the pattern from vcpkg tool.
- The original indentation was right.
- There is confusion about the end of the text. What is not acceptable, and what is indicated on GH by a red
(-)
, is the text ending without a line break. In VS Code it means to add a new empty line. In most UNIX text editors, lines are always ended with a line break.
find_package(OpenXLSX CONFIG REQUIRED) | |
target_link_libraries(main PRIVATE OpenXLSX::OpenXLSX) | |
openxlsx provides CMake targets: | |
find_package(OpenXLSX CONFIG REQUIRED) | |
target_link_libraries(main PRIVATE OpenXLSX::OpenXLSX) |
Reminder: The version file is missing. Please refer to: 39493/files. |
This reverts commit ea61266.
@MonicaLiu0311 Thank you very much for all your insightful comments, I really appreciate them, I updated the fork with your suggested changes ( according to my best understanding). Please let me know if you have further comments, and please be patient with me). Thank you again |
When testing usage, the following error occurs:
test.cpp#include <iostream> #include "OpenXLSX.hpp" CMakeLists.txtcmake_minimum_required (VERSION 3.8) |
@MonicaLiu0311 Thank you very much that is fixed now. I have a question, if you dont mind please reply to them.
Thank you again for your patience. I hope to become a regular contributor to vcpkg |
ports/openxlsx/portfile.cmake
Outdated
REF master | ||
SHA512 429215a961cfcfe8fcb49ee48970dd10dccad09a5c80db2eea2413120a51a2529c9a650584a079756c3b463d53f1fcdec46fdc158ffbc680592896867f60d3ea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
REF master | |
SHA512 429215a961cfcfe8fcb49ee48970dd10dccad09a5c80db2eea2413120a51a2529c9a650584a079756c3b463d53f1fcdec46fdc158ffbc680592896867f60d3ea | |
REF "v${VERSION}" | |
SHA512 52205b394383d45c0fb16599ab96453d8a5b9b5cd596096848cc888f47565b2713d9edded06b2ecd7b67736622badf136e4b1becc57bfa5bbdcb1e063a347084 |
The regular expression for |
Notes: the patch file is to fix a compilation error in vs2019, 2022, this was already fixed in the master but not committed to the latest release
@MonicaLiu0311 Thank you very much for your comments, I added the changes you recommended. I, now, have two new questions.
Thank you for your patience |
This now works, but please note that to be able to use openxlsx in the cmakelists.txt file one has to add the following line set(CMAKE_CXX_STANDARD 17) as the some of the header files are dependent on c++17, should that be mentioned in the usage file in one way or the other? |
No.
This indicates that the tags are named
Yes. The SHA512 is to verify the downloaded archive, and it is also used as an source asset cache key.
If there is exported CMake config, the C++17 requirement could be in the exported compile features. |
- XLColor color() const | ||
- { | ||
- return XLColor(); | ||
- } | ||
+ XLColor color() const { return XLColor(); } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This patch has several such sections which are not needed to fix problems.
Either let the portfile download the original raw patch from upstream's repo,
or create a minimal patch of necessary changes.
SHA512 52205b394383d45c0fb16599ab96453d8a5b9b5cd596096848cc888f47565b2713d9edded06b2ecd7b67736622badf136e4b1becc57bfa5bbdcb1e063a347084 | ||
HEAD_REF master | ||
PATCHES | ||
compilation_fix.patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit-pick:
compilation_fix.patch | |
compilation_fix.patch |
set(CMAKE_CXX_STANDARD 17) | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
PREFER_NINJA | ||
OPTIONS | ||
-DOPENXLSX_BUILD_TESTS=OFF | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set(CMAKE_CXX_STANDARD 17) | |
vcpkg_cmake_configure( | |
SOURCE_PATH ${SOURCE_PATH} | |
PREFER_NINJA | |
OPTIONS | |
-DOPENXLSX_BUILD_TESTS=OFF | |
) | |
vcpkg_cmake_configure( | |
SOURCE_PATH ${SOURCE_PATH} | |
PREFER_NINJA | |
OPTIONS | |
-DCMAKE_CXX_STANDARD=17 | |
-DOPENXLSX_BUILD_TESTS=OFF | |
) |
Portfiles run in script mode. CMAKE_CXX_STANDARD
has no effect.
https://learn.microsoft.com/en-us/vcpkg/contributing/maintainer-guide#portfiles-are-run-in-script-mode
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
PREFER_NINJA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PREFER_NINJA |
Default.
OPTIONS | ||
-DOPENXLSX_BUILD_TESTS=OFF | ||
) | ||
vcpkg_cmake_install(DISABLE_PARALLEL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why DISABLE_PARALLEL
?
find_package(OpenXLSX CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE OpenXLSX::OpenXLSX) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No red (-)
at the end, please.
find_package(OpenXLSX CONFIG REQUIRED) | |
target_link_libraries(main PRIVATE OpenXLSX::OpenXLSX) | |
openxlsx provides CMake targets: | |
find_package(OpenXLSX CONFIG REQUIRED) | |
target_link_libraries(main PRIVATE OpenXLSX::OpenXLSX) |
Fixes #40931
find_package
calls are REQUIRED, are satisfied byvcpkg.json
's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx.vcpkg.json
matches what upstream says.vcpkg.json
matches what upstream says../vcpkg x-add-version --all
and committing the result.