I am trying to use cmake to build a very simple app with QNX toolchain. I can build it with qcc command line without any problem, but if I using cmake, it always show this error. Does anyone know how to solve it? Thanks!
QNX SDK: v7.1 cmake: v3.21.1
[ 50%] Building CXX object CMakeFiles/hello.dir/src/testhello.cpp.o
cc: Can't specify -P, -C, -E, -c or -S with -o and have multiple files
CMakeFiles/hello.dir/build.make:75: recipe for target 'CMakeFiles/hello.dir/src/testhello.cpp.o' failed
make[2]: *** [CMakeFiles/hello.dir/src/testhello.cpp.o] Error 1
CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/hello.dir/all' failed
make[1]: *** [CMakeFiles/hello.dir/all] Error 2
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2
The link is the cmake manual related to QNX https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#id16
I also try cmake in qnx supported?? Porting from Linux to QNX but doesn't work, too
cmake_minimum_required(VERSION 3.14)
project(test)
set(CMAKE_SYSTEM_NAME QNX)
set(arch gcc_ntoaarch64le_gpp)
set(ntoarch aarch64le)
set(QNX_PROCESSOR aarch64le)
set(CMAKE_C_COMPILER qcc)
set(CMAKE_C_COMPILER_TARGET ${arch})
set(CMAKE_CXX_COMPILER q++)
set(CMAKE_CXX_COMPILER_TARGET ${arch})
#set(CMAKE_SYSROOT $ENV{QNX_TARGET})
add_executable ( hello src/testhello.cpp )