[CMake] Fwd: module and cmake

Alexander Neundorf a.neundorf-work at gmx.net
Sun May 20 08:02:09 EDT 2012


On Saturday 19 May 2012, Johannes Zarl wrote:
> Hello Paul,
> 
> I don't know about your specific find_package file for FFTW, but we do use
> modules together with CMake, so I'll add my thoughts:
> 
> As Eric already said, the modules command alters your environment. CMake
> doesn't know about shell modules, but most find_package commands provide
> some way to tell them about the location of a package by specifying an
> environment variable (normally something like <PACKAGE>_ROOT or
> <PACKAGE>_DIR). You'll have to look in the find-package script if this is
> the case with your FindFFTW.cmake script. If it's not written in the
> documentation on top of that file, search for "$ENV".
> 
> If your FindFFTW3.cmake does not examine any environment variable, you
> should fix it in your project (and file a bug with the original project,
> if it's not your project). If that's not an option, it's probably best if
> you just set whatever variable your findFFTW3.cmake script expects as a
> clue as parameter to cmake (e.g. "cmake ..
> -DFFTW3_INCLUDE_DIR=$FFTW3_ROOT/include").
> 
> So in summary, you should fix your module file to provide a suitable
> variable pointing to your installation root, and you should also fix
> poorly written FindXXX.cmake scripts circulating in the wild.

Yes, either such a env. variable as pointed out here, or a modified 
CMAKE_PREFIX_PATH as mentioned in the other email.

Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120520/1ed8b4c4/attachment.htm>


More information about the CMake mailing list