Hi all,<div><br></div><div>as part of our internal software build system, we make heavy use of pkg-config .pc files, and found very useful to parametrize compile options and paths using pkg-config&#39;s &quot;--define-variable&quot; command line option (e.g.: use a build &quot;chroot&quot; or not).</div>
<div><br></div><div>So far, I&#39;ve been unable to find a satisfying cross-platform way of doing this, using CMake, so I modified FindPkgConfig.cmake to allow custom options to be used when calling pkg-config.</div><div>
<br></div><div>I&#39;m not a long time CMake user and it may not be the best CMake way to achieve this.</div><div><br></div><div>Here&#39;s how to use it:</div><div><br></div><div>---</div><div><div>include(FindPkgConfig)</div>
<div>set(PKG_CONFIG_CUSTOM_OPTIONS &quot;--define-variable=mypcvar=/somewhere/on/your/disk&quot;)</div><div><br></div><div>pkg_check_modules(MYMODULE REQUIRED mymodule)</div><div>---</div><div><br></div><div>A patch against CMake 2.6.3 is attached, in the hope it will be useful to someone else.</div>
<div><br></div><div>-- </div><div>    Remy Chibois</div><div><br></div><div><br></div></div>