[poppler] CMakeLists.txt cmake/modules cpp/CMakeLists.txt glib/CMakeLists.txt glib/reference poppler-cairo.pc.cmake poppler-cpp.pc.cmake poppler-glib.pc.cmake poppler.pc.cmake poppler-qt4.pc.cmake poppler-qt5.pc.cmake poppler-splash.pc.cmake qt4/src qt5/src utils/CMakeLists.txt
Albert Astals Cid
aacid at kemper.freedesktop.org
Mon Oct 30 23:21:32 UTC 2017
CMakeLists.txt | 21 ++++++++++-----------
cmake/modules/GObjectIntrospectionMacros.cmake | 4 ++--
cpp/CMakeLists.txt | 2 +-
glib/CMakeLists.txt | 2 +-
glib/reference/CMakeLists.txt | 2 +-
poppler-cairo.pc.cmake | 5 ++---
poppler-cpp.pc.cmake | 5 ++---
poppler-glib.pc.cmake | 5 ++---
poppler-qt4.pc.cmake | 5 ++---
poppler-qt5.pc.cmake | 5 ++---
poppler-splash.pc.cmake | 5 ++---
poppler.pc.cmake | 5 ++---
qt4/src/CMakeLists.txt | 2 +-
qt5/src/CMakeLists.txt | 2 +-
utils/CMakeLists.txt | 22 +++++++++++-----------
15 files changed, 42 insertions(+), 50 deletions(-)
New commits:
commit 67c3878ef10449b241c37d1022e2518029860335
Author: Emilio Pozuelo Monfort <pochu27 at gmail.com>
Date: Tue Oct 31 00:20:29 2017 +0100
cmake: support GNUInstallDirs
This allows users to set various install directories, e.g.
libdir, includedir, mandir...
Bug #103211
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4b8a1a6d..df70c153 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,6 +22,8 @@ test_big_endian(WORDS_BIGENDIAN)
include(CheckFileOffsetBits)
CHECK_FILE_OFFSET_BITS()
+include(GNUInstallDirs)
+
find_package (ECM 1.6.0 QUIET NO_MODULE)
if (ECM_FOUND)
include("${ECM_MODULE_DIR}/ECMEnableSanitizers.cmake")
@@ -65,9 +67,6 @@ else()
endif()
option(EXTRA_WARN "Enable extra compile warnings" OFF)
-set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)")
-set(SHARE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share" CACHE STRING "Share directory name")
-
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(TESTDATADIR "${CMAKE_SOURCE_DIR}/../test" CACHE STRING "Specify test data dir.")
@@ -550,7 +549,7 @@ target_link_libraries(poppler LINK_PRIVATE ${poppler_LIBS})
if(CMAKE_USE_PTHREADS_INIT)
target_link_libraries(poppler LINK_PRIVATE Threads::Threads)
endif()
-install(TARGETS poppler RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX})
+install(TARGETS poppler RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
if(ENABLE_XPDF_HEADERS)
install(FILES
@@ -746,24 +745,24 @@ else()
set(PC_REQUIRES_PRIVATE "")
endif()
-poppler_create_install_pkgconfig(poppler.pc lib${LIB_SUFFIX}/pkgconfig)
+poppler_create_install_pkgconfig(poppler.pc ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
if(ENABLE_SPLASH)
- poppler_create_install_pkgconfig(poppler-splash.pc lib${LIB_SUFFIX}/pkgconfig)
+ poppler_create_install_pkgconfig(poppler-splash.pc ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
if(ENABLE_QT4)
- poppler_create_install_pkgconfig(poppler-qt4.pc lib${LIB_SUFFIX}/pkgconfig)
+ poppler_create_install_pkgconfig(poppler-qt4.pc ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
if(ENABLE_QT5)
- poppler_create_install_pkgconfig(poppler-qt5.pc lib${LIB_SUFFIX}/pkgconfig)
+ poppler_create_install_pkgconfig(poppler-qt5.pc ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
if(ENABLE_GLIB)
- poppler_create_install_pkgconfig(poppler-glib.pc lib${LIB_SUFFIX}/pkgconfig)
+ poppler_create_install_pkgconfig(poppler-glib.pc ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
if(CAIRO_FOUND)
- poppler_create_install_pkgconfig(poppler-cairo.pc lib${LIB_SUFFIX}/pkgconfig)
+ poppler_create_install_pkgconfig(poppler-cairo.pc ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
if(ENABLE_CPP)
- poppler_create_install_pkgconfig(poppler-cpp.pc lib${LIB_SUFFIX}/pkgconfig)
+ poppler_create_install_pkgconfig(poppler-cpp.pc ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
diff --git a/cmake/modules/GObjectIntrospectionMacros.cmake b/cmake/modules/GObjectIntrospectionMacros.cmake
index fddaf60f..cea579eb 100644
--- a/cmake/modules/GObjectIntrospectionMacros.cmake
+++ b/cmake/modules/GObjectIntrospectionMacros.cmake
@@ -72,7 +72,7 @@ macro(gir_add_introspections introspections_girs)
VERBATIM
)
list(APPEND _gir_girs ${CMAKE_CURRENT_BINARY_DIR}/${gir})
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${gir} DESTINATION ${SHARE_INSTALL_DIR}/gir-1.0)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${gir} DESTINATION ${CMAKE_INSTALL_DATADIR}/gir-1.0)
string(REPLACE ".gir" ".typelib" _typelib "${gir}")
add_custom_command(
@@ -86,7 +86,7 @@ macro(gir_add_introspections introspections_girs)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
list(APPEND _gir_typelibs ${CMAKE_CURRENT_BINARY_DIR}/${_typelib})
- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_typelib} DESTINATION lib${LIB_SUFFIX}/girepository-1.0)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_typelib} DESTINATION ${CMAKE_INSTALL_LIBDIR}/girepository-1.0)
endforeach()
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 67b5747c..1cb26daf 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -25,7 +25,7 @@ set(poppler_cpp_SRCS
add_library(poppler-cpp SHARED ${poppler_cpp_SRCS})
set_target_properties(poppler-cpp PROPERTIES VERSION 0.3.0 SOVERSION 0)
target_link_libraries(poppler-cpp poppler ${ICONV_LIBRARIES})
-install(TARGETS poppler-cpp RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX})
+install(TARGETS poppler-cpp RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES
poppler-document.h
diff --git a/glib/CMakeLists.txt b/glib/CMakeLists.txt
index 3e861c06..a34b9294 100644
--- a/glib/CMakeLists.txt
+++ b/glib/CMakeLists.txt
@@ -86,7 +86,7 @@ target_link_libraries(poppler-glib poppler ${GLIB2_LIBRARIES} ${CAIRO_LIBRARIES}
if(CMAKE_USE_PTHREADS_INIT)
target_link_libraries(poppler-glib Threads::Threads)
endif()
-install(TARGETS poppler-glib RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX})
+install(TARGETS poppler-glib RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES
${poppler_glib_public_headers}
diff --git a/glib/reference/CMakeLists.txt b/glib/reference/CMakeLists.txt
index 2743ffbc..15515406 100644
--- a/glib/reference/CMakeLists.txt
+++ b/glib/reference/CMakeLists.txt
@@ -8,5 +8,5 @@ add_custom_command(
add_custom_target(glib-docs ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/glib-docs-build.stamp)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
- DESTINATION "${SHARE_INSTALL_DIR}/gtk-doc/html/poppler"
+ DESTINATION "${CMAKE_INSTALL_DATADIR}/gtk-doc/html/poppler"
)
diff --git a/poppler-cairo.pc.cmake b/poppler-cairo.pc.cmake
index b32f1183..4a606440 100644
--- a/poppler-cairo.pc.cmake
+++ b/poppler-cairo.pc.cmake
@@ -1,7 +1,6 @@
prefix=@CMAKE_INSTALL_PREFIX@
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib at LIB_SUFFIX@
-includedir=${prefix}/include
+libdir=@CMAKE_INSTALL_LIBDIR@
+includedir=@CMAKE_INSTALL_INCLUDEDIR@
Name: poppler-cairo
Description: Cairo backend for Poppler PDF rendering library
diff --git a/poppler-cpp.pc.cmake b/poppler-cpp.pc.cmake
index 3f56b3d9..a26177a5 100644
--- a/poppler-cpp.pc.cmake
+++ b/poppler-cpp.pc.cmake
@@ -1,7 +1,6 @@
prefix=@CMAKE_INSTALL_PREFIX@
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib at LIB_SUFFIX@
-includedir=${prefix}/include
+libdir=@CMAKE_INSTALL_LIBDIR@
+includedir=@CMAKE_INSTALL_INCLUDEDIR@
Name: poppler-cpp
Description: cpp backend for Poppler PDF rendering library
diff --git a/poppler-glib.pc.cmake b/poppler-glib.pc.cmake
index e15e6699..6e006d49 100644
--- a/poppler-glib.pc.cmake
+++ b/poppler-glib.pc.cmake
@@ -1,7 +1,6 @@
prefix=@CMAKE_INSTALL_PREFIX@
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib at LIB_SUFFIX@
-includedir=${prefix}/include
+libdir=@CMAKE_INSTALL_LIBDIR@
+includedir=@CMAKE_INSTALL_INCLUDEDIR@
Name: poppler-glib
Description: GLib wrapper for poppler
diff --git a/poppler-qt4.pc.cmake b/poppler-qt4.pc.cmake
index b17fd5d8..8523a17a 100644
--- a/poppler-qt4.pc.cmake
+++ b/poppler-qt4.pc.cmake
@@ -1,7 +1,6 @@
prefix=@CMAKE_INSTALL_PREFIX@
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib at LIB_SUFFIX@
-includedir=${prefix}/include
+libdir=@CMAKE_INSTALL_LIBDIR@
+includedir=@CMAKE_INSTALL_INCLUDEDIR@
Name: poppler-qt4
Description: Qt4 bindings for poppler
diff --git a/poppler-qt5.pc.cmake b/poppler-qt5.pc.cmake
index b4d87b76..aaa1aa77 100644
--- a/poppler-qt5.pc.cmake
+++ b/poppler-qt5.pc.cmake
@@ -1,7 +1,6 @@
prefix=@CMAKE_INSTALL_PREFIX@
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib at LIB_SUFFIX@
-includedir=${prefix}/include
+libdir=CMAKE_INSTALL_LIBDIR@
+includedir=@CMAKE_INSTALL_INCLUDEDIR@
Name: poppler-qt5
Description: Qt5 bindings for poppler
diff --git a/poppler-splash.pc.cmake b/poppler-splash.pc.cmake
index cb95b3d2..1aa1a835 100644
--- a/poppler-splash.pc.cmake
+++ b/poppler-splash.pc.cmake
@@ -1,7 +1,6 @@
prefix=@CMAKE_INSTALL_PREFIX@
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib at LIB_SUFFIX@
-includedir=${prefix}/include
+libdir=@CMAKE_INSTALL_LIBDIR@
+includedir=@CMAKE_INSTALL_INCLUDEDIR@
Name: poppler-splash
Description: Splash backend for Poppler PDF rendering library
diff --git a/poppler.pc.cmake b/poppler.pc.cmake
index f1aebedb..9432c5c6 100644
--- a/poppler.pc.cmake
+++ b/poppler.pc.cmake
@@ -1,7 +1,6 @@
prefix=@CMAKE_INSTALL_PREFIX@
-exec_prefix=${prefix}
-libdir=${exec_prefix}/lib at LIB_SUFFIX@
-includedir=${prefix}/include
+libdir=@CMAKE_INSTALL_LIBDIR@
+includedir=@CMAKE_INSTALL_INCLUDEDIR@
Name: poppler
Description: PDF rendering library
diff --git a/qt4/src/CMakeLists.txt b/qt4/src/CMakeLists.txt
index b803f755..55ca97b0 100644
--- a/qt4/src/CMakeLists.txt
+++ b/qt4/src/CMakeLists.txt
@@ -35,7 +35,7 @@ target_link_libraries(poppler-qt4 poppler ${QT4_QTCORE_LIBRARY} ${QT4_QTGUI_LIBR
if(MSVC)
target_link_libraries(poppler-qt4 poppler ${poppler_LIBS})
endif()
-install(TARGETS poppler-qt4 RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX})
+install(TARGETS poppler-qt4 RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES
poppler-qt4.h
diff --git a/qt5/src/CMakeLists.txt b/qt5/src/CMakeLists.txt
index 5cf310ae..113140a3 100644
--- a/qt5/src/CMakeLists.txt
+++ b/qt5/src/CMakeLists.txt
@@ -35,7 +35,7 @@ target_link_libraries(poppler-qt5 poppler ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIE
if(MSVC)
target_link_libraries(poppler-qt5 poppler ${poppler_LIBS})
endif()
-install(TARGETS poppler-qt5 RUNTIME DESTINATION bin LIBRARY DESTINATION lib${LIB_SUFFIX} ARCHIVE DESTINATION lib${LIB_SUFFIX})
+install(TARGETS poppler-qt5 RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES
poppler-qt5.h
diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index 0d82d4ea..07d73651 100644
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -14,7 +14,7 @@ if (ENABLE_SPLASH)
add_executable(pdftoppm ${pdftoppm_SOURCES})
target_link_libraries(pdftoppm ${common_libs})
install(TARGETS pdftoppm DESTINATION bin)
- install(FILES pdftoppm.1 DESTINATION ${SHARE_INSTALL_DIR}/man/man1)
+ install(FILES pdftoppm.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
endif ()
if (HAVE_CAIRO)
@@ -44,7 +44,7 @@ if (HAVE_CAIRO)
target_link_libraries(pdftocairo ${LCMS2_LIBRARIES})
endif()
install(TARGETS pdftocairo DESTINATION bin)
- install(FILES pdftocairo.1 DESTINATION ${SHARE_INSTALL_DIR}/man/man1)
+ install(FILES pdftocairo.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
endif ()
# pdfdetach
@@ -54,7 +54,7 @@ set(pdfdetach_SOURCES ${common_srcs}
add_executable(pdfdetach ${pdfdetach_SOURCES})
target_link_libraries(pdfdetach ${common_libs})
install(TARGETS pdfdetach DESTINATION bin)
-install(FILES pdfdetach.1 DESTINATION ${SHARE_INSTALL_DIR}/man/man1)
+install(FILES pdfdetach.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
# pdffonts
set(pdffonts_SOURCES ${common_srcs}
@@ -63,7 +63,7 @@ set(pdffonts_SOURCES ${common_srcs}
add_executable(pdffonts ${pdffonts_SOURCES})
target_link_libraries(pdffonts ${common_libs})
install(TARGETS pdffonts DESTINATION bin)
-install(FILES pdffonts.1 DESTINATION ${SHARE_INSTALL_DIR}/man/man1)
+install(FILES pdffonts.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
# pdfimages
set(pdfimages_SOURCES ${common_srcs}
@@ -76,7 +76,7 @@ set(pdfimages_SOURCES ${common_srcs}
add_executable(pdfimages ${pdfimages_SOURCES})
target_link_libraries(pdfimages ${common_libs})
install(TARGETS pdfimages DESTINATION bin)
-install(FILES pdfimages.1 DESTINATION ${SHARE_INSTALL_DIR}/man/man1)
+install(FILES pdfimages.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
# pdfinfo
set(pdfinfo_SOURCES ${common_srcs}
@@ -87,7 +87,7 @@ set(pdfinfo_SOURCES ${common_srcs}
add_executable(pdfinfo ${pdfinfo_SOURCES})
target_link_libraries(pdfinfo ${common_libs})
install(TARGETS pdfinfo DESTINATION bin)
-install(FILES pdfinfo.1 DESTINATION ${SHARE_INSTALL_DIR}/man/man1)
+install(FILES pdfinfo.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
if (ENABLE_NSS3)
# pdfsig
@@ -106,7 +106,7 @@ set(pdftops_SOURCES ${common_srcs}
add_executable(pdftops ${pdftops_SOURCES})
target_link_libraries(pdftops ${common_libs})
install(TARGETS pdftops DESTINATION bin)
-install(FILES pdftops.1 DESTINATION ${SHARE_INSTALL_DIR}/man/man1)
+install(FILES pdftops.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
# pdftotext
set(pdftotext_SOURCES ${common_srcs}
@@ -115,7 +115,7 @@ set(pdftotext_SOURCES ${common_srcs}
add_executable(pdftotext ${pdftotext_SOURCES})
target_link_libraries(pdftotext ${common_libs})
install(TARGETS pdftotext DESTINATION bin)
-install(FILES pdftotext.1 DESTINATION ${SHARE_INSTALL_DIR}/man/man1)
+install(FILES pdftotext.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
# pdftohtml
set(pdftohtml_SOURCES ${common_srcs}
@@ -127,7 +127,7 @@ set(pdftohtml_SOURCES ${common_srcs}
add_executable(pdftohtml ${pdftohtml_SOURCES})
target_link_libraries(pdftohtml ${common_libs})
install(TARGETS pdftohtml DESTINATION bin)
-install(FILES pdftohtml.1 DESTINATION ${SHARE_INSTALL_DIR}/man/man1)
+install(FILES pdftohtml.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
# pdfseparate
set(pdfseparate_SOURCES ${common_srcs}
@@ -136,7 +136,7 @@ set(pdfseparate_SOURCES ${common_srcs}
add_executable(pdfseparate ${pdfseparate_SOURCES})
target_link_libraries(pdfseparate ${common_libs})
install(TARGETS pdfseparate DESTINATION bin)
-install(FILES pdfseparate.1 DESTINATION ${SHARE_INSTALL_DIR}/man/man1)
+install(FILES pdfseparate.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
# pdfunite
set(pdfunite_SOURCES ${common_srcs}
@@ -145,4 +145,4 @@ set(pdfunite_SOURCES ${common_srcs}
add_executable(pdfunite ${pdfunite_SOURCES})
target_link_libraries(pdfunite ${common_libs})
install(TARGETS pdfunite DESTINATION bin)
-install(FILES pdfunite.1 DESTINATION ${SHARE_INSTALL_DIR}/man/man1)
+install(FILES pdfunite.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
More information about the poppler
mailing list