The standard way of cmake install to a destination folder is the following pattern:
```shell
cd <BUILD_DIR>
cmake <SRC_DIR>
cmake --build <BUILD_DIR>
cmake --install <BUILD_DIR> --prefix <INSTALL_DIR>
```
Right now, the `<INSTALL_DIR>` folder passed in cmake --install command is ignored,
and always installed into `C:/Program Files(x86)/...`, which is the default
`CMAKE_INSTALL_PREFIX` value passed at the `cmake <SRC_DIR>` call.
Thus, it is not possible to install the binaries into different folders
without rerun the cmake/build process.
The important thing here is, the cmake variable `CMAKE_INSTALL_PREFIX`
is supposed to be passed at `cmake --install` time with the `--prefix` argument.
In cmake file, `install` with relative path will use that prefix automaticlly.
And it is the best practice to not include CMAKE_INSTALL_PREFIX
in the `install(... DESTINATION )` argument:
```
In particular, there is no need to make paths absolute by prepending
CMAKE_INSTALL_PREFIX; this prefix is used by default if the DESTINATION is a relative path.
```
referenced from: https://cmake.org/cmake/help/latest/command/install.html
Currently warnings / errors are enabled by default in debug build.
Otherwise they could be enabled only via environmental variable or
API option call. Add possibility to specify the default during the
build time. This simplifies e.g. integration of the library into
bigger projects as no source changes would be required.
xmalloc is a non-standard extension forcing malloc() to
abort should the memory allocation failed instead of returning a
null pointer. Such functionality is quite useful as it provides one
single point of error handling if the caller of malloc() does not
check the result (as it often does!) and segfault is ocurring somewhere
else. If more fine-grained control is necessary one could register a custom
error handler, however, this might not be an option while interposing.