c55fb044a9 cmBuildNameCommand: Implement as free function
86bf1eef75 cmState: Support free function disallowed commands
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3688
In commit e374b9f1eb (FindMPI: Restore MPI_<LANG>_COMPILE_FLAGS as a
command-line string, 2018-09-10, v3.12.3~6^2) we tried to restore the
compile flags but accidentally inverted the arguments to `list(JOIN)`
causing both `MPI_<LANG>_COMPILE_FLAGS` and `MPI_<LANG>_COMPILE_OPTIONS`
to be empty.
Issue: #18349
The previous code did not count the number of virtual processors across
physical processors on SunOS.
Can handle the following situations:
```
$ uname -a
SunOS solaris 5.11 11.4.0.15.0 i86pc i386 i86pc
$ psrinfo -p -v
The physical processor has 1 virtual processor (0)
x86 (GenuineIntel 306D2 family 6 model 61 step 2 clock 3492 MHz)
Intel Core Processor (Broadwell)
The physical processor has 1 virtual processor (1)
x86 (GenuineIntel 306D2 family 6 model 61 step 2 clock 3492 MHz)
Intel Core Processor (Broadwell)
The physical processor has 1 virtual processor (2)
x86 (GenuineIntel 306D2 family 6 model 61 step 2 clock 3492 MHz)
Intel Core Processor (Broadwell)
The physical processor has 1 virtual processor (3)
x86 (GenuineIntel 306D2 family 6 model 61 step 2 clock 3492 MHz)
Intel Core Processor (Broadwell)
```
```
$ uname -a
SunOS sol11x86 5.11 11.0 i86pc i386 i86pc
$ psrinfo -p -v
The physical processor has 2 virtual processors (0 1)
x86 (GenuineIntel 50650 family 6 model 85 step 0 clock 2000 MHz)
Intel(r) Xeon(r) Gold 6138 CPU @ 2.00GHz
```
```
$ uname -a
SunOS sol11 5.11 11.0 sun4v sparc sun4v
$ psrinfo -p -v
The physical processor has 2 cores and 16 virtual processors (0-15)
The core has 8 virtual processors (0-7)
The core has 8 virtual processors (8-15)
SPARC-T4 (chipid 0, clock 2848 MHz)
```
Following commit 49cfd390 (cmExportBuildFileGenerator: improve error
message, 2019-06-26), improve the error message related to installed
export sets by referencing the files which contain the exported target
ambiguously.
Backslashes in `CUDA_NVCC_INCLUDE_DIRS` cause syntax errors because it
is written to a generated `.cmake` script as a string literal. Use a
bracket argument to hold the expanded value as we already do for
`CUDA_NVCC_COMPILE_DEFINITIONS`. Then explicitly convert backslashes to
forward slashes.