From 76bd881a535fa2969dfebbe96a62115e41ed223e Mon Sep 17 00:00:00 2001 From: Mathias Preiner Date: Thu, 6 Sep 2018 09:18:07 -0700 Subject: [PATCH] cmake: Add library versioning for libcvc4.so. --- CMakeLists.txt | 6 +++++- src/CMakeLists.txt | 7 +++++++ src/parser/CMakeLists.txt | 7 +++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 264daa615..f46d3ce30 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ project(cvc4) # Major component of the version of CVC4. set(CVC4_MAJOR 1) # Minor component of the version of CVC4. -set(CVC4_MINOR 6) +set(CVC4_MINOR 7) # Release component of the version of CVC4. set(CVC4_RELEASE 0) # Extraversion component of the version of CVC4. @@ -23,6 +23,10 @@ endif() # Define to the full name of this package. set(PACKAGE_NAME "${PROJECT_NAME}") +# Shared library versioning. Increment SOVERSION for every new CVC4 release. +set(CVC4_VERSION "${CVC4_MAJOR}.${CVC4_MINOR}.${CVC4_RELEASE}") +set(CVC4_SOVERSION 5) + #### These defines are only use in autotools make files, will likely be #### replaced with corresponding CPack stuff ## Define to the full name and version of this package. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8e8e0bd45..2e818bad5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -605,6 +605,13 @@ set(cvc4_gen_src_files set_source_files_properties(${cvc4_gen_src_files} PROPERTIES GENERATED TRUE) add_library(cvc4 ${cvc4_src_files} ${cvc4_gen_src_files}) + +set_target_properties(cvc4 + PROPERTIES + VERSION ${CVC4_VERSION} + SOVERSION ${CVC4_SOVERSION} +) + target_compile_definitions(cvc4 PRIVATE -D__BUILDING_CVC4LIB diff --git a/src/parser/CMakeLists.txt b/src/parser/CMakeLists.txt index ce4b354f3..6a7f77ea3 100644 --- a/src/parser/CMakeLists.txt +++ b/src/parser/CMakeLists.txt @@ -24,6 +24,13 @@ set(cvc4parser_src_files ) add_library(cvc4parser ${cvc4parser_src_files}) + +set_target_properties(cvc4parser + PROPERTIES + VERSION ${CVC4_VERSION} + SOVERSION ${CVC4_SOVERSION} +) + target_compile_definitions(cvc4parser PRIVATE -D__BUILDING_CVC4PARSERLIB) target_link_libraries(cvc4parser parsercvc parsersmt1 parsersmt2 parsertptp cvc4) target_link_libraries(cvc4parser ${ANTLR_LIBRARIES}) -- 2.30.2