The CXX compiler identification is unknown building cross compile for Arm processor

Hi,
I am trying to cross compile code for ARM processor on Linux.
Downloaded GNU Arm toolchain from Arm and able to build a sample C , C++ code directly.

But when I am trying to cross compile for ARM using Cmake, running into error “The CXX compiler identification is unknown” and it fails building.

I created a toolchain cmake file with following information and calling on top of my CMakeLists.txt above project () with LANGUAGES set to C CXX.
I also tried setting env variables “CC” and “C” to cross compiler executable path. But same error.

set(CMAKE_SYSTEM_NAME Linux)
#set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_SYSTEM_PROCESSOR armv8-a)
set(tools /arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-linux-gnu)
set(CMAKE_C_COMPILER ${tools}/bin/aarch64-none-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER ${tools}/bin/aarch64-none-linux-gnu-g++)
set(CMAKE_CXX_COMPILER_ID GNU)
set(CMAKE_CXX_COMPILER_VERSION 14.2.1)
message( STATUS “toolchain cmake processor:${CMAKE_SYSTEM_PROCESSOR}” )
message( STATUS “toolchain C compiler:${CMAKE_C_COMPILER}” )
message( STATUS “toolchain C++ compiler:${CMAKE_CXX_COMPILER}” )
message( STATUS “toolchain C++ compilerID:${CMAKE_CXX_COMPILER_ID}” )
message( STATUS “toolchain C++ compiler version:${CMAKE_CXX_COMPILER_VERSION}” )

Output from build

– Defaulting build type to Release
– toolchain cmake processor:armv8-a
– toolchain C compiler:/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc
– toolchain C++ compiler:/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++
– toolchain C++ compilerID:GNU
– toolchain C++ compiler version:14.2.1
– The C compiler identification is unknown
– The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:67 (project):
The CMAKE_C_COMPILER:

/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc

is not a full path to an existing compiler tool.

Tell CMake where to find the compiler by setting either the environment
variable “CC” or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.

Contents from CMakeError.log
Compiling the C compiler identification source file “CMakeCCompilerId.c” failed.
Compiler: /arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc
Build flags:
Id flags:

The output was:
No such file or directory

Compiling the C compiler identification source file “CMakeCCompilerId.c” failed.
Compiler: /arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc
Build flags:
Id flags: -c

The output was:
No such file or directory

Compiling the C compiler identification source file “CMakeCCompilerId.c” failed.
Compiler: /arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc
Build flags:
Id flags: -Aa

The output was:
No such file or directory

Compiling the C compiler identification source file “CMakeCCompilerId.c” failed.
Compiler:/arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-gcc
Build flags:
Id flags: -D__CLASSIC_C__

The output was:
No such file or directory

Checking whether the C compiler is IAR using “” did not match “IAR .+ Compiler”:
Compiling the CXX compiler identification source file “CMakeCXXCompilerId.cpp” failed.
Compiler: /arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++
Build flags:
Id flags:

The output was:
No such file or directory

Compiling the CXX compiler identification source file “CMakeCXXCompilerId.cpp” failed.
Compiler: /arm-gnu-toolchain-14.2.rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-g++
Build flags:
Id flags: -c

The output was:
No such file or directory

Checking whether the CXX compiler is IAR using “” did not match “IAR .+ Compiler”: