[CMake] find_package and lib/cmake.<project>

Biddiscombe, John A. biddisco at cscs.ch
Sun Sep 21 17:34:08 EDT 2014


If a projX is installed to

~/apps/projX

And when installed it creates

projXConfig.cmake
projXConfigVersion.cmake
projXTargets-debug.cmake
projXTargets.cmake
&etc.

In ~/apps/projX/lib/cmake/projX

It is necessary to say
cmake –Dprojx_DIR=~/apps/projX/lib/cmake/projX …..

When configuring another project that uses find_package(projX)

Is there a way of setting it up so that the user only has to say
cmake –Dprojx_DIR=~/apps/projX …..

Without putting all the installed *.cmake files at the root of the install. It seems odd to me that CMake doesn’t search in lib/cmake/<projectname>

Thanks

JB


More information about the CMake mailing list