Test FindPackageModeMakefileTest fails in 64bit on systems where CXXFLAG is required, like AIX
On AIX, when testing with GCC/XLC in 32bit, this test is OK.
However, when testing in 64bit, one has to add either CXXFLAGs=-maix64 (GCC) or CXXFLAGS=-q64 (XLC), but the code of the test does not manage CXXFLAGS (nor CFLAGS), and the test fails complaining about wrong (32bit) assembler generated code (because : "export OBJECT_MODE=64" was used for AIX tools like "ld") :
469: "/usr/bin/g++" -D_LARGE_FILES -DSYSV -D_AIX -D_ALL_SOURCE -DFUNCPROTO=15 -D_AIX71 -D_AIX72 -mcmodel=large -pthread \ -I$BUILD/cmake-3.14.2/Tests/FindPackageModeMakefileTest -I"/some/path/with a space/include" -c main.cpp 469: Assembler: 469: /tmp//ccPwH5oE.s: line 8: Only .llong should be used for relocatable expressions. 469: /tmp//ccPwH5oE.s: line 61: Only .llong should be used for relocatable expressions.
This seems to be due to the ConfMakefile which does:
CMAKE_CXX_FLAGS = -D_LARGE_FILES -DSYSV -D_AIX -D_ALL_SOURCE -DFUNCPROTO=15 -D_AIX71 -D_AIX72 -mcmodel=large -pthread CMAKE_FOO = $(CMAKE) --find-package -DCMAKE_MODULE_PATH=$(CMAKE_CURRENT_BINARY_DIR) -DNAME=Foo -DLANGUAGE=CXX -DCOMPILER_ID=$(CMAKE_CXX_COMPILER_ID)
and which does not handle CXXFLAGS variable that was correctly exported in the test script, like:
export CFLAGS=-maix64 export CXXFLAGS=-maix64 ./bin/ctest -VV -R FindPackageModeMakefileTest "--build-options" "-DCMAKE_C_FLAGS=-maix64" "-DCMAKE_CXX_FLAGS=-maix64"