From: Bernd Waibel <waebbl-gentoo@posteo.net>
Date: Tue, 3 Aug 2021 20:00:34 +0200
Subject: [PATCH 2/2] add version to binaries for slotting

Signed-off-by: Bernd Waibel <waebbl-gentoo@posteo.net>
---
 src/bin/exr2aces/CMakeLists.txt       | 10 +++++-----
 src/bin/exrenvmap/CMakeLists.txt      | 10 +++++-----
 src/bin/exrheader/CMakeLists.txt      | 10 +++++-----
 src/bin/exrinfo/CMakeLists.txt        | 10 +++++-----
 src/bin/exrmakepreview/CMakeLists.txt | 10 +++++-----
 src/bin/exrmaketiled/CMakeLists.txt   | 10 +++++-----
 src/bin/exrmultipart/CMakeLists.txt   | 10 +++++-----
 src/bin/exrmultiview/CMakeLists.txt   | 10 +++++-----
 src/bin/exrstdattr/CMakeLists.txt     | 10 +++++-----
 9 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/src/bin/exr2aces/CMakeLists.txt b/src/bin/exr2aces/CMakeLists.txt
index 72c4e1c..01b806f 100644
--- a/src/bin/exr2aces/CMakeLists.txt
+++ b/src/bin/exr2aces/CMakeLists.txt
@@ -1,14 +1,14 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) Contributors to the OpenEXR Project.
 
-add_executable(exr2aces main.cpp)
-target_link_libraries(exr2aces OpenEXR::OpenEXR)
-set_target_properties(exr2aces PROPERTIES
+add_executable(exr2aces-${OpenEXR_VERSION_MAJOR} main.cpp)
+target_link_libraries(exr2aces-${OpenEXR_VERSION_MAJOR} OpenEXR::OpenEXR)
+set_target_properties(exr2aces-${OpenEXR_VERSION_MAJOR} PROPERTIES
   RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
 )
 if(OPENEXR_INSTALL_TOOLS)
-  install(TARGETS exr2aces DESTINATION ${CMAKE_INSTALL_BINDIR})
+  install(TARGETS exr2aces-${OpenEXR_VERSION_MAJOR} DESTINATION ${CMAKE_INSTALL_BINDIR})
 endif()
 if(WIN32 AND BUILD_SHARED_LIBS)
-  target_compile_definitions(exr2aces PRIVATE OPENEXR_DLL)
+  target_compile_definitions(exr2aces-${OpenEXR_VERSION_MAJOR} PRIVATE OPENEXR_DLL)
 endif()
diff --git a/src/bin/exrenvmap/CMakeLists.txt b/src/bin/exrenvmap/CMakeLists.txt
index c798a65..3d35a19 100644
--- a/src/bin/exrenvmap/CMakeLists.txt
+++ b/src/bin/exrenvmap/CMakeLists.txt
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) Contributors to the OpenEXR Project.
 
-add_executable( exrenvmap
+add_executable( exrenvmap-${OpenEXR_VERSION_MAJOR}
   blurImage.cpp
   EnvmapImage.cpp
   main.cpp
@@ -11,13 +11,13 @@ add_executable( exrenvmap
   resizeImage.cpp
 )
 
-target_link_libraries(exrenvmap OpenEXR::OpenEXR)
-set_target_properties(exrenvmap PROPERTIES
+target_link_libraries(exrenvmap-${OpenEXR_VERSION_MAJOR} OpenEXR::OpenEXR)
+set_target_properties(exrenvmap-${OpenEXR_VERSION_MAJOR} PROPERTIES
   RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
 )
 if(OPENEXR_INSTALL_TOOLS)
-  install(TARGETS exrenvmap DESTINATION ${CMAKE_INSTALL_BINDIR})
+  install(TARGETS exrenvmap-${OpenEXR_VERSION_MAJOR} DESTINATION ${CMAKE_INSTALL_BINDIR})
 endif()
 if(WIN32 AND BUILD_SHARED_LIBS)
-  target_compile_definitions(exrenvmap PRIVATE OPENEXR_DLL)
+  target_compile_definitions(exrenvmap-${OpenEXR_VERSION_MAJOR} PRIVATE OPENEXR_DLL)
 endif()
diff --git a/src/bin/exrheader/CMakeLists.txt b/src/bin/exrheader/CMakeLists.txt
index c427445..8cdbb8e 100644
--- a/src/bin/exrheader/CMakeLists.txt
+++ b/src/bin/exrheader/CMakeLists.txt
@@ -1,14 +1,14 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) Contributors to the OpenEXR Project.
 
-add_executable(exrheader main.cpp)
-target_link_libraries(exrheader OpenEXR::OpenEXR)
-set_target_properties(exrheader PROPERTIES
+add_executable(exrheader-${OpenEXR_VERSION_MAJOR} main.cpp)
+target_link_libraries(exrheader-${OpenEXR_VERSION_MAJOR} OpenEXR::OpenEXR)
+set_target_properties(exrheader-${OpenEXR_VERSION_MAJOR} PROPERTIES
   RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
 )
 if(OPENEXR_INSTALL_TOOLS)
-  install(TARGETS exrheader DESTINATION ${CMAKE_INSTALL_BINDIR})
+  install(TARGETS exrheader-${OpenEXR_VERSION_MAJOR} DESTINATION ${CMAKE_INSTALL_BINDIR})
 endif()
 if(WIN32 AND BUILD_SHARED_LIBS)
-  target_compile_definitions(exrheader PRIVATE OPENEXR_DLL)
+  target_compile_definitions(exrheader-${OpenEXR_VERSION_MAJOR} PRIVATE OPENEXR_DLL)
 endif()
diff --git a/src/bin/exrinfo/CMakeLists.txt b/src/bin/exrinfo/CMakeLists.txt
index 19ace5f..07aee1a 100644
--- a/src/bin/exrinfo/CMakeLists.txt
+++ b/src/bin/exrinfo/CMakeLists.txt
@@ -1,12 +1,12 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright Contributors to the OpenEXR Project.
 
-add_executable(exrinfo main.c)
-target_link_libraries(exrinfo OpenEXR::OpenEXRCore)
-set_target_properties(exrinfo PROPERTIES
+add_executable(exrinfo-${OpenEXR_VERSION_MAJOR} main.c)
+target_link_libraries(exrinfo-${OpenEXR_VERSION_MAJOR} OpenEXR::OpenEXRCore)
+set_target_properties(exrinfo-${OpenEXR_VERSION_MAJOR} PROPERTIES
   RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
 )
-install(TARGETS exrinfo DESTINATION ${CMAKE_INSTALL_BINDIR})
+install(TARGETS exrinfo-${OpenEXR_VERSION_MAJOR} DESTINATION ${CMAKE_INSTALL_BINDIR})
 if(WIN32 AND (BUILD_SHARED_LIBS OR OPENEXR_BUILD_BOTH_STATIC_SHARED))
-  target_compile_definitions(exrinfo PRIVATE OPENEXR_DLL)
+  target_compile_definitions(exrinfo-${OpenEXR_VERSION_MAJOR} PRIVATE OPENEXR_DLL)
 endif()
diff --git a/src/bin/exrmakepreview/CMakeLists.txt b/src/bin/exrmakepreview/CMakeLists.txt
index bb8b548..8b5e441 100644
--- a/src/bin/exrmakepreview/CMakeLists.txt
+++ b/src/bin/exrmakepreview/CMakeLists.txt
@@ -1,17 +1,17 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) Contributors to the OpenEXR Project.
 
-add_executable(exrmakepreview
+add_executable(exrmakepreview-${OpenEXR_VERSION_MAJOR}
   main.cpp
   makePreview.cpp
 )
-target_link_libraries(exrmakepreview OpenEXR::OpenEXR)
-set_target_properties(exrmakepreview PROPERTIES
+target_link_libraries(exrmakepreview-${OpenEXR_VERSION_MAJOR} OpenEXR::OpenEXR)
+set_target_properties(exrmakepreview-${OpenEXR_VERSION_MAJOR} PROPERTIES
   RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
 )
 if(OPENEXR_INSTALL_TOOLS)
-  install(TARGETS exrmakepreview DESTINATION ${CMAKE_INSTALL_BINDIR})
+  install(TARGETS exrmakepreview-${OpenEXR_VERSION_MAJOR} DESTINATION ${CMAKE_INSTALL_BINDIR})
 endif()
 if(WIN32 AND BUILD_SHARED_LIBS)
-  target_compile_definitions(exrmakepreview PRIVATE OPENEXR_DLL)
+  target_compile_definitions(exrmakepreview-${OpenEXR_VERSION_MAJOR} PRIVATE OPENEXR_DLL)
 endif()
diff --git a/src/bin/exrmaketiled/CMakeLists.txt b/src/bin/exrmaketiled/CMakeLists.txt
index 1bc6cf4..6e70cf6 100644
--- a/src/bin/exrmaketiled/CMakeLists.txt
+++ b/src/bin/exrmaketiled/CMakeLists.txt
@@ -1,18 +1,18 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) Contributors (c) to the OpenEXR Project.
 
-add_executable(exrmaketiled 
+add_executable(exrmaketiled-${OpenEXR_VERSION_MAJOR}
   Image.cpp
   main.cpp
   makeTiled.cpp
 )
-target_link_libraries(exrmaketiled OpenEXR::OpenEXR)
-set_target_properties(exrmaketiled PROPERTIES
+target_link_libraries(exrmaketiled-${OpenEXR_VERSION_MAJOR} OpenEXR::OpenEXR)
+set_target_properties(exrmaketiled-${OpenEXR_VERSION_MAJOR} PROPERTIES
   RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
 )
 if(OPENEXR_INSTALL_TOOLS)
-  install(TARGETS exrmaketiled DESTINATION ${CMAKE_INSTALL_BINDIR})
+  install(TARGETS exrmaketiled-${OpenEXR_VERSION_MAJOR} DESTINATION ${CMAKE_INSTALL_BINDIR})
 endif()
 if(WIN32 AND BUILD_SHARED_LIBS)
-  target_compile_definitions(exrmaketiled PRIVATE OPENEXR_DLL)
+  target_compile_definitions(exrmaketiled-${OpenEXR_VERSION_MAJOR} PRIVATE OPENEXR_DLL)
 endif()
diff --git a/src/bin/exrmultipart/CMakeLists.txt b/src/bin/exrmultipart/CMakeLists.txt
index 7f8fc1b..3770506 100644
--- a/src/bin/exrmultipart/CMakeLists.txt
+++ b/src/bin/exrmultipart/CMakeLists.txt
@@ -1,14 +1,14 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) Contributors to the OpenEXR Project.
 
-add_executable(exrmultipart exrmultipart.cpp)
-target_link_libraries(exrmultipart OpenEXR::OpenEXR)
-set_target_properties(exrmultipart PROPERTIES
+add_executable(exrmultipart-${OpenEXR_VERSION_MAJOR} exrmultipart.cpp)
+target_link_libraries(exrmultipart-${OpenEXR_VERSION_MAJOR} OpenEXR::OpenEXR)
+set_target_properties(exrmultipart-${OpenEXR_VERSION_MAJOR} PROPERTIES
   RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
 )
 if(OPENEXR_INSTALL_TOOLS)
-  install(TARGETS exrmultipart DESTINATION ${CMAKE_INSTALL_BINDIR})
+  install(TARGETS exrmultipart-${OpenEXR_VERSION_MAJOR} DESTINATION ${CMAKE_INSTALL_BINDIR})
 endif()
 if(WIN32 AND BUILD_SHARED_LIBS)
-  target_compile_definitions(exrmultipart PRIVATE OPENEXR_DLL)
+  target_compile_definitions(exrmultipart-${OpenEXR_VERSION_MAJOR} PRIVATE OPENEXR_DLL)
 endif()
diff --git a/src/bin/exrmultiview/CMakeLists.txt b/src/bin/exrmultiview/CMakeLists.txt
index 05ad081..9e535ad 100644
--- a/src/bin/exrmultiview/CMakeLists.txt
+++ b/src/bin/exrmultiview/CMakeLists.txt
@@ -1,18 +1,18 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) Contributors to the OpenEXR Project.
 
-add_executable(exrmultiview
+add_executable(exrmultiview-${OpenEXR_VERSION_MAJOR}
   Image.cpp
   main.cpp
   makeMultiView.cpp
 )
-target_link_libraries(exrmultiview OpenEXR::OpenEXR)
-set_target_properties(exrmultiview PROPERTIES
+target_link_libraries(exrmultiview-${OpenEXR_VERSION_MAJOR} OpenEXR::OpenEXR)
+set_target_properties(exrmultiview-${OpenEXR_VERSION_MAJOR} PROPERTIES
   RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
 )
 if(OPENEXR_INSTALL_TOOLS)
-  install(TARGETS exrmultiview DESTINATION ${CMAKE_INSTALL_BINDIR})
+  install(TARGETS exrmultiview-${OpenEXR_VERSION_MAJOR} DESTINATION ${CMAKE_INSTALL_BINDIR})
 endif()
 if(WIN32 AND BUILD_SHARED_LIBS)
-  target_compile_definitions(exrmultiview PRIVATE OPENEXR_DLL)
+  target_compile_definitions(exrmultiview-${OpenEXR_VERSION_MAJOR} PRIVATE OPENEXR_DLL)
 endif()
diff --git a/src/bin/exrstdattr/CMakeLists.txt b/src/bin/exrstdattr/CMakeLists.txt
index 79205fc..3ad0ffe 100644
--- a/src/bin/exrstdattr/CMakeLists.txt
+++ b/src/bin/exrstdattr/CMakeLists.txt
@@ -1,14 +1,14 @@
 # SPDX-License-Identifier: BSD-3-Clause
 # Copyright (c) Contributors to the OpenEXR Project.
 
-add_executable(exrstdattr main.cpp)
-target_link_libraries(exrstdattr OpenEXR::OpenEXR)
-set_target_properties(exrstdattr PROPERTIES
+add_executable(exrstdattr-${OpenEXR_VERSION_MAJOR} main.cpp)
+target_link_libraries(exrstdattr-${OpenEXR_VERSION_MAJOR} OpenEXR::OpenEXR)
+set_target_properties(exrstdattr-${OpenEXR_VERSION_MAJOR} PROPERTIES
   RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
 )
 if(OPENEXR_INSTALL_TOOLS)
-  install(TARGETS exrstdattr DESTINATION ${CMAKE_INSTALL_BINDIR})
+  install(TARGETS exrstdattr-${OpenEXR_VERSION_MAJOR} DESTINATION ${CMAKE_INSTALL_BINDIR})
 endif()
 if(WIN32 AND BUILD_SHARED_LIBS)
-  target_compile_definitions(exrstdattr PRIVATE OPENEXR_DLL)
+  target_compile_definitions(exrstdattr-${OpenEXR_VERSION_MAJOR} PRIVATE OPENEXR_DLL)
 endif()
-- 
2.32.0

