File: FindPoppler-glib.cmake

package info (click to toggle)
openscenegraph 3.2.1-6
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 32,904 kB
  • ctags: 34,781
  • sloc: cpp: 370,251; ansic: 10,145; java: 1,020; yacc: 548; objc: 288; makefile: 282; xml: 155; lex: 151
file content (41 lines) | stat: -rw-r--r-- 882 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#use pkg-config to find various modues
INCLUDE(FindPkgConfig OPTIONAL)

IF(PKG_CONFIG_FOUND)

    INCLUDE(FindPkgConfig)

    PKG_CHECK_MODULES(CAIRO cairo)
    PKG_CHECK_MODULES(POPPLER poppler-glib)

    IF (POPPLER_FOUND)

        INCLUDE(CheckCXXSourceRuns)

        SET(CMAKE_REQUIRED_INCLUDES ${POPPLER_INCLUDE_DIRS})

        # Do step by step checking,
        CHECK_CXX_SOURCE_RUNS("
        #include <cstdlib>
        #include <poppler.h>
        int main()
        {
        #ifdef POPPLER_HAS_CAIRO
           return EXIT_SUCCESS;
        #else
           return EXIT_FAILURE
        #endif
        }
        " POPPLER_HAS_CAIRO)

        IF (NOT POPPLER_HAS_CAIRO)
            SET(POPPLER_FOUND FALSE)
        ENDIF()

    ENDIF()

#    IF (POPPLER_FOUND AND (NOT POPPLER_LIBRARIES OR NOT POPPLER_INCLUDE_DIRS) )
#        SET(POPPLER_FOUND FALSE)
#    ENDIF()

ENDIF()