I’m trying to build CMake v2.0.5 (a cross platform build system) on QNX 6.3 (a platform not known to be supported) and with a bit of fiddling around I can get it to build fine, but then when I try to run any of the executables I get this:
/bin/sh: ./cmake: Attempting to exec a shared lib
Any advice or ideas are welcome.
I ran into the exact problem you are seeing. The fix is to define a new QNX.cmake platform module (in the Modules/Platform directory):
IF(CMAKE_C_COMPILER MATCHES [Qq]cc)
SET (CMAKE_C_FLAGS_INIT "-w9")
SET (CMAKE_C_FLAGS_DEBUG_INIT "-w9 -g")
SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-w9 -Wc,-Os")
SET (CMAKE_C_FLAGS_RELEASE_INIT "-w9 -Wc,-O3")
ENDIF(CMAKE_C_COMPILER MATCHES [Qq]cc)
IF(CMAKE_CXX_COMPILER MATCHES [Qq]cc)
SET (CMAKE_CXX_FLAGS_INIT "-w9")
SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-w9 -g")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-w9 -Wc,-Os")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-w9 -Wc,-O3")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-w9 -g -Wc,-O2")
SET (CMAKE_CXX_FLAGS "-Y _cpp")
ENDIF(CMAKE_CXX_COMPILER MATCHES [Qq]cc)
I actually managed to build it yesterday by adding the following QNX.cmake file:
But with that I also had to modify 6 source files to get it to compile. Did you have any such problems? If not, it may be because your QNX.cmake is more correct? Mine is basically a hack of linux.cmake. I’ll test out yours next time I’m near my QNX machine, but in the mean time if you have any further comments I’d appreciate it.
Also, of interest what version of QNX and gcc were you using?
Running QNX 6.2.1
I’m in the middle of putting together a CMake-2.0.5.qpr package. I would also like to submit my changes to the CMake guys so it can become part of the normal CMake distribution. I’ll post something here when I get the qpr file built
A qpr package sounds good for the latest CMake release. I’ve actually submitted my changes to the CMake CVS and now have daily experimental builds being submitted to their dashboard for verification that it continues to work under QNX with any changes to CMake. You may want to try checking out their CVS version and trying it under QNX to see if it works.