1 2if("$ENV{QNX_HOST}" STREQUAL "") 3 message(FATAL_ERROR "QNX_HOST environment variable not found. Please set path to your QNX SDP installation") 4endif() 5 6if("$ENV{QNX_TARGET}" STREQUAL "") 7 message(FATAL_ERROR "QNX_TARGET environment variable not found. Please set QNX target path") 8endif() 9 10if("$ENV{PROCESSOR}" STREQUAL "") 11 message(FATAL_ERROR "PROCESSOR variable not found. This variable should be set in the Makefile at CPU level (ie: nto/aarch64/Makefile)") 12endif() 13 14if("$ENV{VARIANT}" STREQUAL "") 15 message(FATAL_ERROR "VARIANT variable not found. This variable should be set in the Makefile at VARIANT level (ie: nto/aarch64/le/Makefile)") 16endif() 17 18message(STATUS "using QNX_HOST $ENV{QNX_HOST}") 19message(STATUS "using QNX_TARGET $ENV{QNX_TARGET}") 20message(STATUS "cpu=$ENV{PROCESSOR}") 21message(STATUS "variant=$ENV{VARIANT}") 22 23set(QNX true) 24set(CMAKE_SYSTEM_NAME QNX) 25add_definitions("-D_QNX_SOURCE") 26 27set(GENERATE_PINFO_FILES $ENV{GENERATE_PINFO_FILES}) 28 29set(target gcc_nto$ENV{VARIANT}) 30set(ntoarch $ENV{VARIANT}) 31set(processor $ENV{PROCESSOR}) 32set(CMAKE_C_COMPILER qcc) 33set(CMAKE_C_COMPILER_TARGET ${target}) 34set(CMAKE_CXX_COMPILER qcc -lang-c++) 35set(CMAKE_CXX_COMPILER_TARGET ${target}) 36set(CMAKE_ASM_COMPILER qcc -V${target}) 37set(CMAKE_RANLIB $ENV{QNX_HOST}/usr/bin/nto${processor}-ranlib CACHE PATH "QNX ranlib Program" FORCE) 38set(CMAKE_AR $ENV{QNX_HOST}/usr/bin/nto${processor}-ar CACHE PATH "QNX ar Program" FORCE) 39set(CMAKE_SYSROOT $ENV{QNX_TARGET}) 40set(CMAKE_CXX_STANDARD 20) 41