Skip to content

Commit

Permalink
cmake: allow to set API_VERSION from CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
fvennetier committed Jan 12, 2021
1 parent e20ee25 commit cfd476e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ include(CheckIncludeFile)
include(CheckLibraryExists)
include(CheckTypeSize)

# These variables cannot be set from CLI
set(GridInit_VERSION_MAJOR 2)
set(GridInit_VERSION_MINOR 2)
set(GridInit_RELEASE 0)
set(API_VERSION "${GridInit_VERSION_MAJOR}.${GridInit_VERSION_MINOR}.${GridInit_RELEASE}")
set(SHORT_API_VERSION "${GridInit_VERSION_MAJOR}.${GridInit_VERSION_MINOR}")
# This variable can be set from CLI: cmake -DAPI_VERSION=1.2.3 [...]
set(API_VERSION "${GridInit_VERSION_MAJOR}.${GridInit_VERSION_MINOR}.${GridInit_RELEASE}" CACHE STRING "Gridinit full version number")

add_definitions(-DAPI_VERSION="${API_VERSION}")
add_definitions(-DSHORT_API_VERSION="${SHORT_API_VERSION}")
Expand Down

0 comments on commit cfd476e

Please sign in to comment.