[CMake] IF(IS_DIRECTORY behaviour

David Somers dsomers at omz13.com
Sun Jun 25 03:49:24 EDT 2006


I've been updating a few of my old cmake files (and writing a few new ones 
too)... in a few places I've been adding some IF(IS_DIRECTORY foo) tests.

I just noticed some strange behaviour in cmake-2.4.2:

I'm trying to test to see if directory foo is present in 
${CMAKE_CURRENT_SOURCE_DIR}

IF(IS_DIRECTORY blah)
...
ENDIF(IS_DIRECTORY blah)

does NOT work.

IF(IS_DIRECTORY ./blah)
...
ENDIF(IS_DIRECTORY ./blah)

does work.

This seems wrong (having prefix with "./") Thoughts?

BTW, I assume that IS_DIRECTORY works relative to ${CMAKE_CURRENT_SOURCE_DIR} 
unless a path to an absolute dir is given... the help for the IF(IS_DIRECTORY 
command doesn't state this at all :-(





-- 
David Somers
typographer/programmer/whatever


More information about the CMake mailing list