[CMake] Where is a good place to install CMake scripts that are to be executed by cmake -P ?

Alexander Neundorf a.neundorf-work at gmx.net
Thu Aug 22 16:04:28 EDT 2013


On Thursday 22 August 2013, you wrote:
> On 2013-08-21 22:41+0200 Alexander Neundorf wrote:
> > On Tuesday 06 August 2013, Alan W. Irwin wrote:
> >> I have a project that installs a CMake script which will be executed
> >> by users using cmake -P <fullpath_for_cmake_scriptname>.
> >> 
> >> Where is a reasonable place to install <cmake_scriptname>?  Currently I
> >> am thinking of
> >> 
> >> <prefix>/share/<project_name>/<cmake_scriptname>
> > 
> > what kind of files are these ?
> > Should they be executed manually by users or from their buildsystems,
> > after some package has been found ?
> 
> Hi Alex:
> 
> This cmake script file is executed using cmake -P from an installed
> shell script to work around some path mangling issues that occur for a
> pure shell script environment for MinGW.  So it is the cmake scripting
> ability that is being used here rather than anything specific to do
> with a build system.  So it a fairly unique use case, but nevertheless
> I would like the installation location for that cmake script file to
> be consistent with standards (if there are any such for cmake
> scripts).  For now I am sticking with
> <prefix>/share/<project_name>/<cmake_scriptname> for that install
> location, but I am willing to change if there is a more standard install
> location for cmake scripts.

I think that's a perfectly good place, it even conforms to the places searched 
by find_package() in Config-mode, even if that doesn't matter in your case as 
I understand it.

Alex


More information about the CMake mailing list