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's "--define-variable" command line option (e.g.: use a build "chroot" or not).</div>
<div><br></div><div>So far, I'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'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's how to use it:</div><div><br></div><div>---</div><div><div>include(FindPkgConfig)</div>
<div>set(PKG_CONFIG_CUSTOM_OPTIONS "--define-variable=mypcvar=/somewhere/on/your/disk")</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>