[CMake] Problem with FindXercesC.cmake

Roger Leigh rleigh at codelibre.net
Thu Sep 27 18:05:08 EDT 2018


On 27/09/18 22:55, Mateusz Loskot wrote:
> On Thu, 27 Sep 2018 at 23:34, Dorier, Matthieu <mdorier at anl.gov> wrote:
>>
>> When I call find_package(XercesC REQUIRED) and XercesC is not in a standard location, I have to set XercesC_INCLUDE_DIR to its include directory and XercesC_LIBRARY to the location of the library.

[…]

>> I use to rely on a custom FindXercesC.cmake file that was using XercesC_ROOT to figure all this out.
>> Is there any way to do the same here?
> 
> There seem to be no Xxx_ROOT_DIR handled by this module
> https://cmake.org/cmake/help/latest/module/FindXercesC.html

No, but CMAKE_PREFIX_PATH should be sufficient.  We can certainly add 
XercesC_ROOT, but is it really needed?  Matthieu, did you try 
CMAKE_PREFIX_PATH at all?

(I'm not sure what the CMake policy is on this point.  Is 
CMAKE_PREFIX_PATH support alone sufficient for Find modules?)

If the consensus is that Find modules should all provide ROOT_DIR type 
variables, then I'm sure patches to FindXercesC and FindXalanC would be 
appreciated.


Regards,
Roger


More information about the CMake mailing list