0
votes

I am interested to import Itk-snap source code in Qt5.4. Based on their help I could built the executable itksnap in my system using cmake(3.4.1). Then, I have imported the Cmakelist.txt in Qt creator and pressed "run camke". It is configured successfully, but I cannot see the project file ( no main.cpp or any file in left panel)! , cannot build it because it does not loaded in Qt creator.

What do I do wrong? How can I have itksnap in my QT creator.

I am using OSX, and unix generator for camke.

2
You messing concepts. Qt is software framework, cmake is a build system. So you could not load cmakefiles in Qt. I suppose you are talking about QtCreator - IDE which can use cmake as a projectfiles. Please edit you question for better understanding what do you want to do.Jeka
@Jeka thank for hint, doneEhsan
Have you try to build it outside QtCreator? As I know cmake can generate xcode project files. Propably you will have to speccify Qt location via CMAKE_PREFIX_PATH. I mean to use ltk-snap with Qt project or build with Qt support you have no need to build it inside QtCreatorJeka
@Jeka, Yup i did. As I wrote above, I could build and make the binary file. Also I used CMAKE_PREFIX_PATH to give Qt5 path to cmake. Everything goes well till here. the problem is, after I open cmakelist.txt in qtcreator, I dont get any error and no file is loaded in Qt creator.Ehsan

2 Answers

0
votes

As I can understand you are trying to build cmake project using QtCreator as an IDE, if so have a look here http://doc.qt.io/qtcreator/creator-project-cmake.html

0
votes

Finally, I could find out what was wrong. For whoever is interested and have same problem like me, I recommend to do : first to build binary of itk-snap source file using Cmake-Gui and build based on their help to the different folder. After you are sure that you can make the binary file, goes to the Qt-Creator, change the Kit and other setting if its not correct, then open Cmakelist.txt from source of itk-snap. It shows a windows to run the cmake inside the QT-creator. Go back to your Cmake-Gui and from Tools >> show my changes menu, copy the argument and past to the argument textBox in QT. In my case variables are

-DVTK_REQUIRED_OBJCXX_FLAGS:STRING="" -DSNAP_USE_GPU:BOOL="1" -DVTK_DIR:PATH="/Users/../itkSnap3/vtk/build" -DITK_DIR:PATH="/Users/../itkSnap3/itk/build" -DCMAKE_PREFIX_PATH:PATH="/usr/local/Cellar/qt5/5.5.1_2/lib/cmake"

Good luck