cmake: make retrieve_webindex conditional on OpenSSL like retrieve_anonftps
All checks were successful
Build Debian Package / build-deb (push) Successful in 3m28s

retrieve_webindex uses https.c (OpenSSL) for HTTPS site crawling but had
find_package(OpenSSL REQUIRED) at the subdirectory level, making OpenSSL
a hard build dependency for the entire project.  Changed to mirror the
pattern used for retrieve_anonftps: guard with if(OpenSSL_FOUND) so the
binary is skipped rather than failing the configure step when libssl-dev
is absent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mario Fetka
2026-06-23 08:59:17 +02:00
parent 77347400bf
commit 67d28e809a
2 changed files with 38 additions and 35 deletions

View File

@@ -90,7 +90,7 @@ install(TARGETS
ferretd weaseld
ardomains convert_hostdb dump_hostdb dump_hostdb_ndbm
db_build db_check db_dump db_reorder db_siteidx db_stats fix_start_db restore_hostdb
parse_webindex partial_webindex retrieve_webindex
parse_webindex partial_webindex
extern_urls extern_urls_ndbm
check_webindex delete_webindex insert_webindex net_webindex
DESTINATION bin
@@ -102,6 +102,9 @@ endif()
if(OpenSSL_FOUND AND TARGET retrieve_anonftps)
install(TARGETS retrieve_anonftps DESTINATION bin)
endif()
if(OpenSSL_FOUND AND TARGET retrieve_webindex)
install(TARGETS retrieve_webindex DESTINATION bin)
endif()
if(TARGET host_manage)
install(TARGETS host_manage DESTINATION bin)
endif()

View File

@@ -1,36 +1,36 @@
find_package(OpenSSL REQUIRED)
if(OpenSSL_FOUND)
add_executable(retrieve_webindex
do_retrieve.c
fileUrl.c
http.c
https.c
lang_retrieve.c
menu.c
parse.c
retrieve_web.c
robot.c
str.c
tcp.c
url.c
urldb.c
)
add_executable(retrieve_webindex
do_retrieve.c
fileUrl.c
http.c
https.c
lang_retrieve.c
menu.c
parse.c
retrieve_web.c
robot.c
str.c
tcp.c
url.c
urldb.c
)
target_link_libraries(retrieve_webindex PRIVATE
archie_config
anonftp
archiecore
archstridx
hostdb
patrie
startdb
webindexlib
OpenSSL::SSL
OpenSSL::Crypto
)
target_link_libraries(retrieve_webindex PRIVATE
archie_config
anonftp
archiecore
archstridx
hostdb
patrie
startdb
webindexlib
OpenSSL::SSL
OpenSSL::Crypto
)
target_include_directories(retrieve_webindex PRIVATE
"${ARCHIE_ROOT}/include"
"${ARCHIE_ROOT}/webindex/lib"
"${CMAKE_CURRENT_SOURCE_DIR}"
)
target_include_directories(retrieve_webindex PRIVATE
"${ARCHIE_ROOT}/include"
"${ARCHIE_ROOT}/webindex/lib"
"${CMAKE_CURRENT_SOURCE_DIR}"
)
endif()