Re: [CMake] Problem with FindXercesC.cmake

2018-09-27 Thread Roger Leigh

On 27/09/18 22:55, Mateusz Loskot wrote:

On Thu, 27 Sep 2018 at 23:34, Dorier, Matthieu  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
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] Problem with FindXercesC.cmake

2018-09-27 Thread Michael Ellery

> On Sep 27, 2018, at 2:55 PM, Mateusz Loskot  wrote:
> 
> 
> 
>> 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
> 
> Best regards,
> -- 
> Mateusz Loskot, http://mateusz.loskot.net
> — 

although, if I understand correctly, it sounds like cmake 3.12 with policy 0074 
set might give you the xx_ROOT functionality without changing the find module:

https://cmake.org/cmake/help/latest/policy/CMP0074.html




-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] Problem with FindXercesC.cmake

2018-09-27 Thread Mateusz Loskot
On Thu, 27 Sep 2018 at 23:34, Dorier, Matthieu  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.

Correct. If Find-module can not guess, you help it by setting
FOO_INCLUDE_DIR and FOO_LIBRARY.

> If I set XercesC_LIBRARY to the directory containing the library (not to the 
> fullpath of the library itself), cmake finds XercesC but sets 
> XercesC_LIBRARIES to the folder instead of the library, and the same for the 
> XercesC::XercesC target. It seems I truly have to set XercesC_LIBRARY to the 
> name of the library rather than the path to the folder containing it, which 
> kinds of defies the point of find_package...

Find-modules are guessers and as such they do not guarantee they will
find anything.
Sometimes you need to help it, by setting some standard variables,
https://cmake.org/cmake/help/latest/manual/cmake-developer.7.html

Xxx_INCLUDE_DIR - Where to find headers for using the Xxx library.
Xxx_LIBRARY - The path of the Xxx library

Then, Find-module can also perform extra checks of the explicitly
specified library
for eg.  version, symbols, functions, etc.

> 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

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake


[CMake] Problem with FindXercesC.cmake

2018-09-27 Thread Dorier, Matthieu
Hi,


I'm using cmake 3.11.4 and the FindXercesC.cmake file shipped with it.


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.


If I set XercesC_LIBRARY to the directory containing the library (not to the 
fullpath of the library itself), cmake finds XercesC but sets XercesC_LIBRARIES 
to the folder instead of the library, and the same for the XercesC::XercesC 
target. It seems I truly have to set XercesC_LIBRARY to the name of the library 
rather than the path to the folder containing it, which kinds of defies the 
point of find_package...


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?


Thanks,


Matthieu
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake