Skip to content

Commit

Permalink
Clean up setting of OpenEXR version (AcademySoftwareFoundation#1008)
Browse files Browse the repository at this point in the history
* Set the version via the project() statement in top-level
  CMakeLists.txt, so all version-related settings are close together
  in an obvious place. Deprecate config/version.cmake and move logic
  to top level

* Set OPENEXR_VERSION_EXTRA to "dev" for the master branch

* Simplfy logic for SOVERSION.SOAGE.SOREVISION (no more SOCURRENT)

Signed-off-by: Cary Phillips <cary@ilm.com>
  • Loading branch information
cary-ilm committed May 12, 2021
1 parent 88cca48 commit 775c9e3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 29 deletions.
27 changes: 19 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,26 @@ endif()
# configuration files
#######################################

include(cmake/OpenEXRVersion.cmake)

project(OpenEXR VERSION ${OPENEXR_VERSION} LANGUAGES C CXX)

option(OPENEXR_INSTALL "Install OpenEXR libraries" ON)
option(OPENEXR_INSTALL_TOOLS "Install OpenEXR tools" ON)
if(OPENEXR_INSTALL_TOOLS AND NOT OPENEXR_INSTALL)
message(SEND_ERROR "OPENEXR_INSTALL_TOOLS requires OPENEXR_INSTALL")
project(OpenEXR VERSION 3.0.2 LANGUAGES C CXX)

set(OPENEXR_VERSION_EXTRA "dev" CACHE STRING "Extra version tag string for OpenEXR build")

# 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_SOAGE}.${OPENEXR_SOREVISION}")

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}")

include(cmake/LibraryDefine.cmake)
include(cmake/OpenEXRSetup.cmake)
Expand Down
21 changes: 0 additions & 21 deletions cmake/OpenEXRVersion.cmake

This file was deleted.

0 comments on commit 775c9e3

Please sign in to comment.