[CMake] Cannot find "modules" directory on MacOS

Chris Wolf cw10025 at gmail.com
Thu Aug 5 15:57:22 EDT 2010


Today is my first time messing with CMake, so I don't have any prior
versions.

Well, I was reading this page:

http://www.cmake.org/Wiki/CMake:How_To_Write_Platform_Checks

because I wanted to use:

INCLUDE (CheckIncludeFiles)

This page has the following paragraph:

    Additionally to the builtin commands, cmake offers more commands implemented 
    by cmake script files, called modules. These files are located in the cmake 
    module directory, on UNIX systems is this by default /usr/local/share/CMake/Modules . 

So before I even just tried the module, I went looking for it to see what 
the source looked like.  When I didn't find it in /usr/share/cmake-2.8 
or /usr/local/share/cmake-2.8, as suggested by the Wiki page and this
thread:

http://www.mail-archive.com/cmake@cmake.org/msg04790.html

I just assumed something was wrong and that the installation was not complete.

In fact, I jumped to a conclusion - apparently, when those extra resources
are in the application bundle, then can be found, in-place, even with the command-line
cmake executable.  In other words, I was wrong - those files are fine to 
be under, "/Applications/CMake\ 2.8-2.app/Contents/"

Thanks for quickly pointing that out.  I have more development experience
on UNIX/Linux, which is how I made this mistake.  However, I would recommend
updating that Wiki page to mention that on MacOS the modules are 
located within the application bundle, under
"/Applications/CMake 2.8-2.app/Contents/share/cmake-2.8/Modules"

Also, I think the man pages still need to be copied, or symlinked,
or the MANPATH updated.

Thanks,

Chris Wolf


On 8/5/10 3:18 PM, Ryan Pavlik wrote:
> How are you running cmake?  I've used the installer from the web site on my
> mac, and it works fine both from the GUI and the command line, and I did not
> have to move/link the modules.  Is it possible that you have some other
> version of cmake installed (from macports, fink, or brew?)?  Try removing
> it, if that is the case, and installing anew from the cmake-provided
> binaries.
> 
> Ryan
> 
> On Thu, Aug 5, 2010 at 2:08 PM, Chris Wolf <cw10025 at gmail.com> wrote:
> 
>> I already searched around and found this answer:
>>
>> http://www.mail-archive.com/cmake@cmake.org/msg04790.html
>>
>> ...however, there is NO such directory, " /usr/share/cmake*" on my system.
>> (nor "/usr/local/share/cmake*")
>>
>> I tried to investigate:
>>
>> $ cd /Library/Receipts/cmake-2.8.2-Darwin-universal.pkg/Contents
>> $ lsbom -s Archive.bom | grep -i module
>> ./CMake
>> 2.8-2.app/Contents/share/cmake-2.8/Modules/AddFileDependencies.cmake
>> ./CMake 2.8-2.app/Contents/share/cmake-2.8/Modules/BundleUtilities.cmake
>> ./CMake 2.8-2.app/Contents/share/cmake-2.8/Modules/CMake.cmake
>> ./CMake
>> 2.8-2.app/Contents/share/cmake-2.8/Modules/CMakeASM-ATTInformation.cmake
>> ./CMake 2.8-2.app/Contents/share/cmake-2.8/Modules/
>> CMakeASMCompiler.cmake.in
>> ./CMake
>> 2.8-2.app/Contents/share/cmake-2.8/Modules/CMakeASMInformation.cmake
>> [...]
>>
>> So obviously, they're in the package and the installer was supposed to
>> have put the modules on the system, either in
>> /usr/share or /usr/local/share  but they're not there.
>>
>> Then I tried looking in the Application bundle:
>>
>> $ cd /Applications/CMake 2.8-2.app/Contents
>> $ ls -l
>> drwxr-xr-x  8 cwolf  cwolf   272 Aug  5 14:52 bin
>> drwxr-xr-x  3 cwolf  cwolf   102 Jun 28 11:12 doc
>> drwxr-xr-x  3 cwolf  cwolf   102 Jun 28 11:13 man
>> drwxr-xr-x  6 cwolf  cwolf   204 Jun 28 11:12 share
>> [...]
>>
>> ...so that's where they are.  When I ran the installer, I elected to
>> let it create symlinks in /usr/local, but it only did that for the
>> binaries in "bin".
>>
>> The "postflight" script should have also symlinked, or copied,
>> the "doc", "man" and "share" directory hierarchies content also.
>>
>> I can do this manually myself, but I just wanted to point out the
>> issue with the MacOS installer package for cmake-2.8.2.
>>
>> Thanks,
>>
>> Chris Wolf
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
>>
> 
> 
> 


More information about the CMake mailing list