build,logic : Key/License Generator

Generator using the Botan Cyrptography library
This commit is contained in:
Andreas Stallinger
2016-01-18 11:42:31 +01:00
committed by Eberhard Graether
parent 743f91e882
commit 23257a3071
31 changed files with 1260 additions and 21 deletions
+22
View File
@@ -0,0 +1,22 @@
# searching for public key file of the Coati version in setup/RSA_keys
# if found the file will be put into a const string into the PubicKeh.h file
string(REGEX REPLACE "^([0-9]+)\\..*" "\\1" VERSION_MAJOR "${GIT_VERSION_NUMBER}")
message(STATUS "Get Public Key for Coati version: ${VERSION_MAJOR}")
set(pubKeyFile "${CMAKE_SOURCE_DIR}/setup/RSA_keys/public-${VERSION_MAJOR}.pem")
# message(STATUS "file: ${pubKeyFile}")
if(EXISTS ${pubKeyFile})
file(READ ${pubKeyFile} KEY)
STRING(REGEX REPLACE "\"" "\\\\\"" KEY "${KEY}")
STRING(REGEX REPLACE "\n" "\\\\n\"\n\t\"" KEY "${KEY}")
# message(STATUS "key: ${KEY}")
else()
message(WARNING "public keyfile for this version of Coati")
endif()
configure_file(
${CMAKE_SOURCE_DIR}/cmake/PublicKey.h.in
${CMAKE_SOURCE_DIR}/build/src/app/PublicKey.h
)