Skip to content

Commit f48d19b

Browse files
mattyjamscary-ilm
authored andcommitted
exrcheck: update CMakeLists.txt to install the tool (AcademySoftwareFoundation#1983)
* add an OPENEXR_INSTALL_DEVELOPER_TOOLS option This new option will control whether or not the tools considered to be "developer" tools should be installed. These are tools useful for developing and debugging OpenEXR itself that might not be suitable for distribution to end users. exrcheck is currently the only tool considered to be a developer tool. Signed-off-by: Matt Johnson <matt.johnson@epicgames.com> * exrcheck: update CMakeLists.txt to enable developer tool installation This makes the CMakeLists.txt for exrcheck look like other tools like exrinfo and uncomments the CMake call to install the tool. One difference though is that exrcheck is considered a developer tool, and as such is only installed when the OPENEXR_INSTALL_DEVELOPER_TOOLS option is enabled. Signed-off-by: Matt Johnson <matt.johnson@epicgames.com> --------- Signed-off-by: Matt Johnson <matt.johnson@epicgames.com>
1 parent ae7c4d3 commit f48d19b

File tree

6 files changed

+27
-3
lines changed

6 files changed

+27
-3
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ set(OPENEXR_LIB_VERSION "${OPENEXR_LIB_SOVERSION}.${OPENEXR_VERSION}") # e.g. "3
4848

4949
option(OPENEXR_INSTALL "Install OpenEXR libraries" ON)
5050
option(OPENEXR_INSTALL_TOOLS "Install OpenEXR tools" ON)
51+
option(OPENEXR_INSTALL_DEVELOPER_TOOLS "Install OpenEXR developer tools" OFF)
5152

52-
if(OPENEXR_INSTALL OR OPENEXR_INSTALL_TOOLS)
53+
if(OPENEXR_INSTALL OR OPENEXR_INSTALL_TOOLS OR OPENEXR_INSTALL_DEVELOPER_TOOLS)
5354
# uninstall target
5455
if(NOT TARGET uninstall)
5556
configure_file(

cmake/OpenEXRSetup.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ option(OPENEXR_BUILD_LIBS "Enables building of main libraries" ON)
6969
# Whether to build the various command line utility programs
7070
option(OPENEXR_BUILD_TOOLS "Enables building of utility programs" ON)
7171
option(OPENEXR_INSTALL_TOOLS "Install OpenEXR tools" ON)
72+
option(OPENEXR_INSTALL_DEVELOPER_TOOLS "Install OpenEXR developer tools" OFF)
7273

7374
option(OPENEXR_BUILD_EXAMPLES "Build and install OpenEXR examples" ON)
7475

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ OPENEXR_BUILD_PYTHON = 'ON'
6464
OPENEXR_BUILD_EXAMPLES = 'OFF'
6565
OPENEXR_BUILD_TOOLS = 'OFF'
6666
OPENEXR_INSTALL_TOOLS = 'OFF'
67+
OPENEXR_INSTALL_DEVELOPER_TOOLS = 'OFF'
6768
OPENEXR_INSTALL_PKG_CONFIG = 'OFF'
6869
OPENEXR_FORCE_INTERNAL_DEFLATE = 'ON'
6970
OPENEXR_FORCE_INTERNAL_IMATH = 'ON'

src/bin/exrcheck/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ target_link_libraries(exrcheck OpenEXR::OpenEXR OpenEXR::OpenEXRUtil)
66
set_target_properties(exrcheck PROPERTIES
77
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
88
)
9-
# install(TARGETS exrcheck DESTINATION ${CMAKE_INSTALL_BINDIR})
10-
if(WIN32 AND BUILD_SHARED_LIBS)
9+
10+
# exrcheck is considered a "developer" tool, so only install it
11+
# when installation of developer tools is enabled.
12+
if(OPENEXR_INSTALL_DEVELOPER_TOOLS)
13+
install(TARGETS exrcheck DESTINATION ${CMAKE_INSTALL_BINDIR})
14+
endif()
15+
if(WIN32 AND (BUILD_SHARED_LIBS OR OPENEXR_BUILD_BOTH_STATIC_SHARED))
1116
target_compile_definitions(exrcheck PRIVATE OPENEXR_DLL)
1217
endif()

website/install.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,12 @@ Component Options
478478
Install the binary programs (exrheader, exrinfo,
479479
exrmakepreview, etc). Default is ``ON``.
480480

481+
* ``OPENEXR_INSTALL_DEVELOPER_TOOLS``
482+
483+
Install the binary programs useful for developing
484+
and/or debugging OpenEXR itself (e.g. exrcheck).
485+
Default is ``OFF``.
486+
481487
* ``OPENEXR_BUILD_EXAMPLES``
482488

483489
Build the example code. Default is ``ON``.

website/tools.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ separately. To further include the tools in the OpenEXR installation
2323
after build (i.e. ``cmake --target install``), configure with
2424
``OPENEXR_INSTALL_TOOLS=ON``. Both are on by default.
2525

26+
In addition, some tools such as ``exrcheck`` are considered "developer"
27+
tools in that they are useful when developing and debugging OpenEXR
28+
itself. These tools may be helpful in identifying security issues,
29+
and as a result it is not recommended that they be used with untrusted
30+
input files. Although they will still be built and available in the
31+
build directory when the ``OPENEXR_BUILD_TOOLS=ON`` option is used,
32+
a separate ``OPENEXR_INSTALL_DEVELOPER_TOOLS=ON`` option should be
33+
enabled if installation of the developer tools is desired. That option
34+
is off by default.
35+
2636
.. toctree::
2737
:caption: Tools
2838
:titlesonly:

0 commit comments

Comments
 (0)