diff --git a/cmake/OpenEXRConfig.h.in b/cmake/OpenEXRConfig.h.in index fd59bad48b..20d94d451f 100644 --- a/cmake/OpenEXRConfig.h.in +++ b/cmake/OpenEXRConfig.h.in @@ -47,6 +47,8 @@ #define OPENEXR_VERSION_PATCH @OPENEXR_VERSION_PATCH@ #define OPENEXR_VERSION_EXTRA "@OPENEXR_VERSION_EXTRA@" +#define OPENEXR_LIB_VERSION_STRING "@OPENEXR_LIB_VERSION@" + // Version as a single hex number, e.g. 0x01000300 == 1.0.3 #define OPENEXR_VERSION_HEX ((uint32_t(OPENEXR_VERSION_MAJOR) << 24) | \ (uint32_t(OPENEXR_VERSION_MINOR) << 16) | \ diff --git a/src/bin/exrcheck/main.cpp b/src/bin/exrcheck/main.cpp index b13bfc993f..dd7985b29d 100644 --- a/src/bin/exrcheck/main.cpp +++ b/src/bin/exrcheck/main.cpp @@ -2,7 +2,7 @@ // Copyright (c) Contributors to the OpenEXR Project. #include - +#include #include #include @@ -30,6 +30,7 @@ usageMessage (const char argv0[]) cerr << " -m : avoid excessive memory allocation (some files will not be fully checked)\n"; cerr << " -t : avoid spending excessive time (some files will not be fully checked)\n"; cerr << " -s : use stream API instead of file API\n"; + cerr << " -v : print OpenEXR and Imath software libary version info\n"; } @@ -98,6 +99,17 @@ main(int argc, char **argv) { useStream = true; } + else if (!strcmp (argv[i],"-v")) + { + std::cout << OPENEXR_PACKAGE_STRING + << " Lib API: " << OPENEXR_LIB_VERSION_STRING + << ", " << IMATH_PACKAGE_STRING +#if defined(IMATH_LIB_VERSION_STRING) + << " Lib API: " << IMATH_LIB_VERSION_STRING +#endif + << std::endl; + exit(0); + } else {