Skip to content

Commit

Permalink
Merge pull request #434 from marvelous/master
Browse files Browse the repository at this point in the history
Parsing aseba version for NSIS
  • Loading branch information
stephanemagnenat committed Oct 20, 2015
2 parents ea13b75 + a7c6dee commit 8f234c4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ParseVersion.cmake
Expand Up @@ -75,6 +75,16 @@ if (GIT_FOUND AND HAS_GIT_REP)
endif(NOT ${git_rev_result} EQUAL 0)
# write a file with the GIT_REV define
file(WRITE ${CMAKE_BINARY_DIR}/version.h.txt "#define ASEBA_BUILD_VERSION \"git-${GIT_REV}\"\n")
# write NSIS version file (for Windows build)
execute_process(COMMAND grep -o [0-9]\\.[0-9]\\.[0-9] common/consts.h
OUTPUT_VARIABLE ASEBA_VERSION
RESULT_VARIABLE aseba_version_result
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT ${aseba_version_result} EQUAL 0)
set(ASEBA_VERSION "Unknown")
endif(NOT ${aseba_version_result} EQUAL 0)
file(WRITE ${CMAKE_BINARY_DIR}/version.nsi "!define VERSION \"${ASEBA_VERSION}-git-${GIT_REV}\"\n")
# copy the file to the final header only if the version changes
# reduces needless rebuilds
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different version.h.txt version.h)
Expand Down

0 comments on commit 8f234c4

Please sign in to comment.