Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Commit

Permalink
Cmake/SetVersion: do not unnecessarily pur variables in cache
Browse files Browse the repository at this point in the history
Setting a cache variable and then setting a non-cache variable with the same
name does not modify the cache variable.

There is no advantage here in using cache variables, to let's use regular
variables.

Signed-off-by: David Wagner <[email protected]>
  • Loading branch information
dawagner committed Feb 4, 2016
1 parent 8ca3cad commit 507e080
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions SetVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Fallback values:
set(PF_VERSION_MAJOR 0 CACHE INTERNAL "Parameter Framework's version major number")
set(PF_VERSION_MINOR 0 CACHE INTERNAL "Parameter Framework's version minor number")
set(PF_VERSION_PATCH 0 CACHE INTERNAL "Parameter Framework's version patch number")
set(PF_VERSION_TWEAK 0 CACHE INTERNAL "Parameter Framework's version tweak (or build) number")
set(PF_VERSION_SHA1 "g0000000000" CACHE INTERNAL "Parameter Framework's sources git SHA1")
set(PF_VERSION_DIRTY "" CACHE INTERNAL "Parameter Framework's sources dirty marker")
set(PF_VERSION_MAJOR 0)
set(PF_VERSION_MINOR 0)
set(PF_VERSION_PATCH 0)
set(PF_VERSION_TWEAK 0)
set(PF_VERSION_SHA1 "g0000000000")
set(PF_VERSION_DIRTY "")

# Find and set the Parameter Framework's version
# First, let's see if the user forced a version (i.e. "vX.Y.Z-N")
Expand Down Expand Up @@ -69,7 +69,7 @@ if(PF_VERSION MATCHES ${REGEX})
endif()

# If we are precisely on a tag, make a nicer version string
set(NICE_PF_VERSION "${PF_VERSION}" CACHE INTERNAL "")
set(NICE_PF_VERSION "${PF_VERSION}")
if((PF_VERSION_TWEAK EQUAL 0) AND (NOT PF_VERSION_DIRTY))
set(NICE_PF_VERSION "v${PF_VERSION_MAJOR}.${PF_VERSION_MINOR}.${PF_VERSION_PATCH}")
endif()

0 comments on commit 507e080

Please sign in to comment.