Skip to content

Commit

Permalink
Set OPENEXR_VERSION from OpenEXR_VERSION variables (AcademySoftwareFo…
Browse files Browse the repository at this point in the history
…undation#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 <[email protected]>
  • Loading branch information
cary-ilm committed May 29, 2021
1 parent c975652 commit 98f9a36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
18 changes: 6 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,17 @@ 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)
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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmake/OpenEXRSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 98f9a36

Please sign in to comment.