Skip to content

Check of minimal support compiler version for CMake itself

I tried to compile CMake-3.22.1 with gcc/4.4 with the following command:

cmake3 -H. -Bobjdir -DCMAKE_INSTALL_PREFIX=/opt/cmake/3.22.1

Configuration was successful.

Then, when compiling of Source/kwsys/CMakeFiles/cmsys.dir/Directory.cxx.o was, the compilation was failed with the following output:

In file included from /home/ger/build/cmake-3.22.1/objdir/Source/cmsys/Directory.hxx:7,
                 from /home/ger/build/cmake-3.22.1/Source/kwsys/Directory.cxx:4:
/home/ger/build/cmake-3.22.1/objdir/Source/cmsys/Status.hxx:61: error: only declarations of constructors can be ‘explicit’
/home/ger/build/cmake-3.22.1/objdir/Source/cmsys/Status.hxx:91: error: ISO C++ forbids initialization of member ‘Kind_’
/home/ger/build/cmake-3.22.1/objdir/Source/cmsys/Status.hxx:91: error: making ‘Kind_’ static
/home/ger/build/cmake-3.22.1/objdir/Source/cmsys/Status.hxx:91: error: ISO C++ forbids in-class initialization of non-const static member ‘Kind_’
/home/ger/build/cmake-3.22.1/objdir/Source/cmsys/Status.hxx: In constructor ‘cmsys::Status::Status(cmsys::Status::Kind)’:
/home/ger/build/cmake-3.22.1/objdir/Source/cmsys/Status.hxx:87: error: ‘cmsys::Status::Kind cmsys::Status::Kind_’ is a static data member; it can only be initialized at its definition
In file included from /home/ger/build/cmake-3.22.1/Source/kwsys/Directory.cxx:4:
/home/ger/build/cmake-3.22.1/objdir/Source/cmsys/Directory.hxx: At global scope:
/home/ger/build/cmake-3.22.1/objdir/Source/cmsys/Directory.hxx:38: error: ‘nullptr’ was not declared in this scope

I removed repeated errors.

The compilation command was:

/usr/bin/c++   -DKWSYS_NAMESPACE=cmsys -I/home/ger/build/cmake-3.22.1/objdir/Source -I/home/ger/build/cmake-3.22.1/objdir/Source/kwsys  -std=gnu++0x -o CMakeFiles/cmsys.dir/Directory.cxx.o -c /home/ger/build/cmake-3.22.1/Source/kwsys/Directory.cxx

GCC version:

$ gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-23) (GCC) 

Could someone, please, add checking of the minimal support compiler version?

Edited by Brad King
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information