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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 81f5ed6..9fb059e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -623,7 +623,12 @@ if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()
add_library(poppler ${poppler_SRCS} ${LINKER_SCRIPT})
-target_include_directories(poppler PUBLIC poppler ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/poppler)
+target_include_directories(poppler PUBLIC
+ $<INSTALL_INTERFACE:include/poppler>
+ $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/poppler>
+ $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/poppler>)
if (OpenJPEG_FOUND)
# check if we can remove this when we depend on newer openjpeg versions, 2.5 seems fixed
# target openjp2 may lack interface include directories
@@ -663,9 +668,16 @@ if(MINGW AND BUILD_SHARED_LIBS)
set_target_properties(poppler PROPERTIES SUFFIX "-${POPPLER_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif()
target_link_libraries(poppler LINK_PRIVATE ${poppler_LIBS})
-install(TARGETS poppler RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(TARGETS poppler EXPORT unofficial-poppler-targets
+ RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(EXPORT unofficial-poppler-targets NAMESPACE unofficial::poppler:: DESTINATION share/unofficial-poppler)
+set_target_properties(poppler PROPERTIES EXPORT_NAME poppler-private)
if(ENABLE_UNSTABLE_API_ABI_HEADERS)
+ target_include_directories(poppler PUBLIC
+ $<INSTALL_INTERFACE:include/poppler/fofi>
+ $<INSTALL_INTERFACE:include/poppler/goo>
+ )
set(poppler_poppler_installed_headers
poppler/Annot.h
poppler/AnnotStampImageHelper.h
@@ -785,7 +797,7 @@ if(ENABLE_UNSTABLE_API_ABI_HEADERS)
set(poppler_goo_installed_headers ${poppler_goo_installed_headers} goo/JpegWriter.h)
endif()
- if (${CMAKE_VERSION} VERSION_LESS "3.23.0")
+ if (1)
install(FILES
${poppler_poppler_installed_headers}
${CMAKE_CURRENT_BINARY_DIR}/poppler/poppler-config.h
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index b38814c..303dbba 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -31,7 +31,9 @@ if(MINGW AND BUILD_SHARED_LIBS)
set_target_properties(poppler-cpp PROPERTIES SUFFIX "-${POPPLER_CPP_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}")
endif()
target_link_libraries(poppler-cpp poppler Iconv::Iconv)
-install(TARGETS poppler-cpp RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(TARGETS poppler-cpp EXPORT unofficial-poppler-cpp-targets
+ RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(EXPORT unofficial-poppler-cpp-targets NAMESPACE unofficial::poppler:: DESTINATION share/unofficial-poppler)
set(poppler_cpp_all_install_headers
poppler-destination.h
@@ -50,7 +52,7 @@ set(poppler_cpp_all_install_headers
${CMAKE_CURRENT_BINARY_DIR}/poppler-version.h
)
-if (${CMAKE_VERSION} VERSION_LESS "3.23.0")
+if (1)
install(FILES ${poppler_cpp_all_install_headers} DESTINATION include/poppler/cpp)
else()
target_sources(poppler-cpp
diff --git a/qt6/src/CMakeLists.txt b/qt6/src/CMakeLists.txt
index 1062058..848434c 100644
--- a/qt6/src/CMakeLists.txt
+++ b/qt6/src/CMakeLists.txt
@@ -47,7 +47,9 @@ if(USE_CMS)
target_link_libraries(poppler-qt6 poppler ${LCMS2_LIBRARIES})
target_include_directories(poppler-qt6 SYSTEM PRIVATE ${LCMS2_INCLUDE_DIR})
endif()
-install(TARGETS poppler-qt6 RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(TARGETS poppler-qt6 EXPORT unofficial-poppler-qt6-targets
+ RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(EXPORT unofficial-poppler-qt6-targets NAMESPACE unofficial::poppler:: DESTINATION share/unofficial-poppler)
set(poppler_qt6_all_install_headers
poppler-qt6.h
@@ -61,7 +63,7 @@ set(poppler_qt6_all_install_headers
${CMAKE_CURRENT_BINARY_DIR}/poppler-export.h
${CMAKE_CURRENT_BINARY_DIR}/poppler-version.h
)
-if (${CMAKE_VERSION} VERSION_LESS "3.23.0")
+if (1)
install(FILES ${poppler_qt6_all_install_headers} DESTINATION include/poppler/qt6)
else()
target_sources(poppler-qt6
|