Skip to content
marcelluethi edited this page Oct 22, 2012 · 2 revisions

The easiest way to use Statismo from your own application is by using CMake. Statismo provides the file statismo-config.cmake, which sets up the variables STATISMO_LIBARY_DIR, STATISMO_LIBRARIES and STATISMO_INCLUDE_DIRS, which you can use in your own project. The file can be found in the folder lib/cmake/statismo-0.8 in your installation directory.

A simple CMakeLists file to compile the Shape model example looks like this.

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(example)

FIND_PACKAGE(STATISMO REQUIRED)

FIND_PACKAGE(VTK REQUIRED)
include (${VTK_USE_FILE})
set(VTK_LIBRARIES
        vtkCommon 
        vtkFiltering 
        vtkGraphics 
        vtkImaging 
        vtkIO 
        vtkRendering 
        vtkWidgets 
)

FILE(GLOB INCLUDE_FILES *.h)
FILE(GLOB SOURCE_FILES  *.txx *.cpp)

include_directories(${STATISMO_INCLUDE_DIRS} ${VTK_INCLUDE_DIR})
link_directories(${STATISMO_LIBRARY_DIR} ${VTK_LIBRARY_DIR})
 
add_executable (vtkBuildShapeModelExample BuildShapeModelExample.cxx) 
target_link_libraries (vtkBuildShapeModelExample ${STATISMO_LIBRARIES} ${VTK_LIBRARIES})

Clone this wiki locally