[CMake] FIND_PATH finds two out of three?

Michael Wild themiwi at gmail.com
Wed May 20 08:54:35 EDT 2009


On 19. May, 2009, at 17:58, eial at cs.bgu.ac.il wrote:

>
> I'm writing a program which is based on 3 external libs, Poco,  
> ARToolKit and opencv, now the locations in the include folder is has  
> followd:
> opencv headers are in /usr/include/opencv folder, Poco headers are  
> in /usr/include/Poco folder and ARToolKit headers are in /usr/ 
> include/AR folder.
> I'm trying to find the folder in which the headers resides, but only  
> two are returned ok, here is the code:
>
> FIND_PATH(ARTK_INCLUDE_DIR ar.h /usr/include/AR /usr/local/include/AR)
> FIND_PATH(OPENCV_INCLUDE_DIR cv.h /usr/include/opencv /usr/local/ 
> include/opencv)
> FIND_PATH(POCO_INCLUDE_DIR Poco.h /usr/include/Poco /usr/local/ 
> include/Poco)
>
> MESSAGE(STATUS ${ARTK_INCLUDE_DIR})
> MESSAGE(STATUS ${OPENCV_INCLUDE_DIR})
> MESSAGE(STATUS ${POCO_INCLUDE_DIR})
>
> and here is the output:
>
> -- /usr/include
> -- /usr/include/opencv
> -- /usr/include/Poco
>
> how can I fix this?
>
> thanks.
>

Don't look for ar.h, but for AR/ar.h. The same holds for the others.  
And then do

#include <AR/ar.h>

as described in the examples. The same holds for the other two  
libraries.

Michael



More information about the CMake mailing list