提交 ca6e7a0d 编写于 作者: C Christoph J. Thompson 提交者: Mark Adler

Generate and install the pkg-config file with cmake.

上级 f8867924
...@@ -7,6 +7,7 @@ set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation direc ...@@ -7,6 +7,7 @@ set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation direc
set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries") set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers") set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers")
set(INSTALL_MAN_DIR "${CMAKE_INSTALL_PREFIX}/share/man" CACHE PATH "Installation directory for manual pages") set(INSTALL_MAN_DIR "${CMAKE_INSTALL_PREFIX}/share/man" CACHE PATH "Installation directory for manual pages")
set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/share/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files")
if(NOT DEFINED BUILD_SHARED_LIBS) if(NOT DEFINED BUILD_SHARED_LIBS)
option(BUILD_SHARED_LIBS "Build a shared library form of zlib" ON) option(BUILD_SHARED_LIBS "Build a shared library form of zlib" ON)
...@@ -75,8 +76,10 @@ if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) ...@@ -75,8 +76,10 @@ if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
endif() endif()
endif() endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zlib.pc.cmakein
${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY) ${CMAKE_CURRENT_BINARY_DIR}/zlib.pc @ONLY)
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/zconf.h.cmakein
${CMAKE_CURRENT_BINARY_DIR}/zconf.h @ONLY)
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
...@@ -180,6 +183,9 @@ endif() ...@@ -180,6 +183,9 @@ endif()
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL ) if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
install(FILES zlib.3 DESTINATION "${INSTALL_MAN_DIR}/man3") install(FILES zlib.3 DESTINATION "${INSTALL_MAN_DIR}/man3")
endif() endif()
if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL )
install(FILES zlib.pc DESTINATION "${INSTALL_PKGCONFIG_DIR}")
endif()
#============================================================================ #============================================================================
# Example binaries # Example binaries
......
...@@ -17,6 +17,7 @@ zlib.3 Man page for zlib ...@@ -17,6 +17,7 @@ zlib.3 Man page for zlib
zlib.3.pdf Man page in PDF format zlib.3.pdf Man page in PDF format
zlib.map Linux symbol information zlib.map Linux symbol information
zlib.pc.in Template for pkg-config descriptor zlib.pc.in Template for pkg-config descriptor
zlib.pc.cmakein zlib.pc template for cmake
zlib2ansi perl script to convert source files for C++ compilation zlib2ansi perl script to convert source files for C++ compilation
amiga/ makefiles for Amiga SAS C amiga/ makefiles for Amiga SAS C
......
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
libdir=@INSTALL_LIB_DIR@
sharedlibdir=@INSTALL_LIB_DIR@
includedir=@INSTALL_INC_DIR@
Name: zlib
Description: zlib compression library
Version: @VERSION@
Requires:
Libs: -L${libdir} -L${sharedlibdir} -lz
Cflags: -I${includedir}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册