brechtsanders / xlsxio

XLSX I/O - C library for reading and writing .xlsx files
MIT License
417 stars 112 forks source link

Feature Request: Support Compiling Entirely from Source #34

Closed webern closed 6 years ago

webern commented 6 years ago

Embed minizip and expat sourcecode (licenses are permissive) and build everything from source using Cmake. Use a flag in Cmake for the user to choose between building entirely from source vs. using FIND_PACKAGES. For those use-cases where the runtime environment is not controllable or known, it should be possible to create a binary that does not rely on the installation and runtime linking of these installed packages.

brechtsanders commented 6 years ago

I'm actually building exatly like that, but I set environment to use my build firsts by setting C_INCLUDE_PATH / CPLUS_INCLUDE_PATH / LD_RUN_PATH / LIBRARY_PATH Are you requesting I make a specific CMake variable for the packages used?

webern commented 6 years ago

I'm suggesting that someone who wants to should be able to change something in the Cmake file from NO to YES (i.e. BUILD_FROM source), and have it 'just work' without any environment variables or external requirements, which means that the expat and minizip sourcecode libs would be checked in to the xlsxio repo.

brechtsanders commented 6 years ago

I have always thought projects that pull in (or even ship) sources like that are quite dirty. It seams cleaner to me to use stable builds either provided by the distro or built yourself in a seperate location. For the latter it would make more sence to add a variable like EXPATPATH where expat is searched for by looking into the include and lib folder. Would that suit you?

yannou38 commented 6 years ago

i'd love the former and would be okay with the later. Currently trying to make this and it can't find the minizip i built in a separate location and i had to edit the makefile manually for it to work.

EDIT : if you go with the later make sure to get a path for both expat and minizip. also, the former may not be that bad because as you don't have control over the version of the dependencies that are installed, the build could totally fail. if you have them locally you have control over their version and the build pass.

brechtsanders commented 6 years ago

Which platform are you on? If you're on Linux there is a large change your distro will have minizip. If you're on Windows I can actually send you my packages built with MinGW-w64. If you're on macOS I would recommend https://www.macports.org/.

yannou38 commented 6 years ago

managed to install it by editing the makefile and adding manually the minizip lib and include locations. distros where i am are very light and don't have much on them. that's why adding the dependencies in your releases can be useful, or at least the custom paths in your makefile.

brechtsanders commented 6 years ago

added CMake options to specify custom dependancy paths: ZLIB_DIR/MINIZIP_DIR/LIBZIP_DIR/EXPAT_DIR now updated in subversion, will be included in next release