[CMake] find_path does't accept cmake variables for PATHS

Alan W. Irwin irwin at beluga.phys.uvic.ca
Sat Aug 2 17:26:36 EDT 2008


On 2008-08-02 21:41+0200 Andreas Pakulat wrote:

> Hi,
>
> it seems as if find_path doesn't work when providing multiple paths for
> the PATHS argument via a CMake variable. That is the following code
> doesn't work:
>
> set( VAR /home/andreas/boost_1_35_1/include C:/boost/include C:/Program Files/boost/boost_ /sw/local/include )
> message("VAR: ${VAR}")
> find_path(FOO
>        NAMES boost/config.hpp
>        PATHS ${VAR}
>        PATH_SUFFIXES boost-1_35
>        NO_DEFAULT_PATH
>        )
> message("FOO: ${FOO}")

${VAR} is a list.  I can never remember the rules for quoting a list or not,
but if a list doesn't work as above, then I try quoting it, e.g.,

PATHS "${VAR}"

Hope that works for you.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list