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)
|
find_package(PkgConfig)
|
||||||
endif()
|
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})
|
string(REGEX MATCH "LXW_VERSION \"([^\"]+)\"" _ ${ver})
|
||||||
set(VERSION ${CMAKE_MATCH_1})
|
set(VERSION ${CMAKE_MATCH_1})
|
||||||
string(REGEX MATCH "LXW_SOVERSION \"([^\"]+)\"" _ ${ver})
|
string(REGEX MATCH "LXW_SOVERSION \"([^\"]+)\"" _ ${ver})
|
||||||
set(SOVERSION ${CMAKE_MATCH_1})
|
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)
|
configure_file(dev/release/pkg-config.txt xlsxwriter.pc @ONLY)
|
||||||
|
|
||||||
|
|
||||||
# INCLUDES
|
# INCLUDES
|
||||||
# --------
|
# --------
|
||||||
enable_language(CXX)
|
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)
|
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)
|
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
|
.PHONY: docs tags examples third_party
|
||||||
|
|
||||||
# Build libxlsxwriter.
|
# Build libxlsxwriter.
|
||||||
@ -164,7 +172,11 @@ install: all
|
|||||||
$(Q)mkdir -p $(DESTDIR)$(PREFIX)/lib
|
$(Q)mkdir -p $(DESTDIR)$(PREFIX)/lib
|
||||||
$(Q)cp -R lib/* $(DESTDIR)$(PREFIX)/lib
|
$(Q)cp -R lib/* $(DESTDIR)$(PREFIX)/lib
|
||||||
$(Q)mkdir -p $(DESTDIR)$(PREFIX)/lib/pkgconfig
|
$(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.
|
# Simpler uninstall.
|
||||||
uninstall:
|
uninstall:
|
||||||
|
@ -7,4 +7,5 @@ Name: libxlsxwriter
|
|||||||
Description: A C library for creating Excel XLSX files
|
Description: A C library for creating Excel XLSX files
|
||||||
Version: @VERSION@
|
Version: @VERSION@
|
||||||
Cflags: -I${includedir}
|
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