[CMake] for loop won't locate libs

eial at cs.bgu.ac.il eial at cs.bgu.ac.il
Thu Jun 4 12:50:08 EDT 2009


hello, I'm trying to write a for look that will iterate on a group of libs and find the path of the lib, here is my code:
SET(LIBS AR ARMulti ARvideo)
FOREACH (LIB ${LIBS})
   SET(FOUND_LIB)
   FIND_LIBRARY(LIB_FOUND ${LIB} /usr/lib /usr/local/lib) 
   SET(ARTK_LIBRARY ${ARTK_LIBRARY} ${LIB_FOUND})
ENDFOREACH(LIB)

the result is /usr/lib64/libAR.a/usr/lib64/libAR.a/usr/lib64/libAR.a when it should be /usr/lib64/libAR.a /usr/lib64/libARMulti.a /usr/lib64/libARvideo.a
but when I run FIND_LIBRARY(test ARvideo /usr/lib /usr/local/lib), I get the right file.
how can I do that?

thanks




More information about the CMake mailing list