On 21.09.2014 23:34, Biddiscombe, John A. wrote:
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>

The cache variable projX_DIR points at the directory that contains the configuration file (e.g. is not an installation prefix) and will also be set by cmake itself if it finds a configuration file. The environment variables projX_DIR and CMAKE_PREFIX_PATH expect an installation prefix.

e.g. setting the projX_DIR environment variable to ~/apps/projX should have it look in ~/apps/projX/lib/cmake/<name>* as well.

Nils
--

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:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to