Computer Assited Medical Intervention Tool Kit  version 4.1
CamiTKExtension.h
Go to the documentation of this file.
1 # possible values : ACTION_EXTENSION or COMPONENT_EXTENSION.
91 
92 
93  # Instruct CMake to run moc automatically when needed.
94  set(CMAKE_AUTOMOC ON)
95 
96 
97 
98  #########################################################################
99  # #
100  # ARGUMENTS PARSING #
101  # #
102  # * Use a macro to create the CMAKE variables according to the #
103  # provided options as input. #
104  # #
105  #########################################################################
106 
107  get_directory_name(${CMAKE_CURRENT_SOURCE_DIR} EXTENSION_NAME)
108 
109  set(options ACTION_EXTENSION COMPONENT_EXTENSION DISABLED NEEDS_XERCESC NEEDS_ITK NEEDS_LIBXML2 NEEDS_XSD NEEDS_OPENCV NEEDS_IGSTK INSTALL_ALL_HEADERS NEEDS_GDCM ENABLE_AUTO_TEST ENABLE_INTEGRATION_TEST)
110  set(oneValueArgs TARGET_NAME CEP_NAME DESCRIPTION AUTO_TEST_LEVEL)
111  set(multiValueArgs NEEDS_TOOL NEEDS_CEP_LIBRARIES NEEDS_COMPONENT_EXTENSION NEEDS_ACTION_EXTENSION INCLUDE_DIRECTORIES EXTERNAL_LIBRARIES HEADERS_TO_INSTALL DEFINES CXX_FLAGS EXTERNAL_SOURCES EXTRA_TRANSLATE_LANGUAGE TEST_FILES)
112  cmake_parse_arguments(${EXTENSION_NAME_CMAKE} "${options}" "${oneValueArgs}"
113  "${multiValueArgs}" ${ARGN} )
114 
115  #########################################################################
116  # #
117  # CREATE CMAKE VARIABLES #
118  # #
119  # * Create required and useful CMake variables for the macro #
120  # #
121  #########################################################################
122 
123  # TYPE EXTENSION : ACTION or COMPONENT
124  if (${EXTENSION_NAME_CMAKE}_ACTION_EXTENSION)
125  set(TYPE_EXTENSION "action")
126  string(TOUPPER ${TYPE_EXTENSION} TYPE_EXTENSION_CMAKE)
127  elseif(${EXTENSION_NAME_CMAKE}_COMPONENT_EXTENSION)
128  set(TYPE_EXTENSION "component")
129  string(TOUPPER ${TYPE_EXTENSION} TYPE_EXTENSION_CMAKE)
130  endif()
131 
132  # CMAKE CACHE VARIABLE
133  # if it is the first cmake run, create the extension variable with a correct initial value
134  if(NOT ${TYPE_EXTENSION_CMAKE}_${EXTENSION_NAME_CMAKE}_INTERNAL)
135  # add option to enable/disable this extension and set it to true by default
136  # Building the extension can be disabled by giving the argument DISABLED to the macro
137  # or by passing the flag -D${TYPE_EXTENSION_CMAKE}_${EXTENSION_NAME_CMAKE}_DISABLED:BOOL=TRUE
138  if(${EXTENSION_NAME_CMAKE}_DISABLED)
139  set(${TYPE_EXTENSION_CMAKE}_${EXTENSION_NAME_CMAKE}_ENABLED FALSE)
140  else()
141  set(${TYPE_EXTENSION_CMAKE}_${EXTENSION_NAME_CMAKE}_ENABLED TRUE)
142  endif()
143  set(${TYPE_EXTENSION_CMAKE}_${EXTENSION_NAME_CMAKE} ${${TYPE_EXTENSION_CMAKE}_${EXTENSION_NAME_CMAKE}_ENABLED} CACHE BOOL "Build extension ${EXTENSION_NAME}")
144  set(${TYPE_EXTENSION_CMAKE}_${EXTENSION_NAME_CMAKE}_INTERNAL TRUE CACHE INTERNAL "Is variable ${TYPE_EXTENSION_CMAKE}_${EXTENSION_NAME} already created?")
145  endif()
146 
147  # if this extension is enabled, do everything needed
148  # otherwise... do nothing
149  if (${TYPE_EXTENSION_CMAKE}_${EXTENSION_NAME_CMAKE})
150 
151  # TARGET NAME
152  # The target name is composed of the following: [action / component]-name
153  # * action / component is the type of extension as prefix
154  # * name is deduced from the input folder containing the calling CMakeLists.txt file of the extension.
155  if (${EXTENSION_NAME_CMAKE}_TARGET_NAME)
156  set(${TYPE_EXTENSION_CMAKE}_OUTPUT_NAME ${${EXTENSION_NAME_CMAKE}_TARGET_NAME})
157  else()
158  set(${TYPE_EXTENSION_CMAKE}_OUTPUT_NAME ${EXTENSION_NAME})
159  endif()
160  # replace "-" by "_" if the extension is being packaged with NSIS, the program to create a Windows installer.
161  if (PACKAGING_NSIS)
162  # NSIS requires that cpack component names do not feature space or "-" characters
163  set(${TYPE_EXTENSION_CMAKE}_TARGET_NAME ${TYPE_EXTENSION}_${${TYPE_EXTENSION_CMAKE}_OUTPUT_NAME})
164  else()
165  set(${TYPE_EXTENSION_CMAKE}_TARGET_NAME ${TYPE_EXTENSION}-${${TYPE_EXTENSION_CMAKE}_OUTPUT_NAME})
166  endif()
167 
168  message(STATUS "Building extension ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}")
169 
170  # EXTENSION_PLUGIN_FILE
171  # determine the extension full file name depending on the plateform
172  set(EXTENSION_PLUGIN_FILE "${CAMITK_BUILD_PRIVATE_LIB_DIR}/${TYPE_EXTENSION}s")
173  if (MSVC)
174  set(EXTENSION_PLUGIN_FILE ${EXTENSION_PLUGIN_FILE}/${${TYPE_EXTENSION_CMAKE}_OUTPUT_NAME}${CAMITK_DEBUG_POSTFIX}.dll)
175  elseif(APPLE)
176  set(EXTENSION_PLUGIN_FILE ${EXTENSION_PLUGIN_FILE}/lib${${TYPE_EXTENSION_CMAKE}_OUTPUT_NAME}.dylib)
177  else()
178  # Must be Linux
179  set(EXTENSION_PLUGIN_FILE ${EXTENSION_PLUGIN_FILE}/lib${${TYPE_EXTENSION_CMAKE}_OUTPUT_NAME}.so)
180  endif()
181 
182  #########################################################################
183  # #
184  # INCLUDE DIRECTORIES #
185  # #
186  # * Include basic directories where to look header files #
187  # * Include also additional user provided directories #
188  # * These directories are used for compilation step #
189  # #
190  #########################################################################
191  # BASIC DIRECTORIES
192 
193  include_directories(${CAMITK_INCLUDE_DIRECTORIES})
194  include_directories(${CMAKE_CURRENT_BINARY_DIR})
195  include_directories(${CMAKE_CURRENT_SOURCE_DIR})
196 
197  # USER INPUT DIRECTORIES
198  include_directories(${${EXTENSION_NAME_CMAKE}_INCLUDE_DIRECTORIES})
199 
200 
201 
202  #########################################################################
203  # #
204  # GATHER RESSOURCES #
205  # #
206  # * Get all the headers (.h) and source files (.cpp) of the project #
207  # * Create the needed Qt files (using moc and uic) #
208  # * On Windows, Visual Studio, group .moc and .ui files #
209  # in subdirectories #
210  # #
211  #########################################################################
212 
213  # get all headers, sources and do what is needed for Qt
214  # one need to do this just before the add_library so that all defines, include directories and link directories
215  # are set properly (gather_headers_and_sources include the call to Qt moc and uic)
216  gather_headers_and_sources(${EXTENSION_NAME_CMAKE})
217 
218 
219 
220  #########################################################################
221  # #
222  # ADDITIONAL KNOWN EXTERNAL LIBRARY DEPENDENCIES #
223  # #
224  # * Look for specific library needed #
225  # * Specific libraries are specified as option with the #
226  # NEEDS_LIBRARY syntax (see macro syntax for more options) #
227  # * Backward compatibility : Warn user if using old NEEDS_TOOL syntax #
228  # #
229  #########################################################################
230 
231  # Looking for ITK
232  set(ITK_LIBRARIES "")
233  if(${EXTENSION_NAME_CMAKE}_NEEDS_ITK)
234  find_package(ITK REQUIRED PATHS /usr/lib/InsightToolkit)
235  if(ITK_FOUND)
236  include(${ITK_USE_FILE})
237  set(ITK_VERSION ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}) #ITK_VERSION is not always set
238  set(CAMITK_ITK_VERSION ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR})
239  message(STATUS "${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}: Found ITK version ${ITK_VERSION}")
240 
241  if ((${ITK_VERSION} VERSION_GREATER "4") AND (${ITK_VERSION} VERSION_LESS "5")) # ITK 4.9 on Windows, maybe a lesser version for Linux.
242  if(MSVC)
243  set(ITK_DIR ${ITK_DIR}/../..)
244  # Construct list of ITK libraries for linking = CAMITK_ITK_LIBRARIES
245  foreach(ITK_LIBRARY ${ITK_LIBRARIES})
246  string(SUBSTRING ${ITK_LIBRARY} 0 3 ${ITK_LIBRARY}_PREFIX)
247  # Some libraries have not the expected 'itk' prefix. Add it then
248  if((NOT ${${ITK_LIBRARY}_PREFIX} STREQUAL "itk") AND (NOT ${${ITK_LIBRARY}_PREFIX} STREQUAL "ITK"))
249  set(ITK_LIBRARY itk${ITK_LIBRARY})
250  endif()
251  list(APPEND CAMITK_ITK_LIBRARIES debug ${ITK_DIR}/${ITK_LIBRARY}-${CAMITK_ITK_VERSION}${CAMITK_DEBUG_POSTFIX}.lib optimized ${ITK_DIR}/${ITK_LIBRARY}-${CAMITK_ITK_VERSION}.lib)
252  endforeach()
253  elseif(UNIX)
254  set(CAMITK_ITK_LIBRARIES ${ITK_LIBRARIES})
255  elseif(APPLE)
256  message(WARNING "CamiTKExtension.cmake: ITK LIBRARY NOT SET FOR APPLE")
257  endif()
258  else()
259  message(FATAL_ERROR "Wrong version of ITK : ${ITK_VERSION}. Required is at least 4.x to 4.9")
260  endif()
261  else()
262  message(FATAL_ERROR "ITK not found but required for ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}")
263  endif()
264  endif()
265 
266  # LIBXML2
267  set(LIBXML2_LIBRARY "")
268  if(${EXTENSION_NAME_CMAKE}_NEEDS_LIBXML2)
269  # LibXml2 is required
270  find_package(Xml2)
271  if (LIBXML2_FOUND)
272  add_definitions(${LIBXML2_DEFINITIONS})
273  include_directories(${LIBXML2_INCLUDE_DIR})
274  set(LIBXML2_LIBRARY ${LIBXML2_LIBRARIES})
275  else()
276  # most probably win32 or crosscompiling
277  message(STATUS "${EXTENSION_NAME}: libxml2 required")
278  endif()
279  endif()
280 
281  # OPENCV
282  set(OpenCV_LIBRARIES "")
283  if(${EXTENSION_NAME_CMAKE}_NEEDS_OPENCV)
284  # OpenCV is required
285  find_package( OpenCV REQUIRED )
286  else ( )
287  set(OpenCV_LIBRARIES "")
288  endif()
289 
290  # IGSTK
291  set(IGSTK_LIBRARIES "")
292  if(${EXTENSION_NAME_CMAKE}_NEEDS_IGSTK)
293  find_package(IGSTK REQUIRED)
294  include(${IGSTK_USE_FILE})
295  else()
296  set(IGSTK_LIBRARIES "")
297  endif()
298 
299  # XERCES-C
300  set(XERCESC_LIBRARIES)
301  if(${EXTENSION_NAME_CMAKE}_NEEDS_XERCESC)
302  # XercesC is required
303  if (NOT XERCESC_LIBRARY)
304  find_package(XercesC REQUIRED)
305  endif()
306  if (XERCESC_FOUND)
307  include_directories(${XERCESC_INCLUDE_DIR})
308  set(XERCESC_LIBRARIES ${XERCESC_LIBRARY})
309  else()
310  # most probably win32 or crosscompiling
311  message(FATAL_ERROR "${EXTENSION_NAME}: xerces-c required. Please provide Xerces-C path.")
312  endif()
313  endif()
314 
315  # XSD
316  if(${EXTENSION_NAME_CMAKE}_NEEDS_XSD)
317  # XercesC is required
318  if (NOT XERCESC_LIBRARY)
319  find_package(XercesC REQUIRED)
320  endif()
321  find_package(XercesC REQUIRED)
322  if (XERCESC_FOUND)
323  include_directories(${XERCESC_INCLUDE_DIR})
324  set(XERCESC_LIBRARIES ${XERCESC_LIBRARY})
325  find_package(XSD REQUIRED)
326  include_directories(${XSD_INCLUDE_DIR})
327  else()
328  # most probably win32 or crosscompiling
329  message(FATAL_ERROR "${EXTENSION_NAME}: xerces-c required because of XSD cxx, please set XERCESC_INCLUDE_DIR")
330  endif()
331  endif()
332 
333  # GDCM 2.2.x
334  set(GDCM_LIBRARIES)
335  if(${EXTENSION_NAME_CMAKE}_NEEDS_GDCM)
336  if(NOT GDCM_FOUND)
337  # Look for GDCM library only if not found (for instance, ITK has already search for it)
338  # Calling find_package(GDCM ..) more than once creates CMake errors.
339  find_package(GDCM 2.0 REQUIRED)
340  endif()
341  if(GDCM_FOUND)
342  include(${GDCM_USE_FILE})
343  if (MSVC)
344  set(GDCM_LIBRARIES
345  debug ${GDCM_DIR}/../gdcmcharls${CAMITK_DEBUG_POSTFIX}.lib
346  debug ${GDCM_DIR}/../gdcmCommon${CAMITK_DEBUG_POSTFIX}.lib
347  debug ${GDCM_DIR}/../gdcmDICT${CAMITK_DEBUG_POSTFIX}.lib
348  debug ${GDCM_DIR}/../gdcmDSED${CAMITK_DEBUG_POSTFIX}.lib
349  debug ${GDCM_DIR}/../gdcmexpat${CAMITK_DEBUG_POSTFIX}.lib
350  debug ${GDCM_DIR}/../gdcmgetopt${CAMITK_DEBUG_POSTFIX}.lib
351  debug ${GDCM_DIR}/../gdcmIOD${CAMITK_DEBUG_POSTFIX}.lib
352  debug ${GDCM_DIR}/../gdcmjpeg8${CAMITK_DEBUG_POSTFIX}.lib
353  debug ${GDCM_DIR}/../gdcmjpeg12${CAMITK_DEBUG_POSTFIX}.lib
354  debug ${GDCM_DIR}/../gdcmjpeg16${CAMITK_DEBUG_POSTFIX}.lib
355  debug ${GDCM_DIR}/../gdcmMEXD${CAMITK_DEBUG_POSTFIX}.lib
356  debug ${GDCM_DIR}/../gdcmMSFF${CAMITK_DEBUG_POSTFIX}.lib
357  debug ${GDCM_DIR}/../gdcmopenjpeg${CAMITK_DEBUG_POSTFIX}.lib
358  debug ${GDCM_DIR}/../gdcmzlib${CAMITK_DEBUG_POSTFIX}.lib
359  debug ${GDCM_DIR}/../socketxx${CAMITK_DEBUG_POSTFIX}.lib
360  debug ${GDCM_DIR}/../vtkgdcm${CAMITK_DEBUG_POSTFIX}.lib
361  debug ${GDCM_DIR}/../gdcmDSED${CAMITK_DEBUG_POSTFIX}.lib
362  optimized gdcmcharls gdcmCommon gdcmDICT gdcmDSED gdcmexpat
363  optimized gdcmgetopt gdcmIOD gdcmjpeg8 gdcmjpeg12 gdcmjpeg16
364  optimized gdcmMEXD gdcmMSFF gdcmopenjpeg gdcmzlib socketxx vtkgdcm
365  optimized gdcmDSED
366  )
367  else()
368  set(GDCM_LIBRARIES gdcmCommon gdcmDICT gdcmDSED gdcmMEXD gdcmMSFF vtkgdcm)
369  endif()
370  else()
371  message(ERROR "${EXTENSION_NAME}: GDCM 2.x library required. Please install GDCM.")
372  endif()
373  endif()
374 
375  # EXTERNAL LIBRARIES
376  set(EXTERNAL_LIBRARIES)
377  if(${EXTENSION_NAME_CMAKE}_EXTERNAL_LIBRARIES)
378  foreach(EXTERNAL_LIBRARY ${${EXTENSION_NAME_CMAKE}_EXTERNAL_LIBRARIES})
379  if (MSVC)
380  list(APPEND EXTERNAL_LIBRARIES ${EXTERNAL_LIBRARIES}
381  debug ${EXTERNAL_LIBRARY}${CAMITK_DEBUG_POSTFIX}.lib
382  optimized ${EXTERNAL_LIBRARY}.lib
383  )
384  else()
385  list(APPEND EXTERNAL_LIBRARIES ${EXTERNAL_LIBRARY})
386  endif()
387  endforeach()
388  endif()
389 
390 
391 
392  #########################################################################
393  # #
394  # LINK DIRECTORIES #
395  # #
396  # * Link directories are used to indicate the compiler where #
397  # to look for folder containing libraries to link with. #
398  # * Must be done BEFORE creating the CMake target with add_library #
399  # #
400  #########################################################################
401 
402  # CAMITK BASIC LIB DIRECTORIES
403  link_directories(${CAMITK_LINK_DIRECTORIES})
404 
405 
406 
407  #########################################################################
408  # #
409  # TARGET COMPILATION DEFINITION #
410  # #
411  # * Additional sources files to consider at compilation (.cpp) #
412  # * CMake project target definition #
413  # #
414  #########################################################################
415  # EXTERNAL SOURCES
416  set(${EXTENSION_NAME_CMAKE}_SOURCES ${${EXTENSION_NAME_CMAKE}_SOURCES} ${${EXTENSION_NAME_CMAKE}_EXTERNAL_SOURCES})
417 
418  # CMAKE TARGET DEFINITION
419  add_library(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} SHARED ${${EXTENSION_NAME_CMAKE}_SOURCES})
420 
421 
422 
423  #########################################################################
424  # #
425  # QT LINKING LIBRARIES #
426  # #
427  # * Set at linking the Qt5 libraries #
428  # #
429  #########################################################################
430  qt5_use_modules(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} ${CAMITK_QT_COMPONENTS})
431 
432 
433 
434  #########################################################################
435  # #
436  # CAMITK ACTION / COMPONENT / LIBRARIES DEPENDENCIES #
437  # #
438  # * Look for action / component / libraries dependencies #
439  # * Specific actions / components / libraries are specified as option #
440  # with the NEEDS_ACTION/COMPONENT_EXTENSION/CEP_LIBRARIES syntax #
441  # * Add dependencies to library-camitkcore and the testing #
442  # action/component if test are runned on it #
443  # #
444  #########################################################################
445 
446  # 1st CAMITKCORE LIBRARY DEPENDENCY
447  # add_dependencies(..) is only needed to enable parallel build during SDK build
448  # but generates an error for external CEP, where this target does not
449  # exists.
450  # Using target_link_libraries(..) is enough to link the extension to the CamiTK core library
451  if(CAMITK_COMMUNITY_EDITION_BUILD)
452  add_dependencies(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} ${CAMITK_CORE_TARGET_LIB_NAME})
453  # add the dependency to the core automoc target only if inside a SDK build
454  set_property(TARGET ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS ${CAMITK_CORE_TARGET_LIB_NAME})
455  endif()
456 
457 
458  # 2nd COMPONENTS DEPENDENCIES
459  if(${EXTENSION_NAME_CMAKE}_NEEDS_COMPONENT_EXTENSION)
460  set(COMPONENTS_DEPENDENCY_LIST "") #use for generating the project.xml file
461  foreach(COMPONENT_NEEDED ${${EXTENSION_NAME_CMAKE}_NEEDS_COMPONENT_EXTENSION})
462  # include directories from build, camitk (local or global install).
463  include_directories(${CAMITK_BUILD_INCLUDE_DIR}/components/${COMPONENT_NEEDED})
464  include_directories(${CAMITK_INCLUDE_DIR}/components/${COMPONENT_NEEDED})
465  # file dependency
466  if (MSVC)
467  list(APPEND COMPONENT_EXTENSION_LIBRARIES debug ${CAMITK_BUILD_PRIVATE_LIB_DIR}/components/${COMPONENT_NEEDED}${CAMITK_DEBUG_POSTFIX}.lib
468  optimized ${COMPONENT_NEEDED}
469  )
470  else()
471  list(APPEND COMPONENT_EXTENSION_LIBRARIES ${COMPONENT_NEEDED})
472  endif()
473  # CMake / CDash dependencies
474  if(PACKAGING_NSIS)
475  add_dependencies(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} component_${COMPONENT_NEEDED})
476  # add the dependency to the component automoc target only if compiling SDK
477  if(CAMITK_COMMUNITY_EDITION_BUILD)
478  set_property(TARGET ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS component_${COMPONENT_NEEDED})
479  endif()
480  else()
481  add_dependencies(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} component-${COMPONENT_NEEDED})
482  list(APPEND COMPONENTS_DEPENDENCY_LIST component-${COMPONENT_NEEDED})
483  # add the dependency to the component automoc target only if compiling SDK
484  if(CAMITK_COMMUNITY_EDITION_BUILD)
485  set_property(TARGET ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS component-${COMPONENT_NEEDED})
486  endif()
487  endif()
488  endforeach()
489  endif()
490 
491  # 3rd ACTIONS DEPENDENCIES
492  if(${EXTENSION_NAME_CMAKE}_NEEDS_ACTION_EXTENSION)
493  set(ACTIONS_DEPENDENCY_LIST "") #use for generating the project.xml file
494  foreach(ACTION_NEEDED ${${EXTENSION_NAME_CMAKE}_NEEDS_ACTION_EXTENSION})
495  # include directories from build, camitk (local or global install).
496  include_directories(${CAMITK_BUILD_INCLUDE_DIR}/actions/${ACTION_NEEDED})
497  include_directories(${CAMITK_INCLUDE_DIR}/actions/${ACTION_NEEDED})
498  # file dependency
499  if (MSVC)
500  list(APPEND ACTION_EXTENSION_LIBRARIES debug ${CAMITK_BUILD_PRIVATE_LIB_DIR}/actions/${ACTION_NEEDED}${CAMITK_DEBUG_POSTFIX}.lib
501  optimized ${ACTION_NEEDED}
502  )
503  else()
504  list(APPEND ACTION_EXTENSION_LIBRARIES ${ACTION_NEEDED})
505  endif()
506  # CMake / CDash dependencies
507  if (PACKAGING_NSIS)
508  add_dependencies(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} action_${ACTION_NEEDED})
509  # add the dependency to the component automoc target only if compiling SDK
510  if(CAMITK_COMMUNITY_EDITION_BUILD)
511  set_property(TARGET ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS action_${ACTION_NEEDED})
512  endif()
513  else()
514  add_dependencies(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} action-${ACTION_NEEDED})
515  list(APPEND ACTIONS_DEPENDENCY_LIST action-${ACTION_NEEDED})
516  # add the dependency to the component automoc target only if compiling SDK
517  if(CAMITK_COMMUNITY_EDITION_BUILD)
518  set_property(TARGET ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS action-${ACTION_NEEDED})
519  endif()
520  endif()
521  endforeach()
522  endif()
523 
524  # 4th CEP LIBRARIES DEPENDENCIES
525  if(${EXTENSION_NAME_CMAKE}_NEEDS_CEP_LIBRARIES)
526  set(CEP_LIBRARIES_DEPENDENCY_LIST "") #use for generating the project.xml file
527  foreach(CEP_LIBRARY_NEEDED ${${EXTENSION_NAME_CMAKE}_NEEDS_CEP_LIBRARIES})
528  # include directories from build, camitk (local or global install).
529  include_directories(${CAMITK_BUILD_INCLUDE_DIR}/libraries/${CEP_LIBRARY_NEEDED})
530  include_directories(${CAMITK_INCLUDE_DIR}/libraries/${CEP_LIBRARY_NEEDED})
531  # file dependency
532  if (MSVC)
533  list(APPEND CEP_LIBRARIES debug ${CEP_LIBRARY_NEEDED}${CAMITK_DEBUG_POSTFIX}.lib
534  optimized ${CEP_LIBRARY_NEEDED}
535  )
536  else()
537  list(APPEND CEP_LIBRARIES ${CEP_LIBRARY_NEEDED})
538  endif()
539  # CMake / CDash dependencies
540  if (PACKAGING_NSIS)
541  add_dependencies(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} library_${CEP_LIBRARY_NEEDED})
542  # add the dependency to the component automoc target only if compiling SDK
543  if(CAMITK_COMMUNITY_EDITION_BUILD)
544  set_property(TARGET ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS library_${CEP_LIBRARY_NEEDED})
545  endif()
546  else()
547  add_dependencies(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} library-${CEP_LIBRARY_NEEDED})
548  list(APPEND CEP_LIBRARIES_DEPENDENCY_LIST ${CEP_LIBRARY_NEEDED} library-${CEP_LIBRARY_NEEDED})
549  # add the dependency to the component automoc target only if compiling SDK
550  if(CAMITK_COMMUNITY_EDITION_BUILD)
551  set_property(TARGET ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS library-${CEP_LIBRARY_NEEDED})
552  endif()
553  endif()
554  endforeach()
555  endif()
556 
557  #########################################################################
558  # #
559  # COMPILATION FLAG #
560  # #
561  # * Flags are options to give to the compiler #
562  # * Add user input flags #
563  # * Add platform specific flags #
564  # #
565  #########################################################################
566 
567  # USER INPUT DEFINES COMPILER FLAG
568  if(${EXTENSION_NAME_CMAKE}_DEFINES)
569  foreach (FLAG ${${EXTENSION_NAME_CMAKE}_DEFINES})
570  add_definitions(-D${FLAG})
571  endforeach()
572  endif()
573 
574  # USER INPUT CUSTOM COMPILER FLAG
575  if(${EXTENSION_NAME_CMAKE}_CXX_FLAGS)
576  foreach (FLAG ${${EXTENSION_NAME_CMAKE}_CXX_FLAGS})
577  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG}")
578  endforeach()
579  endif()
580 
581  # PLATFORM SPECIFIC COMPILER FLAG
582  # 64bits and other platform with relocation needs -fPIC
583  include(TestCXXAcceptsFlag)
584  check_cxx_accepts_flag(-fPIC FPIC_FLAG_ACCEPTED)
585  # no need to add -fPIC on mingw, otherwise it generates a warning: -fPIC ignored for target (all code is position independent) [enabled by default]
586  # msvc is also accepting the flag, but then produce warning D9002 : ignoring unknown option '-fPIC' cl
587  if(FPIC_FLAG_ACCEPTED AND NOT WIN32)
588  set_property(TARGET ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} APPEND PROPERTY COMPILE_FLAGS -fPIC)
589  endif()
590 
591 
592 
593  #########################################################################
594  # #
595  # LINKING #
596  # #
597  # * Linking is the last stage of compilation #
598  # * Indicate what libraries to use for linking the target #
599  # #
600  #########################################################################
601  # LINKING LIBRARIES
602  # Any component or action has to be linked with ${CAMITK_CORE_LIBRARIES} and with all its dependencies
603  target_link_libraries(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} ${CAMITK_CORE_LIBRARIES} ${CAMITK_LIBRARIES} ${COMPONENT_EXTENSION_LIBRARIES} ${ACTION_EXTENSION_LIBRARIES} ${CEP_LIBRARIES} ${CAMITK_ITK_LIBRARIES} ${LIBXML2_LIBRARY} ${OpenCV_LIBRARIES} ${IGSTK_LIBRARIES} ${XERCESC_LIBRARIES} ${GDCM_LIBRARIES} ${EXTERNAL_LIBRARIES})
604 
605 
606 
607  #########################################################################
608  # #
609  # OUTPUT #
610  # #
611  # * Define the output directory (location and name) #
612  # * Define the output name of the library #
613  # * Add ${CAMITK_DEBUG_POSTFIX} suffix to Debug MSVC built libraries #
614  # * Additional Linux .so files information #
615  # #
616  #########################################################################
617 
618  # OUTPUT LIBRARY NAME
619  set_target_properties(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}
620  PROPERTIES OUTPUT_NAME ${${TYPE_EXTENSION_CMAKE}_OUTPUT_NAME}
621  )
622 
623  # OUTPUT DIRECTORY LOCATION AND NAME
624  # Output directory (all extensions are private)
625  set_target_properties(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CAMITK_BUILD_PRIVATE_LIB_DIR}/${TYPE_EXTENSION}s
626  LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CAMITK_BUILD_PRIVATE_LIB_DIR}/${TYPE_EXTENSION}s
627  LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CAMITK_BUILD_PRIVATE_LIB_DIR}/${TYPE_EXTENSION}s
628  )
629  # Output directory (for dll plateform, this is still the same, extensions are private)
630  set_target_properties(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CAMITK_BUILD_PRIVATE_LIB_DIR}/${TYPE_EXTENSION}s
631  RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CAMITK_BUILD_PRIVATE_LIB_DIR}/${TYPE_EXTENSION}s
632  RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CAMITK_BUILD_PRIVATE_LIB_DIR}/${TYPE_EXTENSION}s
633  )
634  # Output directory (for dll plateform, this is still the same, extensions are private)
635  set_target_properties(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CAMITK_BUILD_PRIVATE_LIB_DIR}/${TYPE_EXTENSION}s
636  ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CAMITK_BUILD_PRIVATE_LIB_DIR}/${TYPE_EXTENSION}s
637  ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CAMITK_BUILD_PRIVATE_LIB_DIR}/${TYPE_EXTENSION}s
638  )
639 
640  # OUTPUT LIBRARY NAME MSVC in DEBUG mode
641  if (MSVC)
642  set_target_properties(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} PROPERTIES DEBUG_POSTFIX ${CAMITK_DEBUG_POSTFIX})
643  endif()
644 
645  # ADDITIONAL LINUX .so FILE INFORMATION
646  set(${TYPE_EXTENSION_CMAKE}_LIBRARY_PROPERTIES ${${TYPE_EXTENSION_CMAKE}_LIBRARY_PROPERTIES}
647  VERSION "${CAMITK_VERSION_MAJOR}.${CAMITK_VERSION_MINOR}.${CAMITK_VERSION_PATCH}"
648  SOVERSION "${CAMITK_VERSION_MAJOR}"
649  )
650  # set the library specific info (SONAME...)
651  set_target_properties(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} PROPERTIES ${${TYPE_EXTENSION_CMAKE}_LIBRARY_PROPERTIES} LINK_INTERFACE_LIBRARIES "")
652 
653  # see http://www.cmake.org/pipermail/cmake/2012-April/049889.html
654  # target properties (outputname and remove soname)
655  # set_property(TARGET ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} PROPERTY NO_SONAME 1)
656  # in CEP the version patch might not have been set
657  if (NOT CAMITK_VERSION_PATCH)
658  set(CAMITK_VERSION_PATCH 0)
659  endif()
660 
661 
662 
663  #########################################################################
664  # #
665  # INSTALLATION #
666  # #
667  # * When installing the project, header files (.h) and test data are #
668  # copied into a installation folder to determine. #
669  # * Indicate in this section, where to install your project and which #
670  # files to copy into that folder (during local/global installation) #
671  # #
672  #########################################################################
673 
674  # FOLDER INSTALLATION
675  # Indicate where to install the action/component
676  install(TARGETS ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}
677  # TODO always use private lib, even for runtime
678  RUNTIME DESTINATION lib/${CAMITK_SHORT_VERSION_STRING}/${TYPE_EXTENSION}s
679  LIBRARY DESTINATION lib/${CAMITK_SHORT_VERSION_STRING}/${TYPE_EXTENSION}s
680  ARCHIVE DESTINATION lib/${CAMITK_SHORT_VERSION_STRING}/${TYPE_EXTENSION}s
681  COMPONENT ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}
682  )
683 
684  # HEADERS INSTALLATION
685  # Build target to install provided headers to install (with HEADERS_TO_INSTALL option)
686  if(${EXTENSION_NAME_CMAKE}_HEADERS_TO_INSTALL)
687  export_headers(${${EXTENSION_NAME_CMAKE}_HEADERS_TO_INSTALL} COMPONENT ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} GROUP ${TYPE_EXTENSION}s)
688  endif()
689 
690  # Build target to install all header files(with INSTALL_ALL_HEADERS option)
691  if(${EXTENSION_NAME_CMAKE}_INSTALL_ALL_HEADERS)
692  export_headers(${${EXTENSION_NAME_CMAKE}_HEADERS} COMPONENT ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} GROUP ${TYPE_EXTENSION}s)
693  endif()
694 
695  # TESTDATA INSTALLATION
696  if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/testdata")
697  # Check test data dir directory
698  if (NOT EXISTS ${CAMITK_BUILD_TESTDATA_DIR})
699  make_directory( ${CAMITK_BUILD_TESTDATA_DIR} )
700  endif()
701 
702  # copy the files to test data directory
703  execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory testdata ${CAMITK_BUILD_TESTDATA_DIR}
704  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
705  )
706 
707  # during installation, copy the files to install directory
708  set (TESTDATA_DEST_DIR share/${CAMITK_SHORT_VERSION_STRING}/testdata)
709  install(DIRECTORY testdata/
710  #DESTINATION share/testdata
711  #DESTINATION share/${CAMITK_SHORT_VERSION_STRING}/testdata
712  DESTINATION ${TESTDATA_DEST_DIR}
713  # COMPONENT ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}
714  PATTERN ".svn" EXCLUDE
715  PATTERN "*~" EXCLUDE
716  )
717  endif()
718 
719  #########################################################################
720  # #
721  # CDASH SUBPROJECT DESCRIPTION #
722  # #
723  # * Update the XML description of the subprojects dependencies #
724  # for CDash. #
725  # #
726  #########################################################################
727  # CDASH XML SUBPROJECTS DESCRIPTION UPDATE
728  camitk_register_subproject(${TYPE_EXTENSION_CMAKE} ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} DEPENDENCIES library-camitkcore ${COMPONENTS_DEPENDENCY_LIST} ${ACTIONS_DEPENDENCY_LIST} ${CEP_LIBRARIES_DEPENDENCY_LIST})
729 
730 
731 
732  #########################################################################
733  # #
734  # PACKAGING CATEGORIZATION #
735  # #
736  # * On Windows, when building a package (win32 installer), the #
737  # install shield wizard proposes you to select which component #
738  # to install. #
739  # * Each component to install has a short description following its #
740  # name to understand its role. #
741  # * This section deals with the categorization and the description #
742  # of the component in this installer. #
743  # #
744  #########################################################################
745 
746  # WINDOWS INSTALLER CATEGORIZATION
747  if(${EXTENSION_NAME_CMAKE}_CEP_NAME)
748  if (${EXTENSION_NAME_CMAKE}_CEP_NAME MATCHES "SDK")
749  # The default SDK extensions are categorized as "required" and are not "unselectable" by the user at installation time
750  cpack_add_component(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}
751  DISPLAY_NAME ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}
752  DESCRIPTION ${${EXTENSION_NAME_CMAKE}_DESCRIPTION}
753  REQUIRED
754  GROUP SDK
755  )
756 
757  else()
758  # Extension is selectable for installation in the wizard of the installer
759  cpack_add_component(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}
760  DISPLAY_NAME ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}
761  DESCRIPTION ${${EXTENSION_NAME_CMAKE}_DESCRIPTION}
762  GROUP ${${EXTENSION_NAME_CMAKE}_CEP_NAME}
763  )
764  endif()
765  else()
766  # Extension if not categorized for packaging presentation
767  cpack_add_component(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}
768  DISPLAY_NAME ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}
769  DESCRIPTION ${${EXTENSION_NAME_CMAKE}_DESCRIPTION}
770  )
771  endif()
772 
773 
774  #####################################################################################
775  # #
776  # TRANSLATION #
777  # #
778  # * CAMITK_TRANSLATIONS contains the list of language to translate #
779  # the QString to. #
780  # #
781  # * Create the translate.pro file which contains 4 sections: #
782  # - HEADERS: list of .h/.hpp files to look for tr("") QString #
783  # - SOURCES: list of .cpp files to look for tr("") QString #
784  # - FORMS: list of .ui files to look for tr("") QString #
785  # - TRANSLATIONS: list of .ts files which use CAMITK_TRANSLATIONS #
786  # to define each .ts file #
787  # #
788  # * Execute lupdate program to update the .ts files with new QString #
789  # found. #
790  # #
791  # * Execute lrelease program to create .qm files (binary equivalent of #
792  # .ts files #
793  # #
794  # * Create translate.qrc which contains the list of .qm files. #
795  # * Create the flags.qrc file which contains the list of .png flags #
796  # images #
797  # #
798  #####################################################################################
799  if(CAMITK_TRANSLATE)
800  if(${EXTENSION_NAME_CMAKE}_EXTRA_TRANSLATE_LANGUAGE)
801  if(${EXTENSION_NAME} STREQUAL "application")
802  camitk_translate(USE_FLAGS
803  EXTRA_LANGUAGE ${${EXTENSION_NAME_CMAKE}_EXTRA_TRANSLATE_LANGUAGE})
804  else()
805  camitk_translate(EXTRA_LANGUAGE ${${EXTENSION_NAME_CMAKE}_EXTRA_TRANSLATE_LANGUAGE})
806  endif()
807  else()
808  if(${EXTENSION_NAME} STREQUAL "application")
809  camitk_translate(USE_FLAGS)
810  else()
811  camitk_translate()
812  endif()
813  endif()
814  endif()
815 
816 
817 
818  #########################################################################
819  # #
820  # CTEST - COMPONENT TESTS DESCRIPTION #
821  # #
822  #########################################################################
823 
824  # if auto test possible and required
825  if (NOT PACKAGING_NSIS AND BUILD_TESTING AND ${EXTENSION_NAME_CMAKE}_ENABLE_AUTO_TEST)
826  if(${EXTENSION_NAME_CMAKE}_COMPONENT_EXTENSION)
827  camitk_init_test( camitk-testcomponents )
828 
829  camitk_parse_test_add_separator(EXTENSION_TYPE ${TYPE_EXTENSION} EXTENSION_NAME ${EXTENSION_NAME})
830 
831  # Retrieve the files in testdata directory - a test will be applied for each of these files
832  # or use only the given files
833  if (${EXTENSION_NAME_CMAKE}_TEST_FILES)
834  # add testdata dir to filename
835  set(TESTFILES)
836  foreach(COMPONENT_TESTDATA_FILE ${${EXTENSION_NAME_CMAKE}_TEST_FILES})
837  list(APPEND TESTFILES ${CMAKE_CURRENT_SOURCE_DIR}/${COMPONENT_TESTDATA_FILE})
838  endforeach()
839  else()
840  get_subdirectoryfiles( ${CMAKE_CURRENT_SOURCE_DIR}/testdata TESTFILES )
841  endif()
842 
843  if (NOT ${EXTENSION_NAME_CMAKE}_AUTO_TEST_LEVEL)
844  # default
845  set(TESTLEVEL 3)
846  else()
847  set(TESTLEVEL ${${EXTENSION_NAME_CMAKE}_AUTO_TEST_LEVEL})
848  if (NOT ${TESTLEVEL} MATCHES "^[1-3]")
849  # default
850  message(WARNING "AUTO_TEST_LEVEL set to 3 (${TESTLEVEL} is not a valid level)")
851  set(TESTLEVEL 3)
852  else()
853  set(TESTLEVEL ${${EXTENSION_NAME_CMAKE}_AUTO_TEST_LEVEL})
854  endif()
855  endif()
856 
857  # Different the test level are done automatically:
858  # - level 1: load component extension, open & close test data
859  # - level 2: load component extension, open & close test data, save as
860  # - level 3: load component extension, open & close test data, save as and compare input with output
861  # disable some tests accordingly to options defined in camitk_extension macro arguments
862  if(${TESTLEVEL} STREQUAL "1")
863  set(TEST_DESCRIPTION "Test loading the extension, opening and closing the component.")
864  elseif(${TESTLEVEL} STREQUAL "2")
865  set(TEST_DESCRIPTION "Test loading the extension, opening the component and saving it as a file.")
866  else()
867  # level 3
868  set(TEST_DESCRIPTION "Test loading the extension, opening, saving and closing the component and comparing saved with input component.")
869  endif()
870 
871  foreach(COMPONENT_TESTDATA_FILE ${TESTFILES})
872  # Give the file name (full path)
873  get_directory_name(${COMPONENT_TESTDATA_FILE} DATA_FILE)
874 
875  # Test procedure: Open an extension and a component- save it - Compare saved file to original file(level3)
876  if(${TESTLEVEL} EQUAL 3)
877  # Level 3 = level 2 + test the output -> test level 2 + add the PASS_FILE_OUTPUT options to the test
878  camitk_add_test(EXECUTABLE_ARGS "-i ${CAMITK_BUILD_TESTDATA_DIR}/${DATA_FILE} -c ${EXTENSION_PLUGIN_FILE} -l 2"
879  PASS_FILE_OUTPUT ${CAMITK_BUILD_TESTDATA_DIR}/${DATA_FILE}
880  TEST_SUFFIX "-level3-"
881  PROJECT_NAME ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}
882  )
883  endif()
884 
885  if(${TESTLEVEL} EQUAL 2)
886  camitk_add_test(EXECUTABLE_ARGS "-i ${CAMITK_BUILD_TESTDATA_DIR}/${DATA_FILE} -c ${EXTENSION_PLUGIN_FILE} -l 2"
887  TEST_SUFFIX "-level2-"
888  PROJECT_NAME ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}
889  )
890  endif()
891 
892  if(${TESTLEVEL} EQUAL 1)
893  camitk_add_test(EXECUTABLE_ARGS "-i ${CAMITK_BUILD_TESTDATA_DIR}/${DATA_FILE} -c ${EXTENSION_PLUGIN_FILE} -l 1"
894  TEST_SUFFIX "-level1-"
895  PROJECT_NAME ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}
896  )
897  endif()
898 
899  camitk_parse_test_add(NAME ${CAMITK_TEST_NAME} LEVEL ${TESTLEVEL} DESCRIPTION ${TEST_DESCRIPTION})
900  endforeach()
901 
902  #########################################################################
903  # #
904  # CTEST - ACTION TESTS DESCRIPTION #
905  # #
906  #########################################################################
907  # We do not apply automatic tests on actions like (close, save, save as) as they
908  # may not act directly on components
909  elseif( ${EXTENSION_NAME_CMAKE}_ACTION_EXTENSION AND NOT (${${TYPE_EXTENSION_CMAKE}_OUTPUT_NAME} MATCHES "application"))
910  camitk_init_test( camitk-testactions )
911 
912  camitk_parse_test_add_separator(EXTENSION_TYPE ${TYPE_EXTENSION} EXTENSION_NAME ${EXTENSION_NAME})
913 
914  # get the names of actions .dlls in lib directory
915  get_subdirectoryfiles( ${CAMITK_BUILD_PRIVATE_LIB_DIR}/actions/ ACTIONSDLLS )
916 
917  # Retrieve the files in testdata directory - a test will be applied for each of these files
918  # or use only the given files
919  if (${EXTENSION_NAME_CMAKE}_TEST_FILES)
920  # add testdata dir to filename
921  set(TESTFILES)
922  foreach(ACTION_TESTDATA_FILE ${${EXTENSION_NAME_CMAKE}_TEST_FILES})
923  list(APPEND TESTFILES ${CAMITK_BUILD_TESTDATA_DIR}/${ACTION_TESTDATA_FILE})
924  endforeach()
925  else()
926  get_subdirectoryfiles(${CAMITK_BUILD_TESTDATA_DIR} TESTFILES)
927  endif()
928 
929  foreach( ACTION_TESTDATA_FILE ${TESTFILES})
930  # Test procedure: Open a file - load an action extension - Apply an action on the component wrapping the file
931  camitk_add_test(EXECUTABLE_ARGS "-i ${ACTION_TESTDATA_FILE} -a ${EXTENSION_PLUGIN_FILE}"
932  TEST_SUFFIX "-level1-"
933  PROJECT_NAME ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}
934  )
935  camitk_parse_test_add(NAME ${CAMITK_TEST_NAME} LEVEL 1 DESCRIPTION "Open a file, load the action and apply it on the component.")
936  endforeach()
937  endif()
938  endif() # NOT PACKAGING_NSIS AND BUILD_TESTING AND ${EXTENSION_NAME_CMAKE}_ENABLE_AUTO_TEST)
939 
940  #########################################################################
941  # #
942  # CTEST - Integration test #
943  # #
944  #########################################################################
945 
946  if (NOT PACKAGING_NSIS AND BUILD_TESTING AND ${EXTENSION_NAME_CMAKE}_ENABLE_INTEGRATION_TEST)
947  # add a specific test to run the action, save the output and compare it to expected
948  camitk_add_integration_test()
949  endif()
950 
951  endif() # endif(${TYPE_EXTENSION_CMAKE}_${EXTENSION_NAME_CMAKE})
952 
953 end(){)
954 
955 
956 # TODO write a viewer_extension macro in CamiTK
A pseudo-namespace used to group CMake macros and functions.
iwyu out CACHE PATH Output filename for include what you use set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${IWYU_EXECUTABLE}) if(NOT EXISTS $
Definition: CamiTKIncludeWhatYouUse.h:22
Definition: itkImageToVTKImageFilter.h:39
get_directory_name()
macro get_directory_name set the variable VariableName to the name of the last directory of FullPathD...
Definition: GetDirectoryName.h:14
cmake modules macros camitk test endif() add_custom_target(camitk-ce-iwyu COMMAND $
Definition: CamiTKIncludeWhatYouUse.h:37
#define a
camitk_extension()
Macro camitk_extension simplifies writing a camitk extension (component, action)
Definition: CamiTKExtension.h:90
gather_headers_and_sources()
macro gather_headers_and_sources find all headers, sources, including the qt ui, moc and resources an...
Definition: GatherHeadersAndSources.h:15
if(${CMAKE_VERSION} VERSION_GREATER "3.3" OR ${CMAKE_VERSION} VERSION_EQUAL "3.3") option(CAMITK_INCLUDE_WHAT_YOU_USE "Enable the header analysis on you code
static void include(QRect &r, const QRect &rect)
Definition: canvas_typed/qtcanvas.cpp:98