0

Is Cmake supported in QNX 6.5?

I have a Linux platform code which uses cmake. I need to port this to QNX.

user3768448
  • 5
  • 1
  • 7
  • What is wrong in reading [README](https://github.com/Kitware/CMake/blob/master/README.rst), which doesn't note QNX among supported platforms? See also bugreport about that support: https://gitlab.kitware.com/cmake/cmake/issues/16965. Note, that you still may build the code for QNX with using cross-compilation. – Tsyvarev Oct 23 '18 at 12:17

2 Answers2

2

You can use CMake, but you will need a CMake toolchain file. Here's an example one I use with QNX 6.5 with an updated compiler (GCC 4.8.3) - you will need to adjust the architecture and remove the C++11 flag, if you are using the original compiler:

set(CMAKE_SYSTEM_NAME QNX)

set(arch gcc_ntox86_gpp)
set(ntoarch x86)
set(QNX_PROCESSOR x86)

set(CMAKE_C_COMPILER qcc)
set(CMAKE_C_COMPILER_TARGET ${arch})

set(CMAKE_CXX_COMPILER qcc -lang-c++)
set(CMAKE_CXX_COMPILER_TARGET ${arch})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wc,-std=c++11")

set(CMAKE_ASM_COMPILER qcc -V${arch})
set(CMAKE_ASM_DEFINE_FLAG "-Wa,--defsym,")

set(CMAKE_RANLIB $ENV{QNX_HOST}/usr/bin/nto${ntoarch}-ranlib
    CACHE PATH "QNX ranlib Program" FORCE)
set(CMAKE_AR $ENV{QNX_HOST}/usr/bin/nto${ntoarch}-ar
    CACHE PATH "QNX qr Program" FORCE)
Lubo Antonov
  • 2,301
  • 14
  • 18
0

Cmake works very fine when targeting QNX 7.0. I believe it works also in QNX 6.5.