NOTE: Project are discontinued and repository will be frozen. Use upstream plugin that started to be more usable that this one.
Alternative CMake support for Qt Creator.
Main differents from original CMakeProject plugin:
This functionality is not compatible with QtC Project View idea: Project View == Build System view. So, upstream accepts only changes that can be done via build system tools and API. CMake does not provide way to modify CMakeLists.txt and related files, add/remove/rename file to targets and so on. So such changes in plugin (different kinds of work arounds) will be dropped. But in my opinion: usability of IDE must be putted to first place. If some kind of WA that simplify work with CMake cab be implemented - it must be implemented.
This plugin is oriented to latest Git version of Qt Creator, sorry I use it and I have no time to support other stable versions.
Commit 9d8a419d107ae8219c84bc9178bfed76b94fa930 of the Qt Creator completely remove build using qmake
. So, instruction updated to build plugin with CMake.
If you have QtC binary installation that contains lib/cmake/QtCreator
and headers you should not do anything.
Otherwise, you must get full copy of the Qt Creator from the Git, build it and install to some prefix.
For example, all actions runs in directory /tmp/qt-creator
Take full Qt Creator source tree from Git:
git clone https://github.com/qtproject/qt-creator.git qt-creator
Create Qt Crator build tree:
mkdir qt-creator-build
cd qt-creator-build
Create shadow build:
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/opt/qtcreator-git \
-DCMAKE_PREFIX_PATH=/usr \
..
# CMAKE_PREFIX_PATH needed to point right location of the LLVM
Build and install it
cmake --build . -j 8 && \
sudo cmake --install . && \
sudo cmake --install . --component Devel
# Devel strongly are needed
tl_expected
packages, copy it manually
cp -a "$qtc_source/src/libs/3rdparty/tl_expected" "$PREFIX/include/qtcreator/src/libs/3rdparty/"
Also, refer to the next page for more details:
Change directory to /tmp/qt-creator
Take sources of CMakeProjectManager2 from repository
Create directory for shadow build:
mkdir cmakeprojectmanager2-build
cd cmakeprojectmanager2-build
Configure plugin:
cmake -DCMAKE_PREFIX_PATH="/opt/qtcreator-git" \
-DCMAKE_INSTALL_PREFIX="/opt/qtcreator-git" \
../cmakeprojectmanager2-git/
# CMAKE_PREFIX_PATH strogly needed if QtC installed to the non-default CMake prefix (/usr in most cases)
Build:
cmake --build . -j 8
Install
sudo cmake --install .
Restart Qt Creator, go to Help -> About plugins and turn off default CMakeProjectManager plugin.
cmakeprojectmanager2-git/CMakeLists.txt
, go to Projects layout (see left panel)-DCMAKE_PREFIX_PATH="/opt/qtcreator-git"
Now you can build plugin from Qt Creator.
Also, refer to the Qt Creator WiKi about plugins development:
Unsupported anymore. Sorry, just have no a time :-(
Actual tasks and todo can be looks at the Issue page: https://github.com/h4tr3d/cmakeprojectmanager2/issues
git format-patch <REVISION_SINCE> -- src/plugins/cmakeprojectmanager
REVISION_SINCE can be found via 'git log' by comments or Change-Id.
qtc-master
git am -p4 *.patch
master
, merge new changes and resolve conflicts