>From the good old days before IS_DIRECTORY was invented, you can also use a trailing "/" trick (hack?) with EXISTS to see if a directory exists and is a directory...
IF(EXISTS "${maybedir}/") with a trailing "/" will return false if ${maybedir} is a file that exists, but true if ${maybedir} is a directory that exists... I use this to parse only directories out of FILE(GLOB file_list "*") results. HTH, David On 1/31/08, James Bigler <[EMAIL PROTECTED]> wrote: > > Oh, that's a different question. You want this command, then (in the man > page). > > IF(IS_DIRECTORY directory-name) > > True if the given name is a directory. Behavior is well- > defined only for full paths. > > So you probably want something like this: > > IF(EXISTS "${dir}" AND IS_DIRECTORY "${dir}") > > James > > pepone.onrez wrote: > > Yes i read this > > but i want to test if is a directory no a directory or a file > >> > >> > >> On Jan 31, 2008 7:04 PM, James Bigler <[EMAIL PROTECTED]> wrote: > >> > >>> From the man page: > >>> > >>> IF(EXISTS file-name) > >>> IF(EXISTS directory-name) > >>> > >>> True if the named file or directory exists. Behavior > >>> is > >>> well-defined only for full paths. > >>> > >>> > >>> pepone.onrez wrote: > >>>> There is any way for check if a directory exists using CMake ? > >>>> > >>>> Thanks > >>>> > >>>> > >>>> > >>>> > >>> > ------------------------------------------------------------------------ > >>>> _______________________________________________ > >>>> CMake mailing list > >>>> CMake@cmake.org > >>>> http://www.cmake.org/mailman/listinfo/cmake > >>> _______________________________________________ > >>> CMake mailing list > >>> CMake@cmake.org > >>> http://www.cmake.org/mailman/listinfo/cmake > >>> > >> > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > CMake mailing list > > CMake@cmake.org > > http://www.cmake.org/mailman/listinfo/cmake > _______________________________________________ > CMake mailing list > CMake@cmake.org > http://www.cmake.org/mailman/listinfo/cmake >
_______________________________________________ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake