mirror of
https://github.com/jmcnamara/libxlsxwriter
synced 2025-03-28 21:13:14 +00:00
parent
ea6da0dace
commit
3a975c6b89
@ -211,16 +211,28 @@ if(NOT MSVC)
|
||||
find_package(PkgConfig)
|
||||
endif()
|
||||
|
||||
file(READ "include/xlsxwriter.h" ver)
|
||||
# Set some variables for the xlsxwriter.pc file and the .so version.
|
||||
# ------------------------------------------------------------------
|
||||
set(PREFIX ${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
file(READ "include/xlsxwriter.h" ver)
|
||||
string(REGEX MATCH "LXW_VERSION \"([^\"]+)\"" _ ${ver})
|
||||
set(VERSION ${CMAKE_MATCH_1})
|
||||
string(REGEX MATCH "LXW_SOVERSION \"([^\"]+)\"" _ ${ver})
|
||||
set(SOVERSION ${CMAKE_MATCH_1})
|
||||
set(PREFIX ${CMAKE_INSTALL_PREFIX})
|
||||
|
||||
set(ENABLED_OPTIONS "zlib")
|
||||
if(USE_SYSTEM_MINIZIP)
|
||||
string(APPEND ENABLED_OPTIONS " minizip")
|
||||
endif()
|
||||
if(USE_OPENSSL_MD5)
|
||||
string(APPEND ENABLED_OPTIONS " libcrypto")
|
||||
endif()
|
||||
|
||||
# Expand out the xlsxwriter.pc file.
|
||||
configure_file(dev/release/pkg-config.txt xlsxwriter.pc @ONLY)
|
||||
|
||||
|
||||
# INCLUDES
|
||||
# --------
|
||||
enable_language(CXX)
|
||||
|
14
Makefile
14
Makefile
@ -21,6 +21,14 @@ PYTESTFILES ?= test
|
||||
VERSION = $(shell sed -n -e 's/.*LXW_VERSION \"\(.*\)\"/\1/p' include/xlsxwriter.h)
|
||||
SOVERSION = $(shell sed -n -e 's/.*LXW_SOVERSION \"\(.*\)\"/\1/p' include/xlsxwriter.h)
|
||||
|
||||
ENABLED_OPTIONS = zlib
|
||||
ifdef USE_SYSTEM_MINIZIP
|
||||
ENABLED_OPTIONS += minizip
|
||||
endif
|
||||
ifdef USE_OPENSSL_MD5
|
||||
ENABLED_OPTIONS += libcrypto
|
||||
endif
|
||||
|
||||
.PHONY: docs tags examples third_party
|
||||
|
||||
# Build libxlsxwriter.
|
||||
@ -164,7 +172,11 @@ install: all
|
||||
$(Q)mkdir -p $(DESTDIR)$(PREFIX)/lib
|
||||
$(Q)cp -R lib/* $(DESTDIR)$(PREFIX)/lib
|
||||
$(Q)mkdir -p $(DESTDIR)$(PREFIX)/lib/pkgconfig
|
||||
$(Q)sed -e 's|@PREFIX@|$(PREFIX)|g' -e 's|@VERSION@|$(VERSION)|g' dev/release/pkg-config.txt > $(DESTDIR)$(PREFIX)/lib/pkgconfig/xlsxwriter.pc
|
||||
$(Q)sed -e 's|@PREFIX@|$(PREFIX)|g' \
|
||||
-e 's|@VERSION@|$(VERSION)|g' \
|
||||
-e 's|@ENABLED_OPTIONS@|$(ENABLED_OPTIONS)|g' \
|
||||
dev/release/pkg-config.txt \
|
||||
> $(DESTDIR)$(PREFIX)/lib/pkgconfig/xlsxwriter.pc
|
||||
|
||||
# Simpler uninstall.
|
||||
uninstall:
|
||||
|
@ -7,4 +7,5 @@ Name: libxlsxwriter
|
||||
Description: A C library for creating Excel XLSX files
|
||||
Version: @VERSION@
|
||||
Cflags: -I${includedir}
|
||||
Libs: -L${libdir} -lxlsxwriter -lz
|
||||
Libs: -L${libdir} -lxlsxwriter
|
||||
Requires.private: @ENABLED_OPTIONS@
|
||||
|
Loading…
x
Reference in New Issue
Block a user