[Insight-users] Help needed to rebuild an ITK application outside of the InsightA pplications directory

Luis Ibanez luis.ibanez at kitware.com
Sun May 15 08:34:42 EDT 2005


HI Shen,

     You are in the right path.




Just a couple of things more:



1) Remove the lines


     IF( BUILD_OUTSIDE_INSIGHT_APPLICATIONS )
     ENDIF( BUILD_OUTSIDE_INSIGHT_APPLICATIONS )




2) Replace the explicit path:

      C:/shen/ITKSamples/FastMarchingLevelSetSrc
      C:/shen/ITKSamples/FastMarchingLevelSetBin

     with

       ${FastMarchingLevelSet_SOURCE_DIR}
       ${FastMarchingLevelSet_BINARY_DIR}

      CMake creates this variables for you by simply
      taking the name that you gave to the project
      in the PROJECT() command at the top of the file
      and concatenating "SOURCE_DIR" and "TARGET_DIR".




   Regards,



      Luis



-----------------------
Shen, Weicheng wrote:
> Hi:
> 
>  
> 
> I attempted to rebuild an ITK application, "FastMarchingLevelSet", 
> outside of the root directory for InsightApplications. Before I started 
> this task, I have verified that my installation of ITK, VTK, FLTK, and 
> InsightApplications are correct. I was able to run the "rebuild all" 
> option under the MS Visual Studio .Net 2003 for InsightApplications, 
> which rebuilt all projects in InsightApplications. Now I want to make a 
> copy of the "FastMarchingLevelSet" project to another directory and 
> rebuilt it there by doing the following.
> 
>  
> 
>    1. Make a new folder called ITKSamples, and two subfolders (under
>       ITKSamples). One is called FastMarchingLevelSetSrc and another is
>       called FastMarchingLevelSetBin.
>    2. Copy all 6 files within the FastMarchingLevelSet project (source)
>       into FastMarchingLevelSetSrc, which are CMakeLists.txt;
>       FastMarchingLevelSet.cxx; FastMarchingLevelSet.h;
>       FastMarchingLevelSetBase.cxx; FastMarchingLevelSetBase.h; and
>       FastMarchingLevelSetGUI.fl.
>    3. Then I modified the contents of CMakeLists.txt into the following
> 
> ============================================================================
> 
> PROJECT(FastMarchingLevelSet)
> 
>  
> 
> IF( BUILD_OUTSIDE_INSIGHT_APPLICATIONS )
> 
>  
> 
>   FIND_PACKAGE(ITK)
> 
>   IF(ITK_FOUND)
> 
>     INCLUDE(${ITK_USE_FILE})
> 
>   ELSE(ITK_FOUND)
> 
>     MESSAGE(FATAL_ERROR
> 
>             "Cannot build InsightApplications without ITK.  Please set 
> ITK_DIR.")
> 
>   ENDIF(ITK_FOUND)
> 
>  
> 
>  
> 
>   FIND_PACKAGE(FLTK)
> 
>   IF(FLTK_FOUND)
> 
>     INCLUDE_DIRECTORIES(${FLTK_INCLUDE_DIR})
> 
>   ENDIF(FLTK_FOUND)
> 
>  
> 
> ENDIF( BUILD_OUTSIDE_INSIGHT_APPLICATIONS )
> 
>  
> 
>  
> 
> INCLUDE_DIRECTORIES(
> 
>   ${InsightApplications_SOURCE_DIR}/Auxiliary/FltkImageViewer
> 
>   ${InsightApplications_SOURCE_DIR}/Auxiliary/VtkFltk
> 
>   ${InsightApplications_SOURCE_DIR}/Auxiliary/vtk
> 
>   ${InsightApplications_BINARY_DIR}/Auxiliary/FltkImageViewer
> 
>   ${InsightApplications_BINARY_DIR}/Auxiliary/VtkFltk
> 
>   C:/shen/ITKSamples/FastMarchingLevelSetSrc
> 
>   C:/shen/ITKSamples/FastMarchingLevelSetBin
> 
> )
> 
>  
> 
> SET(FastMarchingLevelSet_SRCS
> 
>   FastMarchingLevelSetBase.cxx
> 
>   FastMarchingLevelSet.cxx
> 
>   )
> 
>  
> 
> ADD_EXECUTABLE(FastMarchingLevelSet "${FastMarchingLevelSet_SRCS}")
> 
>  
> 
> FLTK_WRAP_UI(FastMarchingLevelSet FastMarchingLevelSetGUI.fl)
> 
>  
> 
> TARGET_LINK_LIBRARIES(FastMarchingLevelSet ITKIO ITKVtkFltk
> 
>                       ITKBasicFilters ITKNumerics ITKFltkImageViewer)
> 
>  
> 
> ============================================================================
> 
>  
> 
> Note that I have change ADD_GUI_EXECUTABLE to ADD_EXECUTABLE to avoid 
> the CMake configuration error (ADD_GUI_EXECUTABLE not defined...).
> 
>  
> 
> However, when I run the CMake on the above CMakeLists.txt, it still 
> reports the error as shown below:
> 
> CMake Error: Can not find 
> C:/shen/ITKSamples/FastMarchingLevelSetSrc/FastMarchingLevelSetBase.cxx; 
> FastMarchingLevelSet.cxx
> 
>  
> 
> Any ideas what happened?
> 
>  
> 
> /Weicheng Shen, Ph.D./
> 
> /Senior Scientist/
> 
> /Science Applications International Corporation/
> 
> /1710 SAIC Drive/
> 
> /MailStop //2-3-1///
> 
> /McLean//, //VA// //22102///
> 
> /(703) 676-4189/
> 
>  //
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users





More information about the Insight-users mailing list