CentOS 8 qt-creator build from source
-
CentOS 8.3
Qt 5.12
Qt Creator 4.12Recently, CentOS 8 updated it's version of clang from 9 to 10, which breaks dependencies for qt-creator. I'm trying to build qt-creator from source so it will look to the new version of clang, but I'm getting errors trying to build. Here's what I'm doing:
git clone --recursive {address of qt-creator} cd qt-creator git checkout 4.12I then create a build directory and run cmake:
cd ../ && mkdir build cd build cmake ../qt-creatorI get the following errors:
CMake Error at src/libs/clangsupport/CMakeLists.txt:184 (file): file does not recognize sub-command READ_SYMLINK CMake Error at src/libs/clangsupport/CMakeLists.txt:186 (install): install PROGRAMS given directory "/usr/bin/" to install. CMake Error at src/libs/clangsupport/CMakeLists.txt:184 (file): file does not recognize sub-command READ_SYMLINK CMake Error at src/libs/clangsupport/CMakeLists.txt:186 (install): install PROGRAMS given directory "/usr/bin/" to install.and it refuses to build.
Some research shows that maybe READ_SYMLINK was added in a later version of CMAKE, but I'm using CMAKE 3.11 and the minimum required version in the CMakeList.txt is 3.9.
I tried deleting the offending lines. That at least allows the project to start building, however it fails here:
Scanning dependencies of target ClangFormat [ 43%] Building CXX object src/plugins/clangformat/CMakeFiles/ClangFormat.dir/clangformatbaseindenter.cpp.o [ 43%] Building CXX object src/plugins/clangformat/CMakeFiles/ClangFormat.dir/clangformatconfigwidget.cpp.o [ 43%] Building CXX object src/plugins/clangformat/CMakeFiles/ClangFormat.dir/clangformatindenter.cpp.o [ 43%] Building CXX object src/plugins/clangformat/CMakeFiles/ClangFormat.dir/clangformatplugin.cpp.o /usr/local/src/qt-creator/src/plugins/clangformat/clangformatplugin.cpp:156:2: warning: #warning ClangFormat: building dummy plugin due to unmodified Clang, see README.md for more info [-Wcpp] #warning ClangFormat: building dummy plugin due to unmodified Clang, see README.md for more info ^~~~~~~ [ 43%] Building CXX object src/plugins/clangformat/CMakeFiles/ClangFormat.dir/clangformatsettings.cpp.o [ 43%] Building CXX object src/plugins/clangformat/CMakeFiles/ClangFormat.dir/clangformatutils.cpp.o [ 43%] Building CXX object src/plugins/clangformat/CMakeFiles/ClangFormat.dir/ClangFormat_autogen/mocs_compilation.cpp.o [ 43%] Linking CXX shared library ../../../lib/qtcreator/plugins/libClangFormat.so /usr/bin/ld: cannot find -lclangFormat collect2: error: ld returned 1 exit status make[2]: *** [src/plugins/clangformat/CMakeFiles/ClangFormat.dir/build.make:190: lib/qtcreator/plugins/libClangFormat.so] Error 1 make[1]: *** [CMakeFiles/Makefile2:5728: src/plugins/clangformat/CMakeFiles/ClangFormat.dir/all] Error 2 make: *** [Makefile:130: all] Error 2I looked through the README.md file, the only thing that stood out was
### Clang-Format The ClangFormat plugin depends on the additional patch https://code.qt.io/cgit/clang/clang.git/commit/?h=release_80-based&id=fa1b9053729ec6a4425a44ec5502dd388928274a While the plugin builds without it, it will be disabled on start with an error message. Note that the plugin is disabled by default.and my configuration certainly does not build without it.
It would be way easier if someone just fixed the version in the repo, but alas, I'm guessing the sh*tshow RH caused, no one is going to bother do it.