Skip to content

Commit

Permalink
build: simplify version handling
Browse files Browse the repository at this point in the history
The SOVERSION was the same as the VERSION parameter, just use the same
parameter.
  • Loading branch information
compnerd committed Jan 5, 2024
1 parent 3b3b6e8 commit b3a7754
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
9 changes: 3 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@ if(POLICY CMP0092)
endif()

project(cmark-gfm)

set(PROJECT_VERSION_MAJOR 0)
set(PROJECT_VERSION_MINOR 29)
set(PROJECT_VERSION_PATCH 0)
set(PROJECT_VERSION_GFM 13)
set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.gfm.${PROJECT_VERSION_GFM})
# NOTE: we cannot simply version the project due to the use of an invalid
# version (the infixed `.gfm.`).
set(PROJECT_VERSION 0.29.0.gfm.13)

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules)

Expand Down
2 changes: 1 addition & 1 deletion extensions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set_target_properties(libcmark-gfm-extensions PROPERTIES
MACOSX_RPATH TRUE
OUTPUT_NAME cmark-gfm-extensions
PDB_NAME libcmark-gfm-extensions
SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.gfm.${PROJECT_VERSION_GFM}
SOVERSION ${PROJECT_VERSION}
VERSION ${PROJECT_VERSION})

list(APPEND CMARK_INSTALL libcmark-gfm-extensions)
Expand Down
6 changes: 5 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ include_directories(
${PROJECT_BINARY_DIR}/extensions
)

set(PROJECT_VERSION_MAJOR 0)
set(PROJECT_VERSION_MINOR 29)
set(PROJECT_VERSION_PATCH 0)
set(PROJECT_VERSION_GFM 13)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmark-gfm_version.h.in
${CMAKE_CURRENT_BINARY_DIR}/cmark-gfm_version.h)

Expand Down Expand Up @@ -56,7 +60,7 @@ set_target_properties(libcmark-gfm PROPERTIES
MACOSX_RPATH TRUE
OUTPUT_NAME cmark-gfm
PDB_NAME libcmark-gfm
SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.gfm.${PROJECT_VERSION_GFM}
SOVERSION ${PROJECT_VERSION}
VERSION ${PROJECT_VERSION})

list(APPEND CMARK_INSTALL libcmark-gfm)
Expand Down

0 comments on commit b3a7754

Please sign in to comment.