xca/cmake/text_header_file.cmake
Christian Hohnstaedt 7d3ff4f0f9 Add OpenSSL PURPOSE and validation results
A new tab on the certificate details dialog
shows the result of the OpenSSL validation process
and the calculated OpenSSL Purpose.

The translation of the OpenSSL X509_V_ERR.... messsages
back to strings is done by grepping them from "openssl/x509_vfy.h"
and wrapping them into a macro-call.
Additionally guard them by an #ifdef (Zombieland rule #2: Double-Tap)
This way:
 - I don't need to test and check in which versions of OpenSSL
   which errors are available or not
 - New errors will be picked up automatically, as long as they
   match the "X509_V_ERR_" pattern
2024-09-29 14:12:17 +02:00

20 lines
572 B
CMake

if (FILE AND SRC AND DST)
if (APPLE)
set(DIR_HINT "HOME/Library/Application Support/data/xca/${FILE}.txt")
elseif (WIN32)
set(DIR_HINT "PROFILE\\Application Data\\xca\\${FILE}.txt")
else()
set(DIR_HINT "/usr/local/share/xca/${FILE}.txt or HOME/.local/share/xca/${FILE}.txt")
endif()
file(READ "${SRC}/preamble.txt" PREAMBLE)
file(READ "${SRC}/${FILE}.text" CONT)
file(WRITE "${DST}/${FILE}.txt"
${PREAMBLE} "\n# "
${DIR_HINT} "\n"
${CONT})
else()
message(FATAL_ERROR "Mandatory FILE or SRC variable not defined")
endif()