From 98f9a36074da24d9548d1bac3bb633e9142eb39d Mon Sep 17 00:00:00 2001 From: Cary Phillips Date: Sat, 22 May 2021 11:52:33 -0700 Subject: [PATCH] Set OPENEXR_VERSION from OpenEXR_VERSION variables (#1025) * OPENEXR_VERSION_RELEASE_TYPE replaces OPENEXR_VERSION_EXTRA * OPENEXR_VERSION_RELEASE_TYPE is used only to form OPENEXR_PACKAGE_NAME Signed-off-by: Cary Phillips --- CMakeLists.txt | 18 ++++++------------ cmake/OpenEXRSetup.cmake | 2 +- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4225a7df7c..da8ddb6b9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,10 @@ endif() project(OpenEXR VERSION 3.0.3 LANGUAGES C CXX) -set(OPENEXR_VERSION_EXTRA "" CACHE STRING "Extra version tag string for OpenEXR build") +set(OPENEXR_VERSION_RELEASE_TYPE "-dev" CACHE STRING "Extra version tag string for OpenEXR build, such as -dev, -beta1, etc.") + +set(OPENEXR_VERSION ${OpenEXR_VERSION}) +set(OPENEXR_VERSION_API "${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}") # See https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html set(OPENEXR_SOVERSION 28) @@ -29,17 +32,6 @@ set(OPENEXR_SOAGE 0) set(OPENEXR_SOREVISION 0) set(OPENEXR_LIB_VERSION "${OPENEXR_SOVERSION}.${OPENEXR_SOREVISION}.${OPENEXR_SOAGE}") -set(OPENEXR_VERSION_MAJOR ${CMAKE_PROJECT_VERSION_MAJOR}) -set(OPENEXR_VERSION_MINOR ${CMAKE_PROJECT_VERSION_MINOR}) -set(OPENEXR_VERSION_PATCH ${CMAKE_PROJECT_VERSION_PATCH}) -set(OPENEXR_VERSION ${CMAKE_PROJECT_VERSION}) -if (NOT OPENEXR_VERSION_EXTRA STREQUAL "") - set(OPENEXR_VERSION "${CMAKE_PROJECT_VERSION}-${OPENEXR_VERSION_EXTRA}") -endif() -set(OPENEXR_VERSION_API "${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR}") - -message(STATUS "Configure OpenEXR Version: ${OPENEXR_VERSION} Lib API: ${OPENEXR_LIB_VERSION}") - option(OPENEXR_INSTALL "Install OpenEXR libraries" ON) option(OPENEXR_INSTALL_TOOLS "Install OpenEXR tools" ON) if(OPENEXR_INSTALL_TOOLS AND NOT OPENEXR_INSTALL) @@ -50,6 +42,8 @@ include(cmake/LibraryDefine.cmake) include(cmake/OpenEXRSetup.cmake) add_subdirectory(cmake) +message(STATUS "Configure ${OPENEXR_PACKAGE_NAME}, library API version: ${OPENEXR_LIB_VERSION}") + # Hint: This can be set to enable custom find_package # search paths, probably best to set it when configuring # on the command line to cmake instead of setting it diff --git a/cmake/OpenEXRSetup.cmake b/cmake/OpenEXRSetup.cmake index e0b6db9a88..a6d48c797b 100644 --- a/cmake/OpenEXRSetup.cmake +++ b/cmake/OpenEXRSetup.cmake @@ -23,7 +23,7 @@ set(tmp) set(OPENEXR_NAMESPACE_CUSTOM "0" CACHE STRING "Whether the namespace has been customized (so external users know)") set(OPENEXR_INTERNAL_IMF_NAMESPACE "Imf_${OPENEXR_VERSION_API}" CACHE STRING "Real namespace for Imath that will end up in compiled symbols") set(OPENEXR_IMF_NAMESPACE "Imf" CACHE STRING "Public namespace alias for OpenEXR") -set(OPENEXR_PACKAGE_NAME "OpenEXR ${OPENEXR_VERSION}" CACHE STRING "Public string / label for displaying package") +set(OPENEXR_PACKAGE_NAME "OpenEXR ${OPENEXR_VERSION}${OPENEXR_VERSION_RELEASE_TYPE}" CACHE STRING "Public string / label for displaying package") # Namespace-related settings, allows one to customize the # namespace generated, and to version the namespaces