I built Slicer from source in debug mode. Now I’m trying to work with Slicer as with usual project but Qt creator can’t see any execution file and moreover header files are inactive like in the picture below:
set SLICER_SOURCE_DIR="C:/S/Slicer"
set SLICER_BIN_DIR="C:/S/d"
set SLICER_QMAKE_EXE="C:/Qt/5.14.2/msvc2017_64/bin/qmake.exe"
set CMAKE_EXE="C:/Qt/Tools/CMake_64/bin/cmake.exe"
set CTEST_EXE="C:/Qt/Tools/CMake_64/bin/ctest.exe"
mkdir %SLICER_BIN_DIR%
cd /d %SLICER_BIN_DIR%
%CMAKE_EXE% %SLICER_SOURCE_DIR% -G Ninja -DQT_QMAKE_EXECUTABLE:PATH=%SLICER_QMAKE_EXE% -DSlicer_USE_PYTHONQT_WITH_OPENSSL:BOOL=ON ^
-DSlicer_USE_SimpleITK:BOOL=OFF ^
-DQt5_DIR="C:/Qt/5.14.2/msvc2017_64/lib/cmake/Qt5" ^
-DCMAKE_BUILD_TYPE=Debug ^
-DCMAKE_INSTALL_PREFIX=C:/S/i
I tried to use stable release with git checkout v4.11.20200930 but the problem occurs when building LibArchive. It is discussed here LibArchive build errors
Thus I’m working with master branch.
I have not tried VS 2019 and Qt 5.15.1 as my other project uses VS2017 and Qt 5.14.2
I can try to rebuild Slicer with VS 2019, Qt 5.15.1 (or even Qt 5.15.2) but what to do with LibArchive? Should I still use master branch or 4.11.20200930 git tag? Or maybe I will not encounter such problem with VS 2019
and with MSVC 2019 Qt 5.15.2 it doesn’t give platform plugin error anymore. That is good. After I press ENTER nothing happens. THose two lines in CMD are shown.
Thank you a lot! Finally when I 99 % followed the instructions from here (previously I used to build it with Ninja and now I’ve built it with VS 2019 x64 build system) I could launch Slicer from VS 2019 and stop it at a break point in debug mode.
As I don’t really like writing code in VS I’m going to download and try to use VS code. If there is something that I should know about this idea, please notify me
By the way now there is no any errors when I launch Slicer as it used to be earlier.
@SteveLiu QtCreator doesn’t support intellisense and other staff for cmake superbuild projects (I as I know).
How I use QtCreator with Slicer:
Slicer may build extensions along. (or you can find any and build it externally by yourself).
Extension is a complete cmake project that you can open with QtCreator.
Extension needs to find_package(Slicer) and usually it uses some headers from Slicer #include <qSlicer...>.
If you open an extension in QtCreator then you will see that intellisense work fine there (probably if the extension doesn’t use Superbuild).
Also if you then open Slicer source files while the extension is an active project in QtCreator than you will find that intellisense also work for Slicer (probably not as good as for regular project but it is pretty enough).
To make a little easier I prefer switching the mode of a tree view in left upper corner: from Projects to Files system so that there is no greyer-out header and source files