-
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
[tidy-html5] cmake find_package() support #41258
base: master
Are you sure you want to change the base?
Changes from 2 commits
ee916ab
09fc6dd
1047e62
39b94d5
faf8a34
1c2aba8
22c12de
b9f8b95
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,41 @@ | ||||||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||||||
index 8efec25..13a36ef 100644 | ||||||
--- a/CMakeLists.txt | ||||||
+++ b/CMakeLists.txt | ||||||
@@ -407,10 +407,11 @@ else () | ||||||
OUTPUT_NAME ${LIB_NAME} ) | ||||||
|
||||||
endif () | ||||||
+target_include_directories( ${name} PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>) | ||||||
if (NOT TIDY_CONSOLE_SHARED) # user wants default static linkage | ||||||
list ( APPEND add_LIBS ${name} ) | ||||||
endif () | ||||||
-install(TARGETS ${name} | ||||||
+install(TARGETS ${name} EXPORT tidy-html5Config | ||||||
RUNTIME DESTINATION ${BIN_INSTALL_DIR} | ||||||
ARCHIVE DESTINATION ${LIB_INSTALL_DIR} | ||||||
LIBRARY DESTINATION ${LIB_INSTALL_DIR} | ||||||
@@ -440,7 +441,8 @@ if (BUILD_SHARED_LIB) | ||||||
NO_SONAME ${NO_SONAME} ) | ||||||
set_target_properties( ${name} PROPERTIES | ||||||
COMPILE_FLAGS "-DBUILD_SHARED_LIB -DBUILDING_SHARED_LIB") | ||||||
- install(TARGETS ${name} | ||||||
+ target_include_directories( ${name} PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>) | ||||||
+ install(TARGETS ${name} EXPORT tidy-html5Config | ||||||
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.
Suggested change
|
||||||
RUNTIME DESTINATION ${BIN_INSTALL_DIR} | ||||||
ARCHIVE DESTINATION ${LIB_INSTALL_DIR} | ||||||
LIBRARY DESTINATION ${LIB_INSTALL_DIR} | ||||||
@@ -450,6 +452,13 @@ if (BUILD_SHARED_LIB) | ||||||
endif () | ||||||
endif () | ||||||
|
||||||
+#------------------------------------------------------------------------ | ||||||
+# CMake FIND_PACKAGE() Support | ||||||
+#------------------------------------------------------------------------ | ||||||
+install(EXPORT tidy-html5Config | ||||||
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.
Suggested change
|
||||||
+ DESTINATION ${LIB_INSTALL_DIR}/cmake/tidy-html5 | ||||||
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.
Suggested change
|
||||||
+ NAMESPACE tidy-html5::) | ||||||
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.
Suggested change
|
||||||
+ | ||||||
|
||||||
#------------------------------------------------------------------------ | ||||||
# Main Executable |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -9,6 +9,7 @@ vcpkg_from_github( | |||||
static-vs-shared.patch | ||||||
debug-postfix.patch | ||||||
fix_unsupport_func_uwp.patch | ||||||
cmake_find_package_support.patch | ||||||
) | ||||||
|
||||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED_LIB) | ||||||
|
@@ -21,6 +22,7 @@ vcpkg_cmake_configure( | |||||
) | ||||||
vcpkg_cmake_install() | ||||||
vcpkg_fixup_pkgconfig() | ||||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/tidy-html5) | ||||||
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.
Suggested change
|
||||||
|
||||||
file(REMOVE_RECURSE | ||||||
"${CURRENT_PACKAGES_DIR}/debug/include" | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
{ | ||
"name": "tidy-html5", | ||
"version": "5.8.0", | ||
"port-version": 1, | ||
"port-version": 2, | ||
"description": "Tidy tidies HTML and XML. It can tidy your documents by itself, and developers can easily integrate its features into even more powerful tools.", | ||
"homepage": "https://www.html-tidy.org", | ||
"license": null, | ||
"dependencies": [ | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
] | ||
} |
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.
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.
You can refer to this document to add CMake exports in unofficial namespaces https://github.com/microsoft/vcpkg-docs/blob/38e5ded0a49722b467ddfa1c75363c41d5107a0f/vcpkg/contributing/maintainer-guide.md#add-cmake-exports-in-an-unofficial--namespace