Skip to content
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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions ports/tidy-html5/cmake_find_package_support.patch
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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
+install(TARGETS ${name} EXPORT tidy-html5Config
+install(TARGETS ${name} EXPORT unofficial-tidy-html5Config

Copy link
Member

Choose a reason for hiding this comment

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

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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
+ install(TARGETS ${name} EXPORT tidy-html5Config
+ install(TARGETS ${name} EXPORT unofficial-tidy-html5Config

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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
+install(EXPORT tidy-html5Config
+install(EXPORT unofficial-tidy-html5Config

+ DESTINATION ${LIB_INSTALL_DIR}/cmake/tidy-html5
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
+ DESTINATION ${LIB_INSTALL_DIR}/cmake/tidy-html5
+ DESTINATION ${LIB_INSTALL_DIR}/cmake/unofficial-tidy-html5

+ NAMESPACE tidy-html5::)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
+ NAMESPACE tidy-html5::)
+ NAMESPACE unofficial::tidy-html5::)

+

#------------------------------------------------------------------------
# Main Executable
2 changes: 2 additions & 0 deletions ports/tidy-html5/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -21,6 +22,7 @@ vcpkg_cmake_configure(
)
vcpkg_cmake_install()
vcpkg_fixup_pkgconfig()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/tidy-html5)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/tidy-html5)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/unofficial-tidy-html5)


file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
Expand Down
6 changes: 5 additions & 1 deletion ports/tidy-html5/vcpkg.json
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
}
]
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -8862,7 +8862,7 @@
},
"tidy-html5": {
"baseline": "5.8.0",
"port-version": 1
"port-version": 2
},
"tiff": {
"baseline": "4.6.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/t-/tidy-html5.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "7337a076037d8bf318bec1988798b6f6215efec0",
"version": "5.8.0",
"port-version": 2
},
{
"git-tree": "3ff916aaab30ac5a85e702ab9cf4e8092db79477",
"version": "5.8.0",
Expand Down