ITK/Configuring and Building/QtCreator: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
mNo edit summary
No edit summary
 
Line 1: Line 1:
Building ITK with QtCreator on Windows 7:
Building ITK through QtCreator using the Visual Studio C++ compiler on Windows 7:


* Launch the CMake GUI
* Launch the CMake GUI from the Visual Studio terminal by going to Start -> Programs -> Visual Studio -> Visual Studio Tools -> Visual Studio Command Prompt and running 'cmake-gui'. It is very important that you do not simply use the CMake GUI shortcut in the start menu, as the environment is not setup properly here.
* Next to "Where is the source code:", click "Browse Source..." and navigate to where you cloned the repository with Git.
* Next to "Where is the source code:", click "Browse Source..." and navigate to where you cloned the repository with Git.
* Next to "Where to build the binaries:", select "Browse Build..." and select a place to build the ITK library. I like to use c:\build\ITK. This directory should NOT be inside the directory where you cloned the repository.
* Next to "Where to build the binaries:", select "Browse Build..." and select a place to build the ITK library. I like to use c:\build\ITK. This directory should NOT be inside the directory where you cloned the repository.
* Click "Configure", and then specify "CodeBlocks" as the generator for this project. (Note: this is not a typo: use the CodeBlocks generator for QtCreator)
* Click "Configure", and then select "NMake Makefiles" as the generator for this project. (Note: this is not a typo: use "NMake Makefiles", not anything that says "Visual Studio")
* Choose your build options. I like to UNCHECK BUILD_EXAMPLES and BUILD_TESTING as they speed up the build process significantly.
* Choose your build options. I like to UNCHECK BUILD_EXAMPLES and BUILD_TESTING as they speed up the build process significantly.
* Click "Generate".
* Click "Generate".
Line 12: Line 12:
* From the Build menu, choose "Build All"
* From the Build menu, choose "Build All"


NMake Generator (Microsoft Visual C++ Compiler 10.0 (x86))
Questions:
Sometimes "NMake Generator (Microsoft Visual C++ Compiler 10.0 (x86))" (seems to be with VS2010) is available, while other times it is called "NMake Makefiles" (seems to be with VS2005).


 
Potential errors:
  To use the NMake generator, cmake must be run from a shell that can use the
Q: CMake tells you:
"To use the NMake generator, cmake must be run from a shell that can use the
compiler cl from the command line. This environment does not contain
compiler cl from the command line. This environment does not contain
INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
work.
work."
 
A: You probably have run CMake GUI from the normal start menu, rather than launching 'cmake-gui' from the Visual Studio Command Prompt.
Right click my computer -> Properties -> Advanced System Settings -> Advanced -> Environment variables

Latest revision as of 20:30, 14 September 2012

Building ITK through QtCreator using the Visual Studio C++ compiler on Windows 7:

  • Launch the CMake GUI from the Visual Studio terminal by going to Start -> Programs -> Visual Studio -> Visual Studio Tools -> Visual Studio Command Prompt and running 'cmake-gui'. It is very important that you do not simply use the CMake GUI shortcut in the start menu, as the environment is not setup properly here.
  • Next to "Where is the source code:", click "Browse Source..." and navigate to where you cloned the repository with Git.
  • Next to "Where to build the binaries:", select "Browse Build..." and select a place to build the ITK library. I like to use c:\build\ITK. This directory should NOT be inside the directory where you cloned the repository.
  • Click "Configure", and then select "NMake Makefiles" as the generator for this project. (Note: this is not a typo: use "NMake Makefiles", not anything that says "Visual Studio")
  • Choose your build options. I like to UNCHECK BUILD_EXAMPLES and BUILD_TESTING as they speed up the build process significantly.
  • Click "Generate".
  • Open QtCreator
  • File -> Open Project
  • Navigate to the source directory you specified through CMake
  • From the Build menu, choose "Build All"

Questions: Sometimes "NMake Generator (Microsoft Visual C++ Compiler 10.0 (x86))" (seems to be with VS2010) is available, while other times it is called "NMake Makefiles" (seems to be with VS2005).

Potential errors: Q: CMake tells you: "To use the NMake generator, cmake must be run from a shell that can use the compiler cl from the command line. This environment does not contain INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to work." A: You probably have run CMake GUI from the normal start menu, rather than launching 'cmake-gui' from the Visual Studio Command Prompt.