Skip to content

Commit

Permalink
Use CMake project command to set version
Browse files Browse the repository at this point in the history
Setting in the version in the `project()` call automatically populates
the variables `PROJECT_VERSION_MAJOR`, `_MINOR`, `_PATCH` and `_TWEAK`
(if used).

If a `SHARED` version of `ckteec` is built, `PROJECT_VERSION_MAJOR` can
be used for the `SOVERSION`.

Signed-off-by: Eero Aaltonen <eero.aaltonen@vaisala.com>
Acked-by: Jerome Forissier <jerome@forissier.org>
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
  • Loading branch information
eaaltonen authored and jforissier committed Aug 22, 2022
1 parent 492410d commit 1dcb80a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
12 changes: 4 additions & 8 deletions libckteec/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
project(ckteec C)

set(MAJOR_VERSION 0)
set(MINOR_VERSION 1)
set(PATCH_VERSION 0)

set(PROJECT_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
project(ckteec
VERSION 0.1.0
LANGUAGES C)

################################################################################
# Packages
Expand Down Expand Up @@ -37,7 +33,7 @@ add_library (ckteec ${SRC})

set_target_properties (ckteec PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${MAJOR_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
)

################################################################################
Expand Down
12 changes: 4 additions & 8 deletions libseteec/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
project(seteec C)

set(MAJOR_VERSION 0)
set(MINOR_VERSION 1)
set(PATCH_VERSION 0)

set(PROJECT_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")
project(seteec
VERSION 0.1.0
LANGUAGES C)

################################################################################
# Packages
Expand All @@ -30,7 +26,7 @@ add_library (seteec ${SRC})

set_target_properties (seteec PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${MAJOR_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
)

################################################################################
Expand Down
8 changes: 4 additions & 4 deletions libteec/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project(libteec C)

set(PROJECT_VERSION "1.0.0")
project(libteec
VERSION 1.0.0
LANGUAGES C)

################################################################################
# Packages
Expand Down Expand Up @@ -37,7 +37,7 @@ add_library (teec ${SRC})

set_target_properties (teec PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION 1
SOVERSION ${PROJECT_VERSION_MAJOR}
)

################################################################################
Expand Down

0 comments on commit 1dcb80a

Please sign in to comment.