Skip to content

Commit

Permalink
All: Only update version info if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
endrift committed Sep 20, 2016
1 parent 1cb4bd7 commit c14c6d6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGES
@@ -1,3 +1,7 @@
0.6.0: (Future)
Misc:
- All: Only update version info if needed

0.5.0: (2016-09-19)
Features:
- Game Boy support
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -122,7 +122,7 @@ function(find_feature FEATURE_NAME FEATURE_REQUIRES)
endfunction()

# Version information
add_custom_target(version-info ALL ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_SOURCE_DIR}/src/core/version.c.in
add_custom_target(version-info ALL
COMMAND ${CMAKE_COMMAND}
-DBINARY_NAME=${BINARY_NAME}
-DCONFIG_FILE=${CMAKE_CURRENT_SOURCE_DIR}/src/core/version.c.in
Expand Down
8 changes: 6 additions & 2 deletions version.cmake
Expand Up @@ -43,6 +43,10 @@ if(NOT GIT_BRANCH)
set(GIT_BRANCH "(unknown)")
endif()

if(CONFIG_FILE AND OUT_FILE)
configure_file("${CONFIG_FILE}" "${OUT_FILE}")
if(NOT VERSION_STRING_CACHE OR NOT VERSION_STRING STREQUAL VERSION_STRING_CACHE)
set(VERSION_STRING_CACHE ${VERSION_STRING} CACHE STRING "" FORCE)

if(CONFIG_FILE AND OUT_FILE)
configure_file("${CONFIG_FILE}" "${OUT_FILE}")
endif()
endif()

0 comments on commit c14c6d6

Please sign in to comment.