<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7650.28">
<TITLE>(Still Struggling) Problems with Cmake and ImageViewer application</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Hi all,<BR>
<BR>
I am still having problems with building the application using CMAKE and i do not understand what went wrong. Would appreciate if I could get some help or pointers in the right direction. Thanks, and i am attaching my CMAKE cache here for more info...<BR>
<BR>
# This is the CMakeCache file.<BR>
# For build in directory: c:/InsightToolkit-2.8.1/2D/AppImageViewer/binaries<BR>
# It was generated by CMake: C:/Program Files/CMake 2.4/bin/cmake.exe<BR>
# You can edit this file to change values found and used by cmake.<BR>
# If you do not want to change any of the values, simply exit the editor.<BR>
# If you do want to change a value, simply edit, save, and exit the editor.<BR>
# The syntax for the file is as follows:<BR>
# KEY:TYPE=VALUE<BR>
# KEY is the name of a variable in the cache.<BR>
# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!.<BR>
# VALUE is the current value for the KEY.<BR>
<BR>
########################<BR>
# EXTERNAL cache entries<BR>
########################<BR>
<BR>
//Path to a program.<BR>
CMAKE_AR:FILEPATH=CMAKE_AR-NOTFOUND<BR>
<BR>
//For backwards compatibility, what version of CMake commands and<BR>
// syntax should this version of CMake allow.<BR>
CMAKE_BACKWARDS_COMPATIBILITY:STRING=2.4<BR>
<BR>
//C++ compiler<BR>
CMAKE_CXX_COMPILER:STRING=cl<BR>
<BR>
//Flags used by the compiler during all build types.<BR>
CMAKE_CXX_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR<BR>
<BR>
//Flags used by the compiler during debug builds.<BR>
CMAKE_CXX_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi /Ob0 /Od /GZ<BR>
<BR>
//Flags used by the compiler during release minsize builds.<BR>
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /D NDEBUG<BR>
<BR>
//Flags used by the compiler during release builds (/MD /Ob1 /Oi<BR>
// /Ot /Oy /Gs will produce slightly less optimized but smaller<BR>
// files).<BR>
CMAKE_CXX_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /D NDEBUG<BR>
<BR>
//Flags used by the compiler during Release with Debug Info builds.<BR>
//<BR>
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /D NDEBUG<BR>
<BR>
//Libraries linked by defalut with all C++ applications.<BR>
CMAKE_CXX_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<BR>
<BR>
//C compiler<BR>
CMAKE_C_COMPILER:STRING=cl<BR>
<BR>
//Flags for C compiler.<BR>
CMAKE_C_FLAGS:STRING= /DWIN32 /D_WINDOWS /W3 /Zm1000<BR>
<BR>
//Flags used by the compiler during debug builds.<BR>
CMAKE_C_FLAGS_DEBUG:STRING=/D_DEBUG /MDd /Zi /Ob0 /Od /GZ<BR>
<BR>
//Flags used by the compiler during release minsize builds.<BR>
CMAKE_C_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /D NDEBUG<BR>
<BR>
//Flags used by the compiler during release builds (/MD /Ob1 /Oi<BR>
// /Ot /Oy /Gs will produce slightly less optimized but smaller<BR>
// files).<BR>
CMAKE_C_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /D NDEBUG<BR>
<BR>
//Flags used by the compiler during Release with Debug Info builds.<BR>
//<BR>
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /D NDEBUG<BR>
<BR>
//Libraries linked by defalut with all C applications.<BR>
CMAKE_C_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<BR>
<BR>
//Flags used by the linker.<BR>
CMAKE_EXE_LINKER_FLAGS:STRING=/STACK:10000000 /machine:I386<BR>
<BR>
//Flags used by the linker during debug builds.<BR>
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL:YES<BR>
<BR>
//Flags used by the linker during release minsize builds.<BR>
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO<BR>
<BR>
//Flags used by the linker during release builds.<BR>
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO<BR>
<BR>
//Flags used by the linker during Release with Debug Info builds.<BR>
//<BR>
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL:YES<BR>
<BR>
//Install path prefix, prepended onto install directories.<BR>
CMAKE_INSTALL_PREFIX:PATH=C:/Program Files/ImageViewer<BR>
<BR>
//make program<BR>
CMAKE_MAKE_PROGRAM:FILEPATH=C:/PROGRA~1/MIAF9D~1/Common/MSDev98/Bin/MSDEV.COM<BR>
<BR>
//Flags used by the linker during the creation of modules.<BR>
CMAKE_MODULE_LINKER_FLAGS:STRING=/STACK:10000000 /machine:I386<BR>
<BR>
//Flags used by the linker during debug builds.<BR>
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL:YES<BR>
<BR>
//Flags used by the linker during release minsize builds.<BR>
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO<BR>
<BR>
//Flags used by the linker during release builds.<BR>
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO<BR>
<BR>
//Flags used by the linker during Release with Debug Info builds.<BR>
//<BR>
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL:YES<BR>
<BR>
//RC compiler<BR>
CMAKE_RC_COMPILER:STRING=rc<BR>
<BR>
//Flags for Fortran compiler.<BR>
CMAKE_RC_FLAGS:STRING=' '<BR>
<BR>
//Flags used by the linker during the creation of dll's.<BR>
CMAKE_SHARED_LINKER_FLAGS:STRING=/STACK:10000000 /machine:I386<BR>
<BR>
//Flags used by the linker during debug builds.<BR>
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL:YES<BR>
<BR>
//Flags used by the linker during release minsize builds.<BR>
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO<BR>
<BR>
//Flags used by the linker during release builds.<BR>
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO<BR>
<BR>
//Flags used by the linker during Release with Debug Info builds.<BR>
//<BR>
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL:YES<BR>
<BR>
//If set, runtime paths are not added when using shared libraries.<BR>
//<BR>
CMAKE_SKIP_RPATH:BOOL=OFF<BR>
<BR>
//If true, cmake will use relative paths in makefiles and projects.<BR>
//<BR>
CMAKE_USE_RELATIVE_PATHS:BOOL=OFF<BR>
<BR>
//If this value is on, makefiles will be generated without the<BR>
// .SILENT directive, and all commands will be echoed to the console<BR>
// during the make. This is useful for debugging only. With Visual<BR>
// Studio IDE projects all commands are done without /nologo.<BR>
CMAKE_VERBOSE_MAKEFILE:BOOL=OFF<BR>
<BR>
//Single output directory for building all executables.<BR>
EXECUTABLE_OUTPUT_PATH:PATH=<BR>
<BR>
//The directory containing FLTKConfig.cmake. This is either the<BR>
// root of the build tree, or PREFIX/lib/fltk for an installation.<BR>
//<BR>
FLTK_DIR:PATH=C:/fltk-1.1.7<BR>
<BR>
//Fluid executable<BR>
FLTK_FLUID_EXECUTABLE:FILEPATH=C:/fltk-1.1.7/fluid/fluidd.exe<BR>
<BR>
//The directory containing ITKConfig.cmake. This is either the<BR>
// root of the build tree, or PREFIX/lib/InsightToolkit for an<BR>
// installation.<BR>
ITK_DIR:PATH=C:/InsightToolkit-2.8.1<BR>
<BR>
//Value Computed by CMake<BR>
ImageViewer_BINARY_DIR:STATIC=C:/InsightToolkit-2.8.1/2D/AppImageViewer/binaries<BR>
<BR>
//Value Computed by CMake<BR>
ImageViewer_SOURCE_DIR:STATIC=C:/InsightToolkit-2.8.1/2D/AppImageViewer<BR>
<BR>
//Single output directory for building all libraries.<BR>
LIBRARY_OUTPUT_PATH:PATH=<BR>
<BR>
<BR>
########################<BR>
# INTERNAL cache entries<BR>
########################<BR>
<BR>
//Advanced flag for variable: CMAKE_AR<BR>
CMAKE_AR-ADVANCED:INTERNAL=1<BR>
//What is the target build tool cmake is generating for.<BR>
CMAKE_BUILD_TOOL:INTERNAL=C:/PROGRA~1/MIAF9D~1/Common/MSDev98/Bin/MSDEV.COM<BR>
//This is the directory where this CMakeCahe.txt was created<BR>
CMAKE_CACHEFILE_DIR:INTERNAL=c:/InsightToolkit-2.8.1/2D/AppImageViewer/binaries<BR>
//Major version of cmake used to create the current loaded cache<BR>
//<BR>
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=2<BR>
//Minor version of cmake used to create the current loaded cache<BR>
//<BR>
CMAKE_CACHE_MINOR_VERSION:INTERNAL=4<BR>
//Major version of cmake used to create the current loaded cache<BR>
//<BR>
CMAKE_CACHE_RELEASE_VERSION:INTERNAL=patch 3<BR>
//Path to CMake executable.<BR>
CMAKE_COMMAND:INTERNAL=C:/Program Files/CMake 2.4/bin/cmake.exe<BR>
//Path to ctest program executable.<BR>
CMAKE_CTEST_COMMAND:INTERNAL=C:/Program Files/CMake 2.4/bin/ctest.exe<BR>
//Advanced flag for variable: CMAKE_CXX_COMPILER<BR>
CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1<BR>
CMAKE_CXX_COMPILER_WORKS:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_CXX_FLAGS<BR>
CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_CXX_FLAGS_DEBUG<BR>
CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_CXX_FLAGS_MINSIZEREL<BR>
CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_CXX_FLAGS_RELEASE<BR>
CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO<BR>
CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_CXX_STANDARD_LIBRARIES<BR>
CMAKE_CXX_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_C_COMPILER<BR>
CMAKE_C_COMPILER-ADVANCED:INTERNAL=1<BR>
CMAKE_C_COMPILER_WORKS:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_C_FLAGS<BR>
CMAKE_C_FLAGS-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_C_FLAGS_DEBUG<BR>
CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_C_FLAGS_MINSIZEREL<BR>
CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_C_FLAGS_RELEASE<BR>
CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_C_FLAGS_RELWITHDEBINFO<BR>
CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_C_STANDARD_LIBRARIES<BR>
CMAKE_C_STANDARD_LIBRARIES-ADVANCED:INTERNAL=1<BR>
//Path to cache edit program executable.<BR>
CMAKE_EDIT_COMMAND:INTERNAL=C:/Program Files/CMake 2.4/bin/CMakeSetup.exe<BR>
//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS<BR>
CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG<BR>
CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL<BR>
//<BR>
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE<BR>
CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO<BR>
//<BR>
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1<BR>
//Name of generator.<BR>
CMAKE_GENERATOR:INTERNAL=Visual Studio 6<BR>
//Start directory with the top level CMakeLists.txt file for this<BR>
// project<BR>
CMAKE_HOME_DIRECTORY:INTERNAL=C:/InsightToolkit-2.8.1/2D/AppImageViewer<BR>
//Advanced flag for variable: CMAKE_MAKE_PROGRAM<BR>
CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS<BR>
CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG<BR>
CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL<BR>
//<BR>
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE<BR>
//<BR>
CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO<BR>
//<BR>
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1<BR>
//number of local generators<BR>
CMAKE_NUMBER_OF_LOCAL_GENERATORS:INTERNAL=1<BR>
//noop for ranlib<BR>
CMAKE_RANLIB:INTERNAL=:<BR>
//Advanced flag for variable: CMAKE_RC_COMPILER<BR>
CMAKE_RC_COMPILER-ADVANCED:INTERNAL=1<BR>
CMAKE_RC_COMPILER_WORKS:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_RC_FLAGS<BR>
CMAKE_RC_FLAGS-ADVANCED:INTERNAL=1<BR>
//Path to CMake installation.<BR>
CMAKE_ROOT:INTERNAL=C:/Program Files/CMake 2.4/share/CMake<BR>
//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS<BR>
CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG<BR>
CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL<BR>
//<BR>
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE<BR>
//<BR>
CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO<BR>
//<BR>
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1<BR>
//Result of TRY_RUN<BR>
CMAKE_SIZEOF_VOID_P:INTERNAL=4<BR>
//Advanced flag for variable: CMAKE_SKIP_RPATH<BR>
CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_USE_RELATIVE_PATHS<BR>
CMAKE_USE_RELATIVE_PATHS-ADVANCED:INTERNAL=1<BR>
//Advanced flag for variable: CMAKE_VERBOSE_MAKEFILE<BR>
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1<BR>
//Extra libraries for fltk_images library.<BR>
FLTK_IMAGES_LIBS:INTERNAL=fltk_jpeg;fltk_png;fltk_zlib<BR>
//Result of TRY_COMPILE<BR>
HAVE_CMAKE_SIZEOF_VOID_P:INTERNAL=TRUE<BR>
<BR>
Best regards,<BR>
Zheying<BR>
<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: Wu Zheying<BR>
Sent: Tue 2/20/2007 4:46 PM<BR>
To: insight-users@itk.org<BR>
Subject: Problems with Cmake and ImageViewer application<BR>
<BR>
Hi all,<BR>
<BR>
I am trying out the image viewer application. I have built FLTK already and ITK already, and everything seems to be running ok. But I am experiencing the following errors when configuring using CMAKE:<BR>
<BR>
<BR>
CMake Error: Cannot find source file<BR>
"C:/InsightToolkit-2.8.1/2D/AppImageViewer/ImageViewer.cxx;C:/InsightToolkit-2.8.1/2D/<BR>
AppImageViewer/binaries/ImageViewerGUI.cxx for target "ImageViewer"<BR>
<BR>
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .h++ .hm .hpp .hxx .in .txx<BR>
<BR>
Can anyone help me on this? Thanks in advance.<BR>
<BR>
I am also attaching my cMakeList code below:<BR>
<BR>
PROJECT(ImageViewer)<BR>
<BR>
#IF( BUILD_OUTSIDE_INSIGHT_APPLICATIONS )<BR>
<BR>
FIND_PACKAGE(ITK)<BR>
IF(ITK_FOUND)<BR>
INCLUDE(${ITK_USE_FILE})<BR>
ELSE(ITK_FOUND)<BR>
MESSAGE(FATAL_ERROR<BR>
"Cannot build InsightApplications without ITK. Please set ITK_DIR.")<BR>
ENDIF(ITK_FOUND)<BR>
<BR>
FIND_PACKAGE(FLTK)<BR>
IF (FLTK_FOUND)<BR>
INCLUDE_DIRECTORIES (${FLTK_INCLUDE_DIR})<BR>
ELSE (FLTK_FOUND)<BR>
MESSAGE( FATAL_ERROR "This application requires FLTK. One of these<BR>
components is missing. Please verify configuration")<BR>
ENDIF (FLTK_FOUND)<BR>
<BR>
#ENDIF( BUILD_OUTSIDE_INSIGHT_APPLICATIONS )<BR>
<BR>
INCLUDE_DIRECTORIES (<BR>
${ImageViewer_SOURCE_DIR}/Auxiliary/FltkImageViewer<BR>
)<BR>
<BR>
LINK_LIBRARIES (<BR>
ITKBasicFilters<BR>
ITKIO<BR>
ITKFltkImageViewer<BR>
)<BR>
<BR>
<BR>
SET(ImageViewer_GUI_SRCS<BR>
ImageViewerGUI.fl<BR>
)<BR>
<BR>
FLTK_WRAP_UI( ImageViewer ${ImageViewer_GUI_SRCS} )<BR>
#ITK_DISABLE_FLTK_GENERATED_WARNINGS("${ImageViewer_GUI_SRCS}")<BR>
<BR>
SET ( ImageViewer_SRCS<BR>
ImageViewer.cxx<BR>
${ImageViewer_FLTK_UI_SRCS}<BR>
)<BR>
<BR>
ADD_EXECUTABLE( ImageViewer "${ImageViewer_SRCS}" )<BR>
<BR>
<BR>
Regards<BR>
Zheying<BR>
</FONT>
</P>
</BODY>
</HTML>