[CMake] Problem with find_path

Fernando Cacciola fernando.cacciola at gmail.com
Fri Jan 25 15:44:05 EST 2008


Here is a extract of FindQt4 from 2.4.7 (NOT 2.4.8, which is different 
somewhat)

message( STATUS "QT_INCLUDE_DIR=${QT_INCLUDE_DIR}" )
message( STATUS "QT_LIBRARY_DIR=${QT_LIBRARY_DIR}" )

  FIND_PATH(QT_QTOPENGL_INCLUDE_DIR QtOpenGL
    PATHS
    ${QT_INCLUDE_DIR}/QtOpenGL
    ${QT_LIBRARY_DIR}/QtOpenGL.framework/Headers
    NO_DEFAULT_PATH
    )

message( STATUS "QT_QTOPENGL_INCLUDE_DIR=${QT_QTOPENGL_INCLUDE_DIR}" )

In my Vista machine, it prints:

-- QT_INCLUDE_DIR=C:/Work/General/qt-win-opensource-src-4.3.3/include
-- QT_LIBRARY_DIR=C:/Work/General/qt-win-opensource-src-4.3.3/lib
--  
QT_QTOPENGL_INCLUDE_DIR=C:/Work/General/qt-win-opensource-src-4.3.3/include

But that wrong.

QtOpenGL is a folder which happens to contain a file named also QtOpenGL.
The find_path command is actually searching for the file, not the folder (so 
it appends the folder in the search path).

Yet as you can see, it is the folder what is found, not the file, and as a 
consequence the resulting path is one level wrong.

Is this a bug in find_path (in 2.4.7)?

TIA


-- 
Fernando Cacciola
SciSoft
http://fcacciola.50webs.com





More information about the CMake mailing list