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

exrcheck -v prints OpenEXR and Imath versions and lib versions #992

Merged
merged 2 commits into from
Mar 30, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmake/OpenEXRConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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) | \
Expand Down
14 changes: 13 additions & 1 deletion src/bin/exrcheck/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright (c) Contributors to the OpenEXR Project.

#include <ImfCheckFile.h>

#include <ImathConfig.h>

#include <iostream>
#include <fstream>
Expand Down Expand Up @@ -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 version info\n";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better if this said 'OpenEXR and IMath version info' so it's clear it isn't outputting the version of the provided file, as exrheader does?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, done.


}

Expand Down Expand Up @@ -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
{

Expand Down