Hi Eric,

On 23.03.2018 10:58, Eric Noulard wrote:
> 2018-03-23 10:21 GMT+01:00 Mario Emmenlauer <[email protected] 
> <mailto:[email protected]>>:
> 
> 
>     Thanks PF, I think this makes more sense now! I was assuming that
>     cmake always prefers CMAKE_PREFIX_PATH over builtin paths. But as you
>     clarified, that only applies to libraries that provide find_package
>     support.
> 
>     This is actually quite unfortunate. Then I don't see an easy way to
>     enforce usage of specific libs. As an example, if I want to enforce a
>     patched libtiff (that does not itself provide find_package support)
>     the only "safe" way is to replace the system libtiff. Otherwise any
>     package might just find the system version first without me even
>     knowing.
> 
> 
> You can always ship your own/patched version of  Find<Whatever>.cmake module 
> with your
> project source and build the 'local' override logic in it for every 
> project/lib that does not provide a find_package.
> 
> Be sure to APPEND your local cmake module path (CMAKE_MODULE_PATH)
> 
> something like:
>  list(APPEND CMAKE_MODULE_PATH ${AFS_SOURCE_DIR}/cmake)
> 
> before using find_package etc...
> 
> I find it a "safer" solution than system lib replacement.
> My opinion though.

I was considering this option too. But in my original email I outlined
that this is not only for my own package, but additionally for more than
30 thirdparty dependencies. So its not only about ensuring that my
packages use the correct thirdparty version, furthermore the packages
themselves have inter-dependencies that must be correctly resolved.

So I'd need to ship my own FindZLIB, FindTIFF, FindPNG, FindJPEG, FindPROJ4,
FindHDF5, FindFFTW, ... etcetc, and override the ones of all my thirdparty
dependencies. It would create a maintenance hell :-(

How are other people resolving this?

All the best,

    Mario Emmenlauer


--
BioDataAnalysis GmbH, Mario Emmenlauer      Tel. Buero: +49-89-74677203
Balanstr. 43                   mailto: memmenlauer * biodataanalysis.de
D-81669 München                          http://www.biodataanalysis.de/
-- 

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

Reply via email to