pFUnit
pFUnit copied to clipboard
Fix installation location and layout
The documentation in the README says that if -DCMAKE_INSTALL_PREFIX is not set then it will default to /usr/local/. However, in reality it defaults to build/installed. Furthermore, the layout of the installation directory is that of a Windows system rather than a Linux one. While cmake can cope with this easily enough, it would be nice if a unix-like installation could be done when running on Linux.
Sorry - for the delayed response. Yes - the documentation is out-of-date and I'll immediately go fix this aspect after this response. Unfortunately, the cmake defaults are very impractical for many science developers as they lack permissions to install in /usr/local, which is why the applications overrides that by default.
The adoption of a Windows-like installation was unintentional, and I did not even notice that until you pointed it out. (Indeed, I never use windows and only support it via contributions from users.) While troubleshooting my initial attempt to properly support find_package(), this was simply the first combination that I got working. (I think I had glossed over some issues about capitalization of the project name that was causing me to randomly try things.)
Going forward, it would seem the best option would be to use one of the options that are indicated for both Unix and Windows:
<prefix>/<name>*/(lib/<arch>|lib*|share)/cmake/<name>*/ (W/U)
<prefix>/<name>*/(lib/<arch>|lib*|share)/<name>*/ (W/U)
<prefix>/<name>*/(lib/<arch>|lib*|share)/<name>*/(cmake|CMake)/ (W/U)
If you have a specific preference, let me know. (Or feel free to contribute a pull request.) Otherwise, I'll probably lean towards the middle one with "share" in the path. Now just need to decide whether or not this represents a backward compatibility ...
Still on my list to address this, but it probably won't make it into v4.1.
I know this is rather late but would include(GNUInstallDirs) be of any help here? https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html has details on usage. I've had reasonable success using it when packaging under Linux, Windows, and OSX.