Print

Print


This patch enable user/packager to override operating-system-related default values such as `CMAKE__INSTALL_BINDIR`.

With the use of `GNUInstallDirs` module, package maintainers of `Linux`, `kFreeBSD` and `GNU` can override those values through `-DCMAKE_INSTALL_BINDIR=my/custom/path`. However, for OSes such as `MacOSX`, `FreeBSD` and `Solaries`, those "default" values are hard-coded and unchangeable without modifying the source code. This has already cause problem to [the Nix package](https://github.com/NixOS/nixpkgs/pull/160102#issuecomment-1041113327).

In `GNUInstallDirs`, those values are set after the prior definition are explicitly checked, E.g.

```CMake
if(NOT DEFINED CMAKE_INSTALL_BINDIR)
  set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)")
endif()
```

which is quite lengthy. Fortunately, we already have `define_default` macro defined in [`XRootDUtils`](https://github.com/xrootd/xrootd/blob/0e460d7a11702c9935ed9fc1c67f22cb998b6fa4/cmake/XRootDUtils.cmake#L11-L15) that does exactly the same thing.

This patch makes use of `define_default` to make those default values overridable.
You can view, comment on, or merge this pull request online at:

  https://github.com/xrootd/xrootd/pull/1619

-- Commit Summary --

  * [CMake] XRootDOSDefs: Use define_default on default values

-- File Changes --

    M cmake/XRootDOSDefs.cmake (36)

-- Patch Links --

https://github.com/xrootd/xrootd/pull/1619.patch
https://github.com/xrootd/xrootd/pull/1619.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/xrootd/xrootd/pull/1619
You are receiving this because you are subscribed to this thread.

Message ID: <[log in to unmask]>

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1