diff --git a/CMakeLists.txt b/CMakeLists.txt index 143743dd..afb1ea52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,10 +4,15 @@ message( STATUS "CMake Version: ${CMAKE_VERSION}" ) PROJECT(hyperion) -# Parse semantic version of version file +# Parse semantic version of version file and write version to config include (${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.cmake) file (STRINGS "version" HYPERION_VERSION) SetVersionNumber(HYPERION ${HYPERION_VERSION}) +set(DEFAULT_JSON_CONFIG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/config/hyperion.config.json.default) +file(READ ${DEFAULT_JSON_CONFIG_FILE} DEFAULT_JSON_CONFIG_VAR) +string(REPLACE "configVersionValue" ${HYPERION_VERSION} DEFAULT_JSON_CONFIG_VAR "${DEFAULT_JSON_CONFIG_VAR}") +string(REPLACE "previousVersionValue" ${HYPERION_VERSION} DEFAULT_JSON_CONFIG_VAR "${DEFAULT_JSON_CONFIG_VAR}") +file(WRITE ${DEFAULT_JSON_CONFIG_FILE} "${DEFAULT_JSON_CONFIG_VAR}") # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) diff --git a/config/hyperion.config.json.default b/config/hyperion.config.json.default index 90f92721..405c810d 100644 --- a/config/hyperion.config.json.default +++ b/config/hyperion.config.json.default @@ -2,8 +2,8 @@ "general" : { "name" : "My Hyperion Config", - "configVersion": "2.0.0-alpha.9", - "previousVersion": "2.0.0-alpha.9", + "configVersion": "configVersionValue", + "previousVersion": "previousVersionValue", "watchedVersionBranch" : "Stable", "showOptHelp" : true }, @@ -96,7 +96,7 @@ "framegrabber" : { "device" : "auto", - "input" : 0, + "input" : 0, "width" : 80, "height" : 45, "fps" : 10,