From 5240892748b58cd4c0dbd06783e2fc6e996bcea7 Mon Sep 17 00:00:00 2001 From: Cary Phillips Date: Wed, 30 Aug 2023 08:31:56 -0700 Subject: [PATCH] Propagate OPENEXR_INSTALL_PKG_CONFIG to internal Imath (#1531) * Propagate OPENEXR_INSTALL_PKG_CONFIG to internal Imath If OpenEXR is installing a pkg-config file, then the internal Imath build (if there is one) should install it, too. Also, add an explicit release version variable to the .pc file. This is in preparation for the python wheel build to pick up the version settings from the pkg-config files. Signed-off-by: Cary Phillips * remove version= from OpenEXR.pc Signed-off-by: Cary Phillips --------- Signed-off-by: Cary Phillips --- cmake/CMakeLists.txt | 3 ++- cmake/OpenEXRSetup.cmake | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 6ebf5f5ab9..3a4dbf991e 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -219,8 +219,9 @@ if(OPENEXR_INSTALL_PKG_CONFIG) ) endfunction() openexr_pkg_config_help(OpenEXR.pc.in) + message(STATUS "OpenEXR pkg-config generation enabled") else() - message(STATUS "-- pkg-config generation disabled") + message(STATUS "OpenEXR pkg-config generation disabled") endif() ################################################### diff --git a/cmake/OpenEXRSetup.cmake b/cmake/OpenEXRSetup.cmake index ec9db6fd50..b7fc54a690 100644 --- a/cmake/OpenEXRSetup.cmake +++ b/cmake/OpenEXRSetup.cmake @@ -253,6 +253,11 @@ if(NOT TARGET Imath::Imath AND NOT Imath_FOUND) FetchContent_GetProperties(Imath) if(NOT Imath_POPULATED) FetchContent_Populate(Imath) + + # Propagate OpenEXR's setting for pkg-config generation to Imath: + # If OpenEXR is generating it, the internal Imath should, too. + set(IMATH_INSTALL_PKG_CONFIG ${OPENEXR_INSTALL_PKG_CONFIG}) + # hrm, cmake makes Imath lowercase for the properties (to imath) add_subdirectory(${imath_SOURCE_DIR} ${imath_BINARY_DIR}) endif()