[Insight-users] Re: Configuring the HelloWorld example: I still can¡¯t solve my problem till now! :

Luis Ibanez luis . ibanez at kitware . com
Thu, 03 Jul 2003 01:58:34 -0400


HI Zheng,


It seems that you haven't built ITK itself.


You have to build ITK before attemting to use any of the examples.
In order to build ITK, run CMake  and provide as source directory

  E:\\zhengyuanjie\\InsightToolkit-1.2.0\\InsightToolkit-1.2.0

not

E:\\zhengyuanjie\\InsightToolkit-1.2.0\\InsightToolkit-1.2.0\\Examples\\Installation

Then as binary directory for building ITK, provide

   E:\\zhengyuanjie\\InsightBin

After running CMake you will find a file "ITK.dsw" in the directory

   E:\\zhengyuanjie\\InsightBin

Open this ITK.dsw file with VisualStudio 6 and "build"

This should generate libraries and executables in the directory

   E:\\zhengyuanjie\\InsightBin\\bin

under subdirectories "Release" or "Debug" depending on the
compilation mode that you used.


When the build is done (it would take about 40 minutes) you
can now use the ITK libraries  for building the HelloWorld example.

In order to build this example please do the following

Run CMakeSetup again, provide as source directory

E:\\zhengyuanjie\\InsightToolkit-1.2.0\\InsightToolkit-1.2.0\\Examples\\Installation

and as binary directory

E:\\zhengyuanjie\\ItkExample

CMake will ask you where did you build ITK, that is

 ¡°the binary directory where you built ITK¡±.

You must provide this information in the variable ITK_DIR,
in your case you should give the directory

   E:\\zhengyuanjie\\InsightBin

With this, CMake should be able to configure the example and
generate a file HelloWorld.dsw in the directory

E:\\zhengyuanjie\\ItkExample

Open this dsw file with VisualStudio and build

That will generate the executable for the example.



----



   Regards,


      Luis


----------------
Zheng wrote:
> Dear Luis:
> I still can¡¯t solve my problem till now. You say The HelloWorld example requires you to specify the binary directory where you built ITK. I don¡¯t know the meaning of ¡°the binary directory where you built ITK¡±.
> I list my operations and the CMakeCache.txt below.
> My operations is as below:
> 1.	Extract the files in archive InsightToolkit-1.2.0.zip to the folder E:\\zhengyuanjie\\InsightToolkit-1.2.0\\InsightToolkit-1.2.0\\
> 2.	Run CMSetup167.exe, and set source and build directories respectively as E:\\zhengyuanjie\\InsightToolkit-1.2.0\\InsightToolkit-1.2.0\\Examples\\Installation and E:\\zhengyuanjie\\MyExample
> 3.	Select Visual Studio 6.
> 4.	Push the button configure.
> 5.	An error appears: Cannot build without ITK. Please set ITK_DIR(Press Cancel to suppress any further messages.)
> 6.	I push the Cancel button.
> 7.	I set variable ITK_DIR as E:\\zhengyuanjie\\InsightToolkit-1.2.0, and push configure button. Another error appears: 
> CMake Error: Error in cmake code at E:/zhengyuanjie/Cmake/Modules/FindITK.cmake:75:
> INCLUDE Could not find include file: E:/zhengyuanjie/InsightToolkit-1.2.0/ITKConfig.cmake
> (Press Cancel to suppress any further messages.)
> 8.	If I set variable ITK_DIR as E:\\zhengyuanjie\\MyExample and push configure button, an error appears:
>   CMake Error: Error in cmake code at E:/zhengyuanjie/Cmake/Modules/FindITK.cmake:75:
> INCLUDE Could not find include file: E:/zhengyuanjie/InsightToolkit-1.2.0/ITKConfig.cmake
> (Press Cancel to suppress any further messages.)
> 
> 
> The CMakeCache.txt file¡¯s content is as below:
> # This is the CMakeCache file.
> # For build in directory: e:/zhengyuanjie/MyExample
> # You can edit this file to change values found and used by cmake.
> # If you do not want to change any of the values, simply exit the editor.
> # If you do want to change a value, simply edit, save, and exit the editor.
> # The syntax for the file is as follows:
> # KEY:TYPE=VALUE
> # KEY is the name of a varible in the cache.
> # TYPE is a hint to GUI\'s for the type of VALUE, DO NOT EDIT TYPE!.
> # VALUE is the current value for the KEY.
> 
> ########################
> # EXTERNAL cache entries
> ########################
> 
> //Path to a program.
> CMAKE_AR:FILEPATH=CMAKE_AR-NOTFOUND
> 
> //For backwards compatibility, what version of CMake commands and
> // syntax should this version of CMake allow.
> CMAKE_BACKWARDS_COMPATIBILITY:STRING=1.6
> 
> //C++ compiler
> CMAKE_CXX_COMPILER:STRING=cl
> 
> //Flags used by the compiler during all build types.
> CMAKE_CXX_FLAGS:STRING=  /W3 /Zm1000 /GX /GR
> 
> //Flags used by the compiler during debug builds.
> CMAKE_CXX_FLAGS_DEBUG:STRING=/MDd /Zi /Od /GZ
> 
> //Flags used by the compiler during release minsize builds.
> CMAKE_CXX_FLAGS_MINSIZEREL:STRING=/MD /O1
> 
> //Flags used by the compiler during release builds (/MD /Ob1 /Oi
> // /Ot /Oy /Gs will produce slightly less optimized but smaller
> // files).
> CMAKE_CXX_FLAGS_RELEASE:STRING=/MD /O2
> 
> //Flags used by the compiler during Release with Debug Info builds.
> //
> CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2
> 
> //C compiler
> CMAKE_C_COMPILER:STRING=cl
> 
> //Flags for C compiler.
> CMAKE_C_FLAGS:STRING=  /W3 /Zm1000
> 
> //Flags used by the compiler during debug builds.
> CMAKE_C_FLAGS_DEBUG:STRING=/MDd /Zi /Od /GZ
> 
> //Flags used by the compiler during release minsize builds.
> CMAKE_C_FLAGS_MINSIZEREL:STRING=/MD /O1
> 
> //Flags used by the compiler during release builds (/MD /Ob1 /Oi
> // /Ot /Oy /Gs will produce slightly less optimized but smaller
> // files).
> CMAKE_C_FLAGS_RELEASE:STRING=/MD /O2
> 
> //Flags used by the compiler during Release with Debug Info builds.
> //
> CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2
> 
> //Flags used by the linker.
> CMAKE_EXE_LINKER_FLAGS:STRING=/STACK:10000000 /machine:I386 /INCREMENTAL:YES
> 
> //Flags used by the linker during debug builds.
> CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/debug /pdbtype:sept
> 
> //Flags used by the linker during release minsize builds.
> CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
> 
> //Flags used by the linker during release builds.
> CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
> 
> //Flags used by the linker during Release with Debug Info builds.
> //
> CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /pdbtype:sept
> 
> //Install path prefix, prepended onto install directories.
> CMAKE_INSTALL_PREFIX:PATH=/usr/local
> 
> //make program
> CMAKE_MAKE_PROGRAM:FILEPATH=C:/PROGRA~1/MICROS~3/Common/MSDev98/Bin/msdev.com
> 
> //Flags used by the linker during the creation of modules.
> CMAKE_MODULE_LINKER_FLAGS:STRING=
> 
> //Flags used by the linker during debug builds.
> CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
> 
> //Flags used by the linker during release minsize builds.
> CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
> 
> //Flags used by the linker during release builds.
> CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
> 
> //Flags used by the linker during Release with Debug Info builds.
> //
> CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /pdbtype:sept
> 
> //Flags used by the linker during the creation of dll\'s.
> CMAKE_SHARED_LINKER_FLAGS:STRING=/STACK:10000000 /machine:I386 /INCREMENTAL:YES
> 
> //Flags used by the linker during debug builds.
> CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=/debug /pdbtype:sept
> 
> //Flags used by the linker during release minsize builds.
> CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
> 
> //Flags used by the linker during release builds.
> CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
> 
> //Flags used by the linker during Release with Debug Info builds.
> //
> CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /pdbtype:sept
> 
> //If set, runtime paths are not added when using shared libraries.
> //
> CMAKE_SKIP_RPATH:BOOL=NO
> 
> //Libraries linked by defalut with all applications.
> CMAKE_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
> 
> //If this value is on, makefiles will be generated without the
> // .SILENT directive, and all commands will be echoed to the console
> // during the make.  This is useful for debugging only.
> CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
> 
> //Single output directory for building all executables.
> EXECUTABLE_OUTPUT_PATH:PATH=
> 
> //Value Computed by CMake
> HelloWorld_BINARY_DIR:STATIC=E:/zhengyuanjie/MyExample
> 
> //Value Computed by CMake
> HelloWorld_SOURCE_DIR:STATIC=E:/zhengyuanjie/InsightToolkit-1.2.0/InsightToolkit-1.2.0/Examples/Installation
> 
> //The directory containing ITKConfig.cmake.  This is either the
> // root of the build tree, or PREFIX/lib/InsightToolkit for an
> // installation.
> ITK_DIR:PATH=ITK_DIR-NOTFOUND
> 
> //Single output directory for building all libraries.
> LIBRARY_OUTPUT_PATH:PATH=
> 
> 
> ########################
> # INTERNAL cache entries
> ########################
> 
> //Advanced flag for variable: CMAKE_AR
> CMAKE_AR-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_BUILD_TOOL
> CMAKE_BUILD_TOOL-ADVANCED:INTERNAL=1
> //What is the target build tool cmake is generating for.
> CMAKE_BUILD_TOOL:INTERNAL=C:/PROGRA~1/MICROS~3/Common/MSDev98/Bin/msdev.com
> //This is the directory where this CMakeCahe.txt was created
> CMAKE_CACHEFILE_DIR:INTERNAL=e:/zhengyuanjie/MyExample
> //Major version of cmake used to create the current loaded cache
> //
> CMAKE_CACHE_MAJOR_VERSION:INTERNAL=1
> //Minor version of cmake used to create the current loaded cache
> //
> CMAKE_CACHE_MINOR_VERSION:INTERNAL=6
> //Major version of cmake used to create the current loaded cache
> //
> CMAKE_CACHE_RELEASE_VERSION:INTERNAL=patch 7
> //Path to CMake executable.
> CMAKE_COMMAND:INTERNAL=E:/zhengyuanjie/CMake/bin/cmake.exe
> //Advanced flag for variable: CMAKE_CXX_COMPILER
> CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1
> //Result of TRY_COMPILE
> CMAKE_CXX_COMPILER_WORKS:INTERNAL=TRUE
> //Advanced flag for variable: CMAKE_CXX_FLAGS
> CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_CXX_FLAGS_DEBUG
> CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_CXX_FLAGS_MINSIZEREL
> CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_CXX_FLAGS_RELEASE
> CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
> CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_C_COMPILER
> CMAKE_C_COMPILER-ADVANCED:INTERNAL=1
> //Result of TRY_COMPILE
> CMAKE_C_COMPILER_WORKS:INTERNAL=TRUE
> //Advanced flag for variable: CMAKE_C_FLAGS
> CMAKE_C_FLAGS-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_C_FLAGS_DEBUG
> CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_C_FLAGS_MINSIZEREL
> CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_C_FLAGS_RELEASE
> CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_C_FLAGS_RELWITHDEBINFO
> CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
> //Path to cache edit program executable.
> CMAKE_EDIT_COMMAND:INTERNAL=E:/zhengyuanjie/CMake/bin/CMakeSetup.exe
> //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS
> CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
> CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
> //
> CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
> CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
> //
> CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
> //Name of generator.
> CMAKE_GENERATOR:INTERNAL=Visual Studio 6
> //Start directory with the top level CMakeLists.txt file for this
> // project
> CMAKE_HOME_DIRECTORY:INTERNAL=E:/zhengyuanjie/InsightToolkit-1.2.0/InsightToolkit-1.2.0/Examples/Installation
> //Advanced flag for variable: CMAKE_INSTALL_PREFIX
> CMAKE_INSTALL_PREFIX-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_MAKE_PROGRAM
> CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS
> CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
> CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
> //
> CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
> //
> CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
> //
> CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_RANLIB
> CMAKE_RANLIB-ADVANCED:INTERNAL=1
> //noop for ranlib
> CMAKE_RANLIB:INTERNAL=:
> //Path to CMake installation.
> CMAKE_ROOT:INTERNAL=E:/zhengyuanjie/CMake
> //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS
> CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
> CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
> //
> CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
> //
> CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
> //
> CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_SKIP_RPATH
> CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_STANDARD_LIBRARIES
> CMAKE_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1
> //Advanced flag for variable: CMAKE_VERBOSE_MAKEFILE
> CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
> 
> 
> Thank you in advance!
> Sincerely yours 
> Zheng
> 
> ----- Original Message -----
> From: Luis Ibanez <luis . ibanez at kitware . com>
> To: zhengyuanjie at sjtu . edu . cn
> Cc: insight-users at itk . org
> Subject: Re: [Insight-users] help!!
> 
> 
> Hi Zheng,
> 
> The HelloWorld example requires you to specify the binary
> directory where you built ITK.
> 
> You must provide this path in the CMake variable "ITK_DIR"
> when you run CMake for configuring the HelloWorld example.
> 
> If you continue experiencing any problems, please send us the
> CMakeCache.txt file that CMake is generating in the binary
> directory where you are trying to build the HelloWorld
> example.
> 
> 
> Thanks
> 
> 
> 
>    Luis
> 
> 
> -------------
> Ö£Ôª½Ü wrote:
> 
>>Dear Sir.
>>I am a new user of ITK with Windows 2000  and  Microsoft visual C++ 6.0. Today I am trying to configure the file HelloWorld in the Insight/Examples/Installation directory with CMake. However I can¡¯t finish the configuration , because CMake told me that it couldn¡¯t find ITK. I don¡¯t know what it means. I think it perhaps means the strategy for finding ITK fails, but I don¡¯t know how to correct my operations. I am sure that the source and binary directories have been correctly placed.  Would you please explain it for me? 
>>
>>I have configured some other provided examples by ITK successfully. And I loaded the workspaces generated by CMake with Microsoft Visual c++ 6.0. Otherwise I can¡¯t build them with vc, because there were some header files I couldn¡¯t find. Would you mind tell me that how I can find all the header files needed quickly?
>>Thank you in advance!
>>Sincerely yours 
>>Zheng
>> 
>> 
> 
> 
> 
> 
> 
> 
>