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

Eric Noulard eric.noulard at gmail.com
Tue Aug 6 05:08:08 EDT 2013


2013/8/6 Alan W. Irwin <irwin at beluga.phys.uvic.ca>:
> 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>
>
> but I am a bit concerned that location might be a bad choice because
> it is completely unpopulated under Debian (at least for CMake
> scriptnames that end in *.cmake), i.e.,
>
> irwin at raven> ls /usr/share/*/*.cmake
> ls: cannot access /usr/share/*/*.cmake: No such file or directory

May be you should try:
find /usr/share/ -name "*.cmake"

(or use globstar bash option:
 http://www.linuxjournal.com/content/globstar-new-bash-globbing-option
 $ shopt -s globstar
 $ ls /usr/share/**/*.cmake
)

on my debian (Jessie) I get at least:
/usr/share/llvm-3.4/cmake/*.cmake
/usr/share/cmake/SharedDesktopOntologies/*.cmake
/usr/share/cmake-2.8/...
/usr/share/kde4/apps/cmake/modules/*.cmake

I usually install my CMake scripts in:
<prefix>/share/<project_name>/<cmake_scriptname>
or
<prefix>/share/<project_name>/scripts/<cmake_scriptname>


-- 
Erk
L'élection n'est pas la démocratie -- http://www.le-message.org


More information about the CMake mailing list