[CMake] path for install cmake scripts

Michael Wild themiwi at gmail.com
Thu Aug 25 09:59:47 EDT 2011


On Thu 25 Aug 2011 03:37:35 PM CEST, Weng Xuetian wrote:
> Hi folks,
> I have a program that have some cmake scripts to be installed in order
> to add support for find_package for this program's libs.
> But I have problem about choose the cmake path.
> Currently I use ${CMAKE_ROOT}/Modules to install my scripts. But this
> is not good if user want to install with a custom prefix under his
> home directory.
> How can I get a cmake scripts path with a custom prefix?
> 
> Regards,
> Xuetian

*NEVER* install in ${CMAKE_ROOT}! Read the "config-mode" section of the 
find_package documentation on information about where CMake searches 
for package config files. See 
http://www.cmake.org/cmake/help/cmake-2-8-docs.html and search for 
"Config mode provides an elaborate interface". There you will find the 
list of directories searched, along with an explanation of how the 
directory prefixes are constructed.

HTH

Michael


More information about the CMake mailing list