forked from bblanchon/pdfium-binaries
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PDFiumConfig.cmake
63 lines (54 loc) · 1.68 KB
/
PDFiumConfig.cmake
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# PDFium Package Configuration for CMake
#
# To use PDFium in you CMake project:
#
# 1. set the environment variable PDFium_DIR to the folder containing this file.
# 2. in your CMakeLists.txt, add
# find_package(PDFium)
# 3. then link you excecutable with PDFium
# target_link_libraries(my_exe pdfium)
include(FindPackageHandleStandardArgs)
find_path(PDFium_INCLUDE_DIR
NAMES "fpdfview.h"
PATHS "${CMAKE_CURRENT_LIST_DIR}"
PATH_SUFFIXES "include"
)
if(MSVC)
if(CMAKE_CL_64)
set(PDFium_ARCH x64)
else()
set(PDFium_ARCH x86)
endif()
find_file(PDFium_LIBRARY
NAMES "pdfium.dll"
PATHS "${CMAKE_CURRENT_LIST_DIR}"
PATH_SUFFIXES "${PDFium_ARCH}/bin")
find_file(PDFium_IMPLIB
NAMES "pdfium.dll.lib"
PATHS "${CMAKE_CURRENT_LIST_DIR}"
PATH_SUFFIXES "${PDFium_ARCH}/lib")
add_library(pdfium SHARED IMPORTED)
set_target_properties(pdfium
PROPERTIES
IMPORTED_LOCATION "${PDFium_LIBRARY}"
IMPORTED_IMPLIB "${PDFium_IMPLIB}"
INTERFACE_INCLUDE_DIRECTORIES "${PDFium_INCLUDE_DIR};${PDFium_INCLUDE_DIR}/cpp"
)
find_package_handle_standard_args(PDFium
REQUIRED_VARS PDFium_LIBRARY PDFium_IMPLIB PDFium_INCLUDE_DIR
)
else()
find_library(PDFium_LIBRARY
NAMES "pdfium"
PATHS "${CMAKE_CURRENT_LIST_DIR}"
PATH_SUFFIXES "lib")
add_library(pdfium SHARED IMPORTED)
set_target_properties(pdfium
PROPERTIES
IMPORTED_LOCATION "${PDFium_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${PDFium_INCLUDE_DIR};${PDFium_INCLUDE_DIR}/cpp"
)
find_package_handle_standard_args(PDFium
REQUIRED_VARS PDFium_LIBRARY PDFium_INCLUDE_DIR
)
endif()