[CMake] Install path for package files
Johannes Zarl
johannes.zarl at jku.at
Mon Oct 6 05:55:54 EDT 2014
As is also written in the stackoverflow answer, this information can be found
in the cmake documentation for find_package[1]:
> <prefix>/ (W)
> <prefix>/(cmake|CMake)/ (W)
> <prefix>/<name>*/ (W)
> <prefix>/<name>*/(cmake|CMake)/ (W)
> <prefix>/(lib/<arch>|lib|share)/cmake/<name>*/ (U)
> <prefix>/(lib/<arch>|lib|share)/<name>*/ (U)
> <prefix>/(lib/<arch>|lib|share)/<name>*/(cmake|CMake)/ (U)
>
> On systems supporting OS X Frameworks and Application Bundles the following
> directories are searched for frameworks or bundles containing a
> configuration file: <prefix>/<name>.framework/Resources/
> (A)
> <prefix>/<name>.framework/Resources/CMake/ (A)
> <prefix>/<name>.framework/Versions/*/Resources/ (A)
> <prefix>/<name>.framework/Versions/*/Resources/CMake/ (A)
> <prefix>/<name>.app/Contents/Resources/ (A)
> <prefix>/<name>.app/Contents/Resources/CMake/ (A)
Just use any directory based on your target platform and you're fine.
[1] http://www.cmake.org/cmake/help/v3.0/command/find_package.html
HTH,
Johannes
On Friday, 3. October 2014, 12:22:57, Alexander Lamaison wrote:
> Noah Roberts <roberts.noah at gmail.com>
> writes:
>
> snip
>
> > I gather I need to create a BlahModule.cmake file that implements the
> > package finding stuff. I want to install this wherever cmake will find
> > it. I don't want to put it in some place in the system and then expect
> > dependent CMakeLists.txt files to set that path when using
> > find_package.
>
> snip
>
> > So what is the variable I use in the install() function for the
> > DESTINATION parameter to do this? I assume there must be one... I
> > can't seem to find it in the documentation though.
>
> Me neither. This answer [1] lists the places that CMake looks for the
> BlahConfig.cmake file so on Unix it's fairly simple. Set the
> DESTINATION to 'lib' which will install it to
> /usr/local/lib/BlahConfig.cmake where, presumable, find_package will
> locate it. I don't understand how this is meant to work on Windows,
> though. How is CMake meant to know which root to start thee search
> under?
>
> [1] http://stackoverflow.com/a/11965673/67013
>
> Alex
More information about the CMake
mailing list