Created attachment 171 [details] Fixes architecture.gmk for G4LIB_USE_ZLIB cmake -DGEANT4_USE_SYSTEM_ZLIB="ON" does not define G4LIB_USE_ZLIB in cpp flags and thus libG4visHepRep.so is build without zlib compression support. In order to fix this, the following attached patches need to be applyed. (see next attachments) geant4.9.5.p01_zlib.patch: fixes architecture.gmk (not realy related to cmake, but usefull anyway) (taken and adapted from gentoo packaging patches here: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sci-physics/geant/files/geant-4.9.3-zlib.patch?hideattic=0&view=log) geant-4.9.4-zlib.patch: fixes HepRep/sources.cmake replace hardcoded G4zlib by ${ZLIB_LIBRARIES} created from FindZLIB.cmake Note: needs to populate ZLIB_LIBRARIES with G4zlib if we are not using external ZLIB (patch not provided (need to be done)) Patch taken from gentoo build here: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sci-physics/geant/files/geant-4.9.4-zlib.patch?hideattic=0&view=log geant4.9.5.p01_zlibflag.patch: fixes build of geant4.9.5.p01/source/visualization/HepRep/src/G4HepRepSceneHandler.cc line 209. cmake build system does not define -DG4LIB_USE_ZLIB, thus even if the link is done with the correct zlib, this zlib is not used this patch adds "add_definitions(-DG4LIB_USE_ZLIB)" to Geant4OptionalComponents.cmake . this patch was done by me and I'm not sure this is the correct way to do things. and this flag is only related to G4HepRepSceneHandler.cc, maybe there are better places to do this.
Created attachment 172 [details] replace hardcoded G4zlib by ${ZLIB_LIBRARIES} in HepRep/sources.cmake replace hardcoded G4zlib by ${ZLIB_LIBRARIES} needs to put G4zlib in ZLIB_LIBRARIES if ZLIB_FOUND is false
Created attachment 173 [details] add_definitions(-DG4LIB_USE_ZLIB) so G4HepRepSceneHandler.cc uses zlib add_definitions(-DG4LIB_USE_ZLIB) so G4HepRepSceneHandler.cc builds using zlib. May need to be located in HepRep/source.cmake instead of Modules/Geant4OptionalComponents.cmake But as I'm ultra newbee in cmake, this is just a supposition. This is a prework that surely needs attention.
Thanks for the patches - note that the system vs internal libraries interface will be updated for consistent use in 9.6, but this will not make it into the beta for 9.6. It will however appear in the release later this year. The same goes for the related Bug #1291.
Great! tanks a lot for your work. The move toward cmake vs proprietary configure script was a big step, especially for the rpm packager I am. Keep up the good work guys :-)
Apologies for the delay in fixing this - we have also re-organized the use of internal/external packages, so it took a little longer than it should... Fixed in tags cmake-V09-06-07 vis-HepRep-V09-06-05 These should make it into the next patch of 9.6, possibly into the next patch of 9.5. Thanks again for the report and patches!