2017-01-27 14:14:43 +01:00
|
|
|
if(NOT MSVC)
|
|
|
|
|
2017-01-24 13:06:07 +01:00
|
|
|
include_directories(
|
|
|
|
.
|
|
|
|
./compat
|
|
|
|
../../include
|
|
|
|
../../include/compat
|
|
|
|
)
|
|
|
|
|
|
|
|
set(
|
|
|
|
OCSPCHECK_SRC
|
|
|
|
http.c
|
|
|
|
ocspcheck.c
|
|
|
|
)
|
|
|
|
|
2017-01-26 05:58:27 +01:00
|
|
|
check_function_exists(inet_ntop HAVE_INET_NTOP)
|
|
|
|
if(HAVE_INET_NTOP)
|
|
|
|
add_definitions(-DHAVE_INET_NTOP)
|
|
|
|
else()
|
|
|
|
set(OCSPCHECK_SRC ${OCSPCHECK_SRC} compat/inet_ntop.c)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
check_function_exists(inet_ntop HAVE_MEMMEM)
|
|
|
|
if(HAVE_MEMMEM)
|
|
|
|
add_definitions(-DHAVE_MEMMEM)
|
|
|
|
else()
|
|
|
|
set(OCSPCHECK_SRC ${OCSPCHECK_SRC} compat/memmem.c)
|
|
|
|
endif()
|
|
|
|
|
2017-01-24 13:06:07 +01:00
|
|
|
if(NOT "${OPENSSLDIR}" STREQUAL "")
|
|
|
|
add_definitions(-DDEFAULT_CA_FILE=\"${OPENSSLDIR}/cert.pem\")
|
|
|
|
else()
|
|
|
|
add_definitions(-DDEFAULT_CA_FILE=\"${CMAKE_INSTALL_PREFIX}/etc/ssl/cert.pem\")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_executable(ocspcheck ${OCSPCHECK_SRC})
|
|
|
|
target_link_libraries(ocspcheck tls ${OPENSSL_LIBS})
|
|
|
|
|
2017-07-06 11:09:44 +02:00
|
|
|
if(ENABLE_LIBRESSL_INSTALL)
|
2017-07-07 08:11:11 +02:00
|
|
|
install(TARGETS ocspcheck DESTINATION ${CMAKE_INSTALL_BINDIR})
|
|
|
|
install(FILES ocspcheck.8 DESTINATION ${CMAKE_INSTALL_MANDIR}/man8)
|
|
|
|
|
2017-07-06 11:09:44 +02:00
|
|
|
endif(ENABLE_LIBRESSL_INSTALL)
|
2017-01-27 14:14:43 +01:00
|
|
|
|
|
|
|
endif()
|