why is this happening
Macros unix and linux are legacy defined to 1 on UNIX platforms.
Part of the program /path/x86-unix/linux/pat consists of tokens unix and linux, so as part of macro expansion in xstr these macros are substituted for 1.
how I can prevent it?
#undef linux and unix macros. Or disable gnu extensions, for example, use c11 standard. With GCC compiler on Linux:
$ gcc  -E -dM - </dev/null | grep linux
#define __linux 1
#define __gnu_linux__ 1
#define linux 1  // here it is
#define __linux__ 1
$ gcc -std=c11 -E -dM - </dev/null | grep linux
#define __linux 1
#define __gnu_linux__ 1
#define __linux__ 1
// now there's no #define linux
how I can prevent it?
I load a path name with cmake and want to use as a string in my C++ program
Adapting example from Example section from CMake documentation of configure_file, create a file named my_path.h.in with content:
#cmakedefine MY_PATH "@MY_PATH@"
Add the following to your cmake configuration:
set(MY_PATH "/path/x86-unix/linux/path") 
# Generate the file
configure_file(my_path.h.in
    ${CMAKE_CURRENT_BINARY_DIR}/generated/my_path.h
    ESCAPE_QUOTES
    @ONLY
)
# add the path to your target
target_include_directories(your_target
    PUBLIC_or_PRIVATE
    ${CMAKE_CURRENT_BINARY_DIR}/generated
)
And use #include <my_path.h> in your program to get MY_PATH definitions.
I see no reason to use a macro - maybe it would be better to do static const char MY_PATH[] = "@MY_PATH@"; instead.
I load a path name with cmake
 add_definitions(-DMY_PATH =${CMAKE_INSTALL_FULL_DATADIR}/path)
Do not use add_definitions. Prefer target_compile_definitions instead. See CMake add_definitions documentations.
As a crude workaround, you can add quotes, assuming the shell and compiler will properly parse them:
target_compile_definitions(your_target PRIVATE 
    MY_PATH="${CMAKE_INSTALL_FULL_DATADIR}/path"
)
(Note that quotes in the above are preserved literally and passed to the compiler (or build system). CMake quoting does not work like shell quoting. In CMake language, to quote a word, quotes " have to be exactly the first and last characters of the word. If one of them is  in the middle, they are interpreted literally)
However, I think using configure_file would be preferred, because of ESCAPE_QUOTES.