$wgGroupPermissions['user']['read'] = true; $wgGroupPermissions['*']['read'] = true; Migration Guide 3.1 to 3.2 - Forge Wiki
SCM

Migration Guide 3.1 to 3.2

From Forge Wiki

Jump to: navigation, search

This page explains how to configure your 3.1 built-in CamiTK code to work on the new 3.2 version.

Contents

Prerequisite

First of all, make sure you have compiled and installed CamiTK 3.2 on your computer. Please follow the installation guide on the left panel to compile and install CamiTK 3.2.

As you may have noticed, the main new evolution in CamiTK 3.2 is the CamiTK Extension Project (CEP) architecture. Feel free to read some information regarding the CEP concept and, more generally the CamiTK architecture.

At this step you need to have a local or global installed CamiTK on your computer. Follow the next explanations to migrate your code on the 3.2 version, and therefore introduce the CEP organisation in your work. It is really worth it.


For Windows, CamiTK 3.2 provides a clear separation between debug and release versions. CamiTK 3.2 can therefore be used parallely in debug and release version. Please refer the installation instruction: you need to recompile CamiTK dependency libraries (VTK,ITK...)

Create a CEP

Now that you are familiar with the CEP concept you may create one for your project.
To do so, you may use the camitk-wizard application in order to generate your basic CEP architecture. Else, you may want to download the CEP structure (rename the skel folder into src)

Open the src/CmakeList.txt file and fill the NAME, CONTACT and DESCRIPTION tags in the following lines :

camitk_extension_project(NAME "" # Either remove this option or fill the quotes
                         CONTACT "GivenName.FamilyName@imag.fr" # TODO update this
                         DESCRIPTION "CEP Skeleton. Once copied you should really update this line..." # TODO update this
                         ENABLED
)


This information are your basic CEP information, and are required for the next configuration step.

Import your 3.1 version extensions

CEP source structure

The CEP architecture contains several folders, each of them containing a type of extension : actions, components, applications, viewers and libraries.

Copy the folder with the source code

You will then import each of your 3.1 built-in extensions into the corresponding folder. For each CamiTK 3.1 (or earlier) extension you have built, copy the folder containing the source code (the one that contains the .h, .cpp source files and a CMakeLists.txt file) into the corresponding folder of the CEP.

Update the CMakeLists.txt files

As the CamiTK architecture (not the API) has changed in version 3.2, CMake configuration has to be changed to consider these modifications in order to correctly configure your project. You will only have to modify some lines of each of your CMakeLists.txt files.

Action & Component CMakeLists.txt file

Here is a default example of simple old CMakeLists.txt file for an action or component in CamiTK 3.1.

  # OBSOLETE CamiTK 3.1 CMakeLists.txt
  cmake_minimum_required(VERSION 2.6)
  project(actionextensionexample)
  include(FindCamiTK.cmake)
  include(CreateLaunchers)
 
  # Call CamiTK CMake Macro to define the action
  camitk_extension( ACTION_EXTENSION
  DEFAULT
  )
 
  # For Microsoft Visual C++, sets the default application to imp for the "ALL_BUILD" project
  # (i.e. launches imp when we you click on "Debug" or "Start Without Debugging" button on Visual)
  # In addition, but not the least, sets the environment to the debug dll directory for VTK (and ITK)
  # to solve the dll incompatibility between debug and relase version of QVTK.dll and ITKCommon.dll
  if ( MSVC )
  create_default_target_launcher_special(
  "imp"
  EXTERNAL_COMMAND "${CAMITK_BIN_DIR}$(OutDir)/imp.exe"
  RUNTIME_LIBRARY_DIRS "${CAMITK_BIN_DIR}$(OutDir)" "%VTK_DIR%/bin/$(OutDir)" "%ITK_DIR%/bin/$(OutDir)"
  ) 
  endif()

Please replace it with this simpler version for CamiTK 3.2:

  • For an action:
# Updated CMakeLists.txt for CamiTK 3.2
# Call CamiTK CMake Macro to define the extension
camitk_extension(   ACTION_EXTENSION
                    CEP_NAME # fill it with your CEP_NAME
                    DESCRIPTION # fill it with your action description
                )
  • For a component:
# Updated CMakeLists.txt for CamiTK 3.2
# Call CamiTK CMake Macro to define the extension
camitk_extension(   COMPONENT_EXTENSION
                    CEP_NAME # fill it with your CEP_NAME
                    DESCRIPTION # fill it with your component description
                )

You may fill the CEP_NAME and DESCRIPTION fields which will be used for packaging presentation of your CEP.


You will notice the 3.2 CMakeLists.txt file is simpler

Application CMakeLists.txt file

Similarly, here is the simple modification to consider for an application extension. A default application old CMakeLists.txt file content for CamiTK 3.1:

# OBSOLETE CamiTK 3.1 CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
project(myapplication)
include(FindCamiTK.cmake)
include(CreateLaunchers)
 
# Call CamiTK CMake Macro to define the action
camitk_application( DEFAULT )
 
# For Microsoft Visual C++, sets the default application to imp for the "ALL_BUILD" project
# (i.e. launches imp when we you click on "Debug" or "Start Without Debugging" button on Visual)
# In addition, but not the least, sets the environment to the debug dll directory for VTK (and ITK)
#     to solve the dll incompatibility between debug and relase version of QVTK.dll and ITKCommon.dll
if ( MSVC )
create_default_target_launcher_special(
"imp"
EXTERNAL_COMMAND "${CAMITK_BIN_DIR}$(OutDir)/imp.exe"
RUNTIME_LIBRARY_DIRS "${CAMITK_BIN_DIR}$(OutDir)" "%VTK_DIR%/bin/$(OutDir)" "%ITK_DIR%/bin/$(OutDir)"
) 
endif()

You may simplify it with this content:

# Updated CMakeLists.txt for CamiTK 3.2
# Call CamiTK CMake Macro to define the action
camitk_application( DEFAULT )

Configure your CEP

CEP source structure

As for the CamiTK opensource framework configuration, you will use CMake tool to configure your source file into the build directory. If you don't have yet, create a build directory at the same level of your src source folder, as shown on the right picture.

  • Launch the cmake tool, and provide the src and build directories of your CEP structure.
  • Click on the configure button. Your CEP will look for the camitk-config application installed on your platform. One of the goal of this application is to look for the latest install version of the CamiTK opensource framework on your computer. This is why you need to have an installed version of the 3.2 version of CamiTK BEFORE creating your CEP.
  • Open your project generated in your build directory (with Visual Studio, KDevelop ...) and compile it.
Powered By FusionForge