Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix version in RB-3.2 branch #1524

Closed
cary-ilm opened this issue Aug 18, 2023 · 6 comments
Closed

Fix version in RB-3.2 branch #1524

cary-ilm opened this issue Aug 18, 2023 · 6 comments

Comments

@cary-ilm
Copy link
Member

cary-ilm commented Aug 18, 2023

The release version appears to be specified in two places, in OpenEXRConfig.h.in and in openexr_version.h, so as it stands, the version is correct in the current 3.2 release branch but for subsequent patch releases would need to updated in two locations, which is problematic. This needs to get sorted out prior to release.

Presumably, OpenEXRConfig.h.in should read the values fromopenexr_version.h (or the CMakeLists.txt should).

@meshula
Copy link
Contributor

meshula commented Aug 18, 2023

See the comment here ~ originally I had intended OpenEXRConfig.h to include openexr_version.h, but ran into a snarl: #1386 (comment)

Things have been further sorted out subsequently, should be possible to get it right now.

@Vertexwahn
Copy link
Contributor

Just for the records openexr/src/wrappers/python/setup.py also depends on the contents of openexr_version.h:

with open('src/lib/OpenEXRCore/openexr_version.h', 'r') as f:
    txt = f.read()
    for name in ('MAJOR', 'MINOR', 'PATCH'):
        version.append(re.search(
            f'VERSION_{name} ([0-9]*)', txt).group(0).split(' ')[-1])

@meshula
Copy link
Contributor

meshula commented Aug 20, 2023

A good supporting argument for openexr_version.h being the ground truth.

@kmilos
Copy link

kmilos commented Aug 21, 2023

read the values fromopenexr_version.h (or the CMakeLists.txt should)

If still needed, see e.g. libtiff again for CMake ideas that gives pretty much equivalent to the python above: https://gitlab.com/libtiff/libtiff/-/blob/69eef88fc0e446c35213471f7277ee86265e5871/CMakeLists.txt#L35-L46 and https://gitlab.com/libtiff/libtiff/-/blob/69eef88fc0e446c35213471f7277ee86265e5871/cmake/AutotoolsVersion.cmake

@meshula
Copy link
Contributor

meshula commented Aug 21, 2023

ah, I see it, thanks, we could emulate this.

FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/configure.ac" configure REGEX "^LIBTIFF_.*=")
foreach(line ${configure})
    foreach(var LIBTIFF_MAJOR_VERSION LIBTIFF_MINOR_VERSION LIBTIFF_MICRO_VERSION LIBTIFF_ALPHA_VERSION
            LIBTIFF_CURRENT LIBTIFF_REVISION LIBTIFF_AGE)
        if(NOT ${var} AND line MATCHES "^${var}=(.*)")
            set(${var} "${CMAKE_MATCH_1}")
            break()
        endif()
    endforeach()
endforeach()

@cary-ilm
Copy link
Member Author

This should be resolve by #1527.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants