File tree Expand file tree Collapse file tree 1 file changed +32
-4
lines changed Expand file tree Collapse file tree 1 file changed +32
-4
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,13 @@ The following cache variables may also be set:
3030* `Tidy_INCLUDE_DIR` - Directory containing package library headers.
3131* `Tidy_LIBRARY` - The path to the package library.
3232
33+ ## Hints
34+
35+ This module accepts the following variables before calling `find_package(Tidy)`:
36+
37+ * `Tidy_USE_STATIC_LIBS` - Set this variable to boolean true to search for
38+ static libraries.
39+
3340## Examples
3441
3542Basic usage:
@@ -58,12 +65,24 @@ if(PkgConfig_FOUND)
5865 pkg_check_modules(PC_Tidy QUIET tidy)
5966endif ()
6067
68+ if (Tidy_USE_STATIC_LIBS)
69+ set (
70+ _Tidy_NAMES
71+ tidys # Some Unix-like systems.
72+ tidy_a # Windows.
73+ )
74+ else ()
75+ set (
76+ _Tidy_NAMES
77+ tidy
78+ tidy5 # tidy-html5 on FreeBSD
79+ tidyp # Tidy library fork (obsolete)
80+ )
81+ endif ()
82+
6183find_library (
6284 Tidy_LIBRARY
63- NAMES
64- tidy
65- tidy5 # tidy-html5 on FreeBSD
66- tidyp # Tidy library fork (obsolete)
85+ NAMES ${_Tidy_NAMES}
6786 NAMES_PER_DIR
6887 HINTS ${PC_Tidy_LIBRARY_DIRS}
6988 DOC "The path to the Tidy library"
@@ -113,6 +132,7 @@ find_package_handle_standard_args(
113132)
114133
115134unset (_reason)
135+ unset (_Tidy_NAMES)
116136
117137if (NOT Tidy_FOUND)
118138 return ()
@@ -127,4 +147,12 @@ if(NOT TARGET Tidy::Tidy)
127147 IMPORTED_LOCATION "${Tidy_LIBRARY} "
128148 INTERFACE_INCLUDE_DIRECTORIES "${Tidy_INCLUDE_DIR} "
129149 )
150+
151+ if (Tidy_USE_STATIC_LIBS AND CMAKE_SYSTEM_NAME STREQUAL "Windows" )
152+ set_target_properties (
153+ Tidy::Tidy
154+ PROPERTIES
155+ INTERFACE_COMPILE_DEFINITIONS "TIDY_STATIC"
156+ )
157+ endif ()
130158endif ()
You can’t perform that action at this time.
0 commit comments