File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -211,16 +211,28 @@ if(NOT MSVC)
211211 find_package (PkgConfig )
212212endif ()
213213
214- file (READ "include/xlsxwriter.h" ver )
214+ # Set some variables for the xlsxwriter.pc file and the .so version.
215+ # ------------------------------------------------------------------
216+ set (PREFIX ${CMAKE_INSTALL_PREFIX } )
215217
218+ file (READ "include/xlsxwriter.h" ver )
216219string (REGEX MATCH "LXW_VERSION \" ([^\" ]+)\" " _ ${ver} )
217220set (VERSION ${CMAKE_MATCH_1} )
218221string (REGEX MATCH "LXW_SOVERSION \" ([^\" ]+)\" " _ ${ver} )
219222set (SOVERSION ${CMAKE_MATCH_1} )
220- set (PREFIX ${CMAKE_INSTALL_PREFIX } )
221223
224+ set (ENABLED_OPTIONS "zlib" )
225+ if (USE_SYSTEM_MINIZIP)
226+ string (APPEND ENABLED_OPTIONS " minizip" )
227+ endif ()
228+ if (USE_OPENSSL_MD5)
229+ string (APPEND ENABLED_OPTIONS " libcrypto" )
230+ endif ()
231+
232+ # Expand out the xlsxwriter.pc file.
222233configure_file (dev/release/pkg-config.txt xlsxwriter.pc @ONLY )
223234
235+
224236# INCLUDES
225237# --------
226238enable_language (CXX )
Original file line number Diff line number Diff line change @@ -21,6 +21,14 @@ PYTESTFILES ?= test
2121VERSION = $(shell sed -n -e 's/.* LXW_VERSION \"\(.* \) \"/\1/p' include/xlsxwriter.h)
2222SOVERSION = $(shell sed -n -e 's/.* LXW_SOVERSION \"\(.* \) \"/\1/p' include/xlsxwriter.h)
2323
24+ ENABLED_OPTIONS = zlib
25+ ifdef USE_SYSTEM_MINIZIP
26+ ENABLED_OPTIONS += minizip
27+ endif
28+ ifdef USE_OPENSSL_MD5
29+ ENABLED_OPTIONS += libcrypto
30+ endif
31+
2432.PHONY : docs tags examples third_party
2533
2634# Build libxlsxwriter.
@@ -164,7 +172,11 @@ install: all
164172 $(Q ) mkdir -p $(DESTDIR )$(PREFIX ) /lib
165173 $(Q ) cp -R lib/* $(DESTDIR )$(PREFIX ) /lib
166174 $(Q ) mkdir -p $(DESTDIR )$(PREFIX ) /lib/pkgconfig
167- $(Q ) sed -e ' s|@PREFIX@|$(PREFIX)|g' -e ' s|@VERSION@|$(VERSION)|g' dev/release/pkg-config.txt > $(DESTDIR )$(PREFIX ) /lib/pkgconfig/xlsxwriter.pc
175+ $(Q ) sed -e ' s|@PREFIX@|$(PREFIX)|g' \
176+ -e ' s|@VERSION@|$(VERSION)|g' \
177+ -e ' s|@ENABLED_OPTIONS@|$(ENABLED_OPTIONS)|g' \
178+ dev/release/pkg-config.txt \
179+ > $(DESTDIR )$(PREFIX ) /lib/pkgconfig/xlsxwriter.pc
168180
169181# Simpler uninstall.
170182uninstall :
Original file line number Diff line number Diff line change @@ -7,4 +7,5 @@ Name: libxlsxwriter
77Description: A C library for creating Excel XLSX files
88Version: @VERSION@
99Cflags: -I${includedir}
10- Libs: -L${libdir} -lxlsxwriter -lz
10+ Libs: -L${libdir} -lxlsxwriter
11+ Requires.private: @ENABLED_OPTIONS@
You can’t perform that action at this time.
0 commit comments