CMake configure error when cross-compiling for QNX
Submitted by Antonio El Khoury
Assigned to Nobody
Link to original bugzilla bug (#1467)
Version: 3.3 (current stable)
Operating system: Other UNIX-like
Description
Created attachment 795
CMake configure log.
I tried to cross-compile eigen 3.3.4 from Ubuntu 14.04 to QNX 6.5.0 using the qcc compiler (which is based on a gcc 4.4.2).
During the CMake configure step, I get an error related to the fact that qcc does not support the argument --version
(See qcc doc here http://www.qnx.com/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.neutrino_utilities%2Fq%2Fqcc.html)
I managed to pull through using this patch, but it's definitely not a clean one:
diff -ru eigen3.orig/cmake/EigenTesting.cmake eigen3/cmake/EigenTesting.cmake
--- cmake/EigenTesting.cmake 2017-09-14 17:34:34.622709508 +0200
+++ cmake/EigenTesting.cmake 2017-09-14 17:36:30.378710602 +0200
@@ -550,7 +550,12 @@
execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${EIGEN_CXX_FLAG_VERSION}
OUTPUT_VARIABLE eigen_cxx_compiler_version_string OUTPUT_STRIP_TRAILING_WHITESPACE)
- string(REGEX REPLACE "[\n\r].*" "" eigen_cxx_compiler_version_string ${eigen_cxx_compiler_version_string})
+ if(${CMAKE_SYSTEM_NAME} STREQUAL QNX)
+ # Hardcode version.
+ set(eigen_cxx_compiler_version_string 4.4.2)
+ else()
+ string(REGEX REPLACE "[\n\r].*" "" eigen_cxx_compiler_version_string ${eigen_cxx_compiler_version_string})
+ endif()
ei_get_compilerver_from_cxx_version_string("${eigen_cxx_compiler_version_string}" CNAME CVER)
set(${VAR} "${CNAME}-${CVER}")
Attachment 795, "CMake configure log.":
configure.log