2010-07-23 Rafael Antognolli <antognolli@profusion.mobi>
[WebKit-https.git] / cmake / FindGthread.cmake
1 # Find include and libraries for GTHREAD library
2 # GTHREAD_INCLUDE     Directories to include to use GTHREAD
3 # GTHREAD_INCLUDE-I   Directories to include to use GTHREAD (with -I)
4 # GTHREAD_LIBRARIES   Libraries to link against to use GTHREAD
5 # GTHREAD_FOUND       GTHREAD was found
6
7 IF (UNIX)
8     INCLUDE (UsePkgConfig)
9     PKGCONFIG (gthread-2.0 GTHREAD_include_dir GTHREAD_link_dir GTHREAD_libraries GTHREAD_include)
10     IF (GTHREAD_include AND GTHREAD_libraries)
11         SET (GTHREAD_FOUND TRUE)
12         EXEC_PROGRAM ("echo"
13             ARGS "${GTHREAD_include} | sed 's/[[:blank:]]*-I/;/g'"
14             OUTPUT_VARIABLE GTHREAD_INCLUDE
15         )
16         SET (GTHREAD_INCLUDE-I ${GTHREAD_include})
17         SET (GTHREAD_LIBRARIES ${GTHREAD_libraries})
18     ELSE (GTHREAD_include AND GTHREAD_libraries)
19         SET (GTHREAD_FOUND FALSE)
20     ENDIF (GTHREAD_include AND GTHREAD_libraries)
21 ENDIF (UNIX)