Move version number to separate file so CMake doesn't reconfigure when it changes

This commit is contained in:
sentientstardust
2026-05-12 03:00:59 +01:00
parent fdbbf5f135
commit d7c66ac575
12 changed files with 61 additions and 17 deletions

View File

@ -0,0 +1,25 @@
if(NOT DEFINED INPUT)
message(FATAL_ERROR "INPUT is required")
endif()
if(NOT DEFINED OUTPUT)
message(FATAL_ERROR "OUTPUT is required")
endif()
file(STRINGS "${INPUT}" SOFTFEVER_VERSION LIMIT_COUNT 1)
string(STRIP "${SOFTFEVER_VERSION}" SOFTFEVER_VERSION)
set(CONTENT [=[
#include "libslic3r_version.h"
namespace Slic3r {
const char* softfever_version()
{
return "@SOFTFEVER_VERSION@";
}
} // namespace Slic3r
]=])
string(CONFIGURE "${CONTENT}" CONTENT @ONLY)
file(WRITE "${OUTPUT}" "${CONTENT}")