also set HTML version by cmake

This commit is contained in:
CaCO3
2022-09-19 08:22:44 +02:00
parent 2d68f44a40
commit dd8500052e
4 changed files with 7 additions and 4 deletions

View File

@@ -39,6 +39,7 @@ set(VERSION "const char* GIT_REV=\"${GIT_REV}${GIT_DIFF}\";
const char* GIT_TAG=\"${GIT_TAG}\";
const char* GIT_BRANCH=\"${GIT_BRANCH}\";
const char* BUILD_TIME=\"${BUILD_TIME}\";")
set(VERSION_HTML "${GIT_BRANCH}, ${GIT_REV}${GIT_DIFF}, ${GIT_TAG}")
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp)
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp VERSION_)
@@ -48,6 +49,7 @@ endif()
if (NOT "${VERSION}" STREQUAL "${VERSION_}")
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/version.cpp "${VERSION}")
file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/../sd-card/html/version.txt "${VERSION_HTML}")
endif()
#######################################################################
#######################################################################

View File

@@ -38,7 +38,7 @@ const char* libfive_git_branch(void)
}
char _char_getHTMLversion[20]="NaN\0";
char _char_getHTMLversion[50]="NaN\0";
const char* getHTMLversion(void){
FILE* pFile;
@@ -48,7 +48,7 @@ const char* getHTMLversion(void){
if (pFile == NULL)
return _char_getHTMLversion;
fgets(_char_getHTMLversion, 20, pFile);
fgets(_char_getHTMLversion, sizeof(_char_getHTMLversion), pFile);
fclose(pFile);
return _char_getHTMLversion;

View File

@@ -12,7 +12,7 @@ h3 {font-size: 1.2em;}
p {font-size: 1em;}
div {
width: 250px;
width: 350px;
padding: 10px 5px;
border: 1px solid #ccc;
font-family: arial;

View File

@@ -1 +1,2 @@
16.4.1
# HTML version
# Do not edit, it will get be updated by cmake!