File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -180,14 +180,22 @@ endif()
180180
181181find_package (SDL3 REQUIRED CONFIG REQUIRED COMPONENTS SDL3)
182182find_package (glm REQUIRED)
183- if (TARGET httlib::httplib)
183+ find_package (httplib QUIET )
184+ if (TARGET httplib::httplib)
184185 add_library (httplib ALIAS httplib::httplib)
185186else ()
186187 # Some Linux distributions do not package httplibConfig.cmake, so find the header manually
187188 find_file (CPP_HTTPLIB_HEADER httplib.h REQUIRED)
189+ find_library (CPP_HTTPLIB_LIB cpp-httplib QUIET )
188190
189191 # The target httplib::httplib cannot be created manually, so rename it
190192 add_library (httplib INTERFACE ${CPP_HTTPLIB_HEADER} )
193+
194+ # And some Linux distributions build httplib as header-only,
195+ # and some as header+library. What a mess!
196+ if (NOT ${CPP_HTTPLIB_LIB} STREQUAL "CPP_HTTPLIB_LIB-NOTFOUND" )
197+ target_link_libraries (httplib INTERFACE ${CPP_HTTPLIB_LIB} )
198+ endif ()
191199endif ()
192200find_package (ZLIB REQUIRED)
193201find_package (plog REQUIRED)
You can’t perform that action at this time.
0 commit comments