2018-03-23 10:21 GMT+01:00 Mario Emmenlauer <[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.
--
Eric
--
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