Στις 18/12/2018 15:40, ο Massimo Manghi έγραψε:
Automake generated Makefile uses a clever way to generate the Rivet's packages index by running tclsh and pkg_mkIndex within the 'install' target of the Makefile. CMakeList.txt doesn't provide the same feature and in principle pure CMake builds, where version numbers change, end up installing a wrong pkgIndex.

We could probably agree on a different approach requiring the repository to always store a consistent pkgIndex.tcl file by moving the index generation in a specialized Makefile target (we do provide binary packages too whose version number is stored in rivet_config.h). This target could be run every time some version number (Rivet's own version number included) changes. I know it's not automatic, but it's not a frequent event either. I don't know if this target can be replicated in CMAke but it's probably useless to try to implement it provided we take care to keep pkgIndex.tcl consistent, no matter how it was generated.

 -- Massimo

Dear Massimo,

I have committed an update to CMakeLists.txt (master branch), which:
1) After libs have been installed, writes a file "regenerate_pkgIndex.tcl", inside the installation directory.
2) Puts in the file:
"puts \"Regenerating pkgIndex.tcl in [pwd]:\"
file delete {*}[glob [file join packages * pkgIndex.tcl]] pkgIndex.tcl
pkg_mkIndex -verbose [pwd] init.tcl \\
      {*}[glob [file join packages * *.tcl] \\
      [file join ${RIVET_LIBS_ARCH} *[info sharedlibextension]]]"
3) Executes the file with tclsh (it will break if tclsh is not found during configuration)
4) Deletes the file.

I have replaced "eval" with "{*}". Eval will break if paths contain spaces (very common in Windows). "{*}" will break in old tcl versions (I do not remember when it was introduced).

*I do not know what it should be put in RIVET_LIBS_ARCH*.

Best,

George

Reply via email to