Skip to content

Commit

Permalink
Eliminate redundancy between OpenEXRConfig and OpenEXRVersion.h
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Porcino <meshula@hotmail.com>
  • Loading branch information
meshula committed Apr 23, 2023
1 parent b734e2f commit a301c9f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ endif()
# configuration files
#######################################

file(READ "src/lib/OpenEXR/OpenEXRVersion.h" VERSION_H)
file(READ "src/lib/OpenEXRCore/OpenEXRVersion.h" VERSION_H)
string(REGEX MATCH "VERSION_MAJOR ([0-9]*)" _ ${VERSION_H})
set(VER_MAJ ${CMAKE_MATCH_1})
string(REGEX MATCH "VERSION_MINOR ([0-9]*)" _ ${VERSION_H})
Expand Down
2 changes: 2 additions & 0 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ endif()

configure_file(OpenEXRConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/OpenEXRConfig.h)
configure_file(OpenEXRConfigInternal.h.in ${CMAKE_CURRENT_BINARY_DIR}/OpenEXRConfigInternal.h)
configure_file(../src/lib/OpenEXRCore/OpenEXRVersion.h ${CMAKE_CURRENT_BINARY_DIR}/OpenEXRVersion.h COPYONLY)

if(OPENEXR_INSTALL)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/OpenEXRConfig.h
${CMAKE_CURRENT_BINARY_DIR}/OpenEXRVersion.h
DESTINATION
${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}
)
Expand Down
5 changes: 2 additions & 3 deletions cmake/OpenEXRConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#pragma once

#include <OpenEXRVersion.h>

//
// Options / configuration based on O.S. / compiler
/////////////////////
Expand Down Expand Up @@ -45,9 +47,6 @@
#define OPENEXR_VERSION_STRING "@OPENEXR_VERSION@"
#define OPENEXR_PACKAGE_STRING "@OPENEXR_PACKAGE_NAME@"

#define OPENEXR_VERSION_MAJOR @OpenEXR_VERSION_MAJOR@
#define OPENEXR_VERSION_MINOR @OpenEXR_VERSION_MINOR@
#define OPENEXR_VERSION_PATCH @OpenEXR_VERSION_PATCH@
#define OPENEXR_VERSION_RELEASE_TYPE "@OPENEXR_VERSION_RELEASE_TYPE@"
// Deprecated, for back compatibility:
#define OPENEXR_VERSION_EXTRA "@OPENEXR_VERSION_RELEASE_TYPE@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
//
// This is the OpenEXR library version information.
// ImfVersion.h contains version information about the file format.
#pragma once

#define VERSION_MAJOR 3
#define VERSION_MINOR 2
#define VERSION_PATCH 0
#define OPENEXR_VERSION_MAJOR 3
#define OPENEXR_VERSION_MINOR 2
#define OPENEXR_VERSION_PATCH 0

0 comments on commit a301c9f

Please sign in to comment.