OpenColorIO icon indicating copy to clipboard operation
OpenColorIO copied to clipboard

Install the pkg-config file when building under MSYS on windows?

Open agriggio opened this issue 3 years ago • 3 comments

Hi, it would be good if the pkg-config script (OpenColorIO.pc) was installed when building under MSYS on windows. Here's a simple patch to do that:

--- b/src/OpenColorIO/CMakeLists.txt	2022-06-05 20:59:43.000000000 +0200
+++ a/src/OpenColorIO/CMakeLists.txt	2022-08-23 17:17:20.516786583 +0200
@@ -171,7 +171,7 @@
     SystemMonitor.cpp
 )
 
-if(NOT WIN32)
+if(NOT WIN32 OR MSYS)
 
     # Install the pkg-config file.
 

agriggio avatar Aug 23 '22 15:08 agriggio

This should be MINGW instead of MSYS. (MSYS is a POSIX emulation environment like Cygwin where I doubt OCIO is useful; one is typically building for the WIn32 API, i.e. MINGW). An alternative is to change this to the more readable if(UNIX or MINGW) (UNIX covers both Apple and Cygwin in addition).

FYI, pkg-config runs everywhere (available via vcpkg for MSVC), so the if clause should just be simply removed and the .pc file installed always.

kmilos avatar Sep 02 '22 08:09 kmilos

pkgconf is also a working alternative if you use Meson.

amyspark avatar Oct 11 '22 18:10 amyspark

Indeed, vcpkg seem to use meson+pkgconf quite a bit for Win32 packaging.

kmilos avatar Oct 11 '22 18:10 kmilos

@agriggio , @kmilos , @amyspark Please review PR #1720 and check that it meets your needs, thanks!

doug-walker avatar Nov 09 '22 02:11 doug-walker