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

Andreas Pakulat apaku at gmx.de
Sat Aug 2 15:41:23 EDT 2008


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}")

I get:
VAR: /home/andreas/boost_1_35_1/include;C:/boost/include;C:/Program;Files/boost/boost_;/sw/local/include
FOO: FOO-NOTFOUND

as output. When putting the paths as they are set for the variable
directly as arguments for PATHS it works fine.

Is this to be expected? The documentation doesn't exactly say anything
about this, but I find it surprising that I can't pass a variable to
find_path that contains paths to be checked in.

I've verified this with CMake 2.6.0 and 2.4.5

Andreas

-- 
Are you sure the back door is locked?


More information about the CMake mailing list