Create and install pkg-config file with cmake
This commit is contained in:
parent
fce21777bd
commit
cba4e79a93
@ -130,8 +130,20 @@ IF (ZSTD_BUILD_STATIC)
|
||||
ENDIF (ZSTD_BUILD_STATIC)
|
||||
|
||||
IF (UNIX)
|
||||
# pkg-config
|
||||
SET(PREFIX "${CMAKE_INSTALL_PREFIX}")
|
||||
SET(LIBDIR "${CMAKE_INSTALL_PREFIX}/lib")
|
||||
SET(INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/include")
|
||||
SET(VERSION "${LIBVER_MAJOR}.${LIBVER_MINOR}.${LIBVER_RELEASE}")
|
||||
ADD_CUSTOM_TARGET(libzstd.pc ALL
|
||||
${CMAKE_COMMAND} -DIN="${LIBRARY_DIR}/libzstd.pc.in" -DOUT="libzstd.pc"
|
||||
-DPREFIX="${PREFIX}" -DLIBDIR="${LIBDIR}" -DINCLUDEDIR="${INCLUDEDIR}" -DVERSION="${VERSION}"
|
||||
-P "${CMAKE_SOURCE_DIR}/lib/pkgconfig.cmake"
|
||||
COMMENT "Creating pkg-config file")
|
||||
|
||||
# install target
|
||||
INSTALL(FILES ${LIBRARY_DIR}/zstd.h ${LIBRARY_DIR}/deprecated/zbuff.h ${LIBRARY_DIR}/dictBuilder/zdict.h DESTINATION "include")
|
||||
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/libzstd.pc" DESTINATION "share/pkgconfig")
|
||||
INSTALL(TARGETS libzstd_shared LIBRARY DESTINATION "lib")
|
||||
IF (ZSTD_BUILD_STATIC)
|
||||
INSTALL(TARGETS libzstd_static ARCHIVE DESTINATION "lib")
|
||||
|
1
build/cmake/lib/pkgconfig.cmake
Normal file
1
build/cmake/lib/pkgconfig.cmake
Normal file
@ -0,0 +1 @@
|
||||
CONFIGURE_FILE("${IN}" "${OUT}" @ONLY)
|
Loading…
Reference in New Issue
Block a user