Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit b5f9f671 authored by Jean-Loup Haberbusch's avatar Jean-Loup Haberbusch
Browse files

Merge branch 'revert-604af00c' into 'develop'

Revert "Merge branch 'Bug/GDCM-File-not-found' into 'develop'"

See merge request !134
parents 604af00c 703a59cd
......@@ -3,7 +3,7 @@
# CamiTK Community Edition CEP Set
#
#--------------------------------------------
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.0)
project(camitkcommunityedition)
......
......@@ -22,13 +22,11 @@ set -e
# values to check
initTestData() {
# fill test data
extensionCount=( [4.2]=46 [4.1]=41 [4.0]=31 )
extensionCount=( [4.2]=43 [4.1]=41 [4.0]=31 )
componentExtensionCount=( [4.2]=14 [4.1]=14 [4.0]=14 )
actionExtensionCount=( [4.2]=30 [4.1]=27 [4.0]=27 )
viewerExtensionCount=( [4.2]=2 [4.1]=0 [4.0]=0 )
actionExtensionCount=( [4.2]=29 [4.1]=27 [4.0]=27 )
fileExtensionCount=( [4.2]=37 [4.1]=37 [4.0]=37 )
actionCount=( [4.2]=108 [4.1]=105 [4.0]=105 )
viewerCount=( [4.2]=2 [4.1]=0 [4.0]=0 )
actionCount=( [4.2]=107 [4.1]=105 [4.0]=105 )
# fill release date
releaseDate=( [4.2]="not yet released, current development version" \
......@@ -50,10 +48,8 @@ declareTestData() {
declare -Ag extensionCount
declare -Ag componentExtensionCount
declare -Ag actionExtensionCount
declare -Ag viewerExtensionCount
declare -Ag fileExtensionCount
declare -Ag actionCount
declare -Ag viewerCount
declare -Ag releaseDate
}
......@@ -179,18 +175,12 @@ getExpectedValue() {
"Number of Action Extensions")
echo ${actionExtensionCount[$shortVersion]}
;;
"Number of Viewer Extensions")
echo ${viewerExtensionCount[$shortVersion]}
;;
"Number of File Extensions Supported")
echo ${fileExtensionCount[$shortVersion]}
;;
"Number of Actions")
echo ${actionCount[$shortVersion]}
;;
"Number of Viewers")
echo ${viewerCount[$shortVersion]}
;;
esac
}
......@@ -294,9 +284,7 @@ else
fi
checkValue "Number of Component Extensions"
checkValue "Number of Action Extensions"
checkValue "Number of Viewer Extensions"
checkValue "Number of File Extensions Supported"
checkValue "Number of Actions"
checkValue "Number of Viewers"
exit $exitStatus
......@@ -40,9 +40,8 @@ if(APIDOC_SDK)
set(DOXYGEN_SUBDIRS ${DOXYGEN_SUBDIRS} ${CMAKE_CURRENT_SOURCE_DIR}/libraries/core)
set(DOXYGEN_SUBDIRS ${DOXYGEN_SUBDIRS} ${CMAKE_CURRENT_SOURCE_DIR}/libraries/cepgenerator)
set(DOXYGEN_SUBDIRS ${DOXYGEN_SUBDIRS} ${CMAKE_CURRENT_SOURCE_DIR}/libraries/qtpropertybrowser)
set(DOXYGEN_SUBDIRS ${DOXYGEN_SUBDIRS} ${CMAKE_CURRENT_SOURCE_DIR}/../modeling/libraries)
set(DOXYGEN_SUBDIRS ${DOXYGEN_SUBDIRS} ${CMAKE_CURRENT_SOURCE_DIR}/../modeling/libraries)
set(DOXYGEN_SUBDIRS ${DOXYGEN_SUBDIRS} ${CMAKE_CURRENT_SOURCE_DIR}/actions)
set(DOXYGEN_SUBDIRS ${DOXYGEN_SUBDIRS} ${CMAKE_CURRENT_SOURCE_DIR}/viewers)
set(DOXYGEN_SUBDIRS ${DOXYGEN_SUBDIRS} ${CMAKE_CURRENT_SOURCE_DIR}/../modeling/actions)
set(DOXYGEN_SUBDIRS ${DOXYGEN_SUBDIRS} ${CMAKE_CURRENT_SOURCE_DIR}/../imaging/actions)
set(DOXYGEN_SUBDIRS ${DOXYGEN_SUBDIRS} ${CMAKE_CURRENT_SOURCE_DIR}/applications)
......@@ -71,7 +70,7 @@ if(APIDOC_SDK)
get_filename_component(doxygenDocFilename ${CMAKE_MACRO} NAME_WE)
file(WRITE ${CMAKE_BINARY_DIR}/doxygencmake/${doxygenDocFilename}.h ${doxygenDocWithName})
endforeach()
# Configure doxyfile, doxygen project configuration file.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/doxygen.conf.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
......
......@@ -14,7 +14,7 @@ set(CAMITK_VERSION_MINOR "@CAMITK_VERSION_MINOR@")
# CamiTK short version name we are looking for
set(CAMITK_SHORT_VERSION_STRING "camitk-${CAMITK_VERSION_MAJOR}.${CAMITK_VERSION_MINOR}")
#-- Cmake policy
#-- Cmake policy
# Error on non-existent dependency in add_dependencies => old behavior (no error)
# It is useful to have add_dependencies(anyextension camitkcore) for SDK/modeling/imaging dev
# It shoud not generate an error or a warning for external CEP trying to compile
......@@ -64,7 +64,7 @@ if(WIN32)
file(TO_CMAKE_PATH "${CAMITK_USER_BASE_DIR_WINDOWS}" CAMITK_USER_BASE_DIR)
else()
# (UNIX OR APPLE)
# $HOME/.config/MySoft/Star Runner.ini
# $HOME/.config/MySoft/Star Runner.ini
set(CAMITK_USER_BASE_DIR "$ENV{HOME}/.config")
endif()
set(CAMITK_USER_DIR "${CAMITK_USER_BASE_DIR}/CamiTK")
......@@ -100,7 +100,7 @@ if(PACKAGING_NSIS)
else()
set(CAMITK_CORE_TARGET_LIB_NAME library-${CAMITK_CORE_LIB_NAME})
endif()
# All the link directories
set(CAMITK_LINK_DIRECTORIES
# private and public libs (including bin dir for windows)
......@@ -116,13 +116,10 @@ set(CAMITK_LINK_DIRECTORIES
# CEP extensions dependencies
${CAMITK_PRIVATE_LIB_DIR}/components
${CAMITK_PRIVATE_LIB_DIR}/actions
${CAMITK_PRIVATE_LIB_DIR}/viewers
${CAMITK_USER_PRIVATE_LIB_DIR}/components
${CAMITK_USER_PRIVATE_LIB_DIR}/actions
${CAMITK_USER_PRIVATE_LIB_DIR}/viewers
${CAMITK_BUILD_PRIVATE_LIB_DIR}/components
${CAMITK_BUILD_PRIVATE_LIB_DIR}/actions
${CAMITK_BUILD_PRIVATE_LIB_DIR}/viewers
${CAMITK_BUILD_PRIVATE_LIB_DIR}/actions
)
# List of directories where the compiler should look for CamiTK core headers as well
......@@ -136,7 +133,7 @@ set(CAMITK_INCLUDE_DIRECTORIES
${CAMITK_BUILD_INCLUDE_DIR}
${QT_INCLUDE_DIRS}
${VTK_INCLUDE_DIRS}
${CAMITK_BUILD_INCLUDE_DIR}/libraries
${CAMITK_BUILD_INCLUDE_DIR}/libraries
)
# TODO: remove ${CAMITK_BUILD_INCLUDE_DIR}/libraries => find a better way to organize dependencies
......@@ -149,7 +146,7 @@ if(MSVC)
set(CAMITK_CORE_LIBRARIES optimized ${CAMITK_CORE_LIB_NAME}
debug ${CAMITK_CORE_LIB_NAME}${CAMITK_DEBUG_POSTFIX}
)
# Construct list of VTK libraries for linking
# CAMITK_VTK_LIBRARIES = VTK input libraries at linkage
foreach(VTK_LIBRARY ${VTK_LIBRARIES})
......@@ -171,13 +168,13 @@ if(MSVC)
endif()
set(CAMITK_VTK_LIBRARIES ${CAMITK_VTK_LIBRARIES} debug ${VTK_LIBRARY_DIR}/${VTK_LIBRARY}-${CAMITK_VTK_VERSION}${CAMITK_DEBUG_POSTFIX}.lib optimized ${VTK_LIBRARY_DIR}/${VTK_LIBRARY}-${CAMITK_VTK_VERSION}.lib)
endforeach()
# add missing vtkIOExport, vtkImagingStencil, vtkIOImport, vtkImagingMath library
set(CAMITK_VTK_LIBRARIES ${CAMITK_VTK_LIBRARIES} debug ${VTK_LIBRARY_DIR}/vtkIOExport-${CAMITK_VTK_VERSION}${CAMITK_DEBUG_POSTFIX}.lib optimized ${VTK_LIBRARY_DIR}/vtkIOExport-${CAMITK_VTK_VERSION}.lib)
set(CAMITK_VTK_LIBRARIES ${CAMITK_VTK_LIBRARIES} debug ${VTK_LIBRARY_DIR}/vtkImagingStencil-${CAMITK_VTK_VERSION}${CAMITK_DEBUG_POSTFIX}.lib optimized ${VTK_LIBRARY_DIR}/vtkImagingStencil-${CAMITK_VTK_VERSION}.lib)
set(CAMITK_VTK_LIBRARIES ${CAMITK_VTK_LIBRARIES} debug ${VTK_LIBRARY_DIR}/vtkIOImport-${CAMITK_VTK_VERSION}${CAMITK_DEBUG_POSTFIX}.lib optimized ${VTK_LIBRARY_DIR}/vtkIOImport-${CAMITK_VTK_VERSION}.lib)
set(CAMITK_VTK_LIBRARIES ${CAMITK_VTK_LIBRARIES} debug ${VTK_LIBRARY_DIR}/vtkImagingMath-${CAMITK_VTK_VERSION}${CAMITK_DEBUG_POSTFIX}.lib optimized ${VTK_LIBRARY_DIR}/vtkImagingMath-${CAMITK_VTK_VERSION}.lib)
# list of all core dependencies
set(CAMITK_LIBRARIES
${CAMITK_VTK_LIBRARIES}
......@@ -212,15 +209,15 @@ if (UNIX)
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
# Application man pages (always in section 1, this is an application...)
set(CAMITK_APPLICATION_MAN_INSTALL_DIR "share/man/man1")
set(CAMITK_APPLICATION_MAN_INSTALL_DIR "share/man/man1")
# Desktop file always in share/applications (freedesktop standard)
set(CAMITK_APPLICATION_DESKTOP_INSTALL_DIR "share/applications")
# icons file always in pixmaps (should be xpm or svg)
set(CAMITK_APPLICATION_PIXMAP_INSTALL_DIR "share/pixmaps")
endif()
# rpath settings for linux
# This settings allow running the exe from the build tree and running them from its install location
# without doing anything in particular.
......@@ -252,8 +249,7 @@ if("${isSystemDir}" STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib"
"${CMAKE_INSTALL_PREFIX}/lib/${CAMITK_SHORT_VERSION_STRING}"
"${CMAKE_INSTALL_PREFIX}/lib/${CAMITK_SHORT_VERSION_STRING}/components"
"${CMAKE_INSTALL_PREFIX}/lib/${CAMITK_SHORT_VERSION_STRING}/actions"
"${CMAKE_INSTALL_PREFIX}/lib/${CAMITK_SHORT_VERSION_STRING}/viewers")
"${CMAKE_INSTALL_PREFIX}/lib/${CAMITK_SHORT_VERSION_STRING}/actions")
endif()
#-- update module path
......@@ -285,13 +281,13 @@ include(CamiTKMacros)
include(CamiTKLog)
# TODO check this
#
#
# # By default, validate all projects are build in the build/bin directory (no subfolders).
# # Note that, subfolders for actions / components are added later.
# set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CAMITK_BIN_DIR})
# set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CAMITK_BIN_DIR})
# set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CAMITK_BIN_DIR})
#
#
# # Remove the Debug, Release subfolders in build/bin, natively created with Visual Studio
# if ( ${CMAKE_GENERATOR} MATCHES "Visual Studio") # MSVC compiler
# foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} )
......@@ -301,6 +297,6 @@ include(CamiTKLog)
# set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CAMITK_BIN_DIR} CACHE TYPE STRING)
# endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES )
# endif(${CMAKE_GENERATOR} MATCHES "Visual Studio")
#
#
# # Create the Xml data for Project.xml description, fyi store in the global variable CAMITK_SUBPROJECTS
# camitk_init_manifest_data()
......@@ -44,8 +44,8 @@ macro(export_headers)
set(multiValueArgs "")
cmake_parse_arguments(EXPORT_HEADER "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
# Remove prefix for the destination directory
string(REGEX REPLACE "^component-|^component_|^action-|^action_|^viewer-|^viewer_|^library_|^library-" "" EXPORT_HEADER_DESTINATION "${EXPORT_HEADER_COMPONENT}")
# special case for components: remove prefix for the destination directory
string(REGEX REPLACE "^component-|^component_|^action-|^action_|^library_|^library-" "" EXPORT_HEADER_DESTINATION "${EXPORT_HEADER_COMPONENT}")
#
# 1. Create the build-time directory tree
......
......@@ -3,10 +3,10 @@
#!
#! macro camitk_application simplify writing a CMakeLists.txt for CamiTK application extension
#!
#! \note
#! After the execution of this macro, the variable APPLICATION_TARGET_NAME
#! \note
#! After the execution of this macro, the variable APPLICATION_TARGET_NAME
#! holds the name of the CMake target produced by this macro.
#! The target name itself is equals to "camitk-<name>", where <name> is the name of the current
#! The target name itself is equals to "camitk-<name>", where <name> is the name of the current
#! folder in lowercase.
#!
#! On Unix additional system resources can also be automatically installed or configured: man pages,
......@@ -22,7 +22,7 @@
#! To write a simple man page, please refer to SDK application examples. If you need to
#! generate a simple manpage or analyze the command line arguments, the CamiTK team recommands
#! to use Code Synthesis CLI configuration (see http://codesynthesis.com/projects/cli)
#!
#!
#! usage:
#! \code
#! camitk_application(
......@@ -32,7 +32,6 @@
#! [NEEDS_CEP_LIBRARIES CEPLib1 CEPLib12 ...]
#! [NEEDS_COMPONENT_EXTENSION component1 component2 ...]
#! [NEEDS_ACTION_EXTENSION ation1 action2 ...]
#! [NEEDS_VIEWER_EXTENSION viewer1 viewer2 ...]
#! [DEFINES flag1 flag2 ...]
#! [CXX_FLAGS flag1 flag2 ...]
#! [ADDITIONAL_SOURCES source.cxx source.cpp ...]
......@@ -46,8 +45,7 @@
#! \param NEEDS_ITK means this application requires ITK to be compiled / run.
#! \param NEEDS_CEP_LIBRARIES list of needed camitk CEP libraries
#! \param NEEDS_COMPONENT_EXTENSION list of needed component extensions
#! \param NEEDS_ACTION_EXTENSION list of needed action extensions
#! \param NEEDS_VIEWER_EXTENSION list of needed viewer extensions
#! \param NEEDS_ACTION_EXTENSION list of needed component extensions
#! \param DEFINES list of define flags to add at compilation time
#! \param CXX_FLAGS list of compiler flags to add (such as warning levels (-Wall ...)).
#! \param ADDITIONAL_SOURCES list of additional sources (that cannot be automatically found by gather_headers_and_sources macro)
......@@ -57,12 +55,11 @@
#! \param INCLUDE_DIRECTORIES additional include directories
#! \param EXTERNAL_LIBRARIES external libraries to add to the link command
#! \param EXTRA_TRANSLATE_LANGUAGE Additionnal extra language to translate the application
#!
macro(camitk_application)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
#########################################################################
# #
# ARGUMENTS PARSING #
......@@ -76,11 +73,11 @@ macro(camitk_application)
set(options DISABLED NEEDS_ITK NEEDS_XSD NEEDS_XERCESC NEEDS_PYTHON)
set(oneValueArgs "")
set(multiValueArgs NEEDS_CEP_LIBRARIES NEEDS_TOOL NEEDS_COMPONENT_EXTENSION NEEDS_ACTION_EXTENSION NEEDS_VIEWER_EXTENSION DEFINES CXX_FLAGS ADDITIONAL_SOURCES CEP_NAME DESCRIPTION EXTERNAL_LIBRARIES INCLUDE_DIRECTORIES EXTRA_TRANSLATE_LANGUAGE)
set(multiValueArgs NEEDS_CEP_LIBRARIES NEEDS_TOOL NEEDS_COMPONENT_EXTENSION NEEDS_ACTION_EXTENSION DEFINES CXX_FLAGS ADDITIONAL_SOURCES CEP_NAME DESCRIPTION EXTERNAL_LIBRARIES INCLUDE_DIRECTORIES EXTRA_TRANSLATE_LANGUAGE)
cmake_parse_arguments(${APPLICATION_NAME_CMAKE} "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
#########################################################################
# #
# CREATE CMAKE VARIABLES #
......@@ -90,7 +87,7 @@ macro(camitk_application)
#########################################################################
# CMAKE CACHE VARIABLE
# if it is the first cmake run, create the application variable with a correct initial value
# if it is the first cmake run, create the application variable with a correct initial value
if(NOT APPLICATION_${APPLICATION_NAME_CMAKE}_INTERNAL)
# add option to enable/disable this extension and set it to true by default
# Building the extension can be disabled by giving the argument DISABLED to the macro
......@@ -103,7 +100,7 @@ macro(camitk_application)
set(APPLICATION_${APPLICATION_NAME_CMAKE} ${APPLICATION_${APPLICATION_NAME_CMAKE}_ENABLED} CACHE BOOL "Build application ${APPLICATION_NAME}")
set(APPLICATION_${APPLICATION_NAME_CMAKE}_INTERNAL TRUE CACHE INTERNAL "Is variable APPLICATION_${APPLICATION_NAME} already created?")
endif()
# APPLICATION TARGET NAME
if (PACKAGING_NSIS)
# NSIS requires that cpack component names do not feature space or "-" characters
......@@ -111,17 +108,17 @@ macro(camitk_application)
else()
set(APPLICATION_TARGET_NAME application-${APPLICATION_NAME})
endif()
# if this extension is enabled, do everything needed
# otherwise... do nothing
if (APPLICATION_${APPLICATION_NAME_CMAKE})
message(STATUS "Building application ${APPLICATION_NAME}")
#########################################################################
# #
# INCLUDE DIRECTORIES #
......@@ -132,15 +129,15 @@ macro(camitk_application)
# #
#########################################################################
# BASIC DIRECTORIES
include_directories(${CAMITK_INCLUDE_DIRECTORIES})
include_directories(${CAMITK_INCLUDE_DIRECTORIES})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
# USER INPUT DIRECTORIES
include_directories(${${APPLICATION_NAME_CMAKE}_INCLUDE_DIRECTORIES})
#########################################################################
# #
# GATHER RESOURCES #
......@@ -148,17 +145,17 @@ macro(camitk_application)
# * get all the headers (.h) and source files (.cpp) of the project #
# * create the needed Qt files (using moc and uic) #
# * On Windows, Visual Studio, group .moc and .ui files #
# in subdirectories #
# in subdirectories #
# #
#########################################################################
# get all headers, sources and do what is needed for Qt
# one need to do this just before the add_library so that all defines, include directories and link directories
# are set properly (gather_headers_and_sources include the call to Qt moc and uic)
gather_headers_and_sources(${APPLICATION_NAME})
#########################################################################
# #
# TARGET COMPILATION DEFINITION #
......@@ -169,7 +166,7 @@ macro(camitk_application)
#########################################################################
# EXTERNAL SOURCES
set(${APPLICATION_NAME}_SOURCES ${${APPLICATION_NAME}_SOURCES} ${${APPLICATION_NAME_CMAKE}_ADDITIONAL_SOURCES})
# APPLE BUNDLE DEFINITIONS
if(APPLE)
set(MACOSX_BUNDLE_INFO_STRING "${APPLICATION_TARGET_NAME} ${CAMITK_SHORT_VERSION_STRING}")
......@@ -185,9 +182,9 @@ macro(camitk_application)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${MACOSX_BUNDLE_RESOURCES})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MACOSX_BUNDLE_ICON} ${MACOSX_BUNDLE_RESOURCES})
endif()
#########################################################################
# #
# ADDITIONAL KNOWN LIBRARY DEPENDENCIES #
......@@ -198,7 +195,7 @@ macro(camitk_application)
# * Backward compatibility : Warn user if using old NEEDS_TOOL syntax #
# #
#########################################################################
# Looking for ITK
set(ITK_LIBRARIES "")
if(${APPLICATION_NAME_CMAKE}_NEEDS_ITK)
......@@ -276,13 +273,13 @@ macro(camitk_application)
message(FATAL_ERROR "Python (2.7 or above) is required by ${APPLICATION_NAME} : please add your python installation dir to your PATH environment variable")
endif()
endif()
# EXTERNAL LIBRARIES
set(EXTERNAL_LIBRARIES)
if(${APPLICATION_NAME_CMAKE}_EXTERNAL_LIBRARIES)
foreach(EXTERNAL_LIBRARY ${${APPLICATION_NAME_CMAKE}_EXTERNAL_LIBRARIES})
if (MSVC) # TODO We have to decide how to handle debug version of external libraries
set(EXTERNAL_LIBRARIES ${EXTERNAL_LIBRARIES}
set(EXTERNAL_LIBRARIES ${EXTERNAL_LIBRARIES}
debug ${EXTERNAL_LIBRARY}${CAMITK_DEBUG_POSTFIX}.lib
optimized ${EXTERNAL_LIBRARY}.lib
)
......@@ -292,8 +289,8 @@ macro(camitk_application)
endforeach()
endif()
#########################################################################
# #
# LINK DIRECTORIES #
......@@ -304,9 +301,9 @@ macro(camitk_application)
#########################################################################
# CAMITK BASIC LIB DIRECTORIES
link_directories(${CAMITK_LINK_DIRECTORIES})
#########################################################################
# #
# TARGET COMPILATION DEFINITION #
......@@ -317,8 +314,8 @@ macro(camitk_application)
#########################################################################
# CMAKE TARGET DEFINITION
add_executable(${APPLICATION_TARGET_NAME} ${${APPLICATION_NAME}_SOURCES})
#########################################################################
# #
......@@ -328,9 +325,9 @@ macro(camitk_application)
# #
#########################################################################
qt5_use_modules(${APPLICATION_TARGET_NAME} ${CAMITK_QT_COMPONENTS})
#########################################################################
# #
# CAMITK ACTION / COMPONENT / LIBRARIES DEPENDENCIES #
......@@ -339,20 +336,20 @@ macro(camitk_application)
# * Specific actions / components / libraries are specified as option #
# with the NEEDS_ACTION/COMPONENT_EXTENSION/CEP_LIBRARIES syntax #
# * Add dependencies to library-camitkcore and the testing #
# action/component if test are runned on it #
# action/component if test are runned on it #
# #
#########################################################################
# 1) CAMITKCORE LIBRARY DEPENDENCY
# add the target dependency (i.e., enable proper parallelization of the build process
# 1st CAMITKCORE LIBRARY DEPENDENCY
# add the target dependency (i.e., enable proper parallelization of the build process
# only if inside the sdk build
if(CAMITK_COMMUNITY_EDITION_BUILD)
if(CAMITK_COMMUNITY_EDITION_BUILD)
add_dependencies(${APPLICATION_TARGET_NAME} ${CAMITK_CORE_TARGET_LIB_NAME})
# add the dependency to the core automoc target
set_property(TARGET ${APPLICATION_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS ${CAMITK_CORE_TARGET_LIB_NAME})
endif()
# 2) COMPONENTS DEPENDENCIES
# 2nd COMPONENTS DEPENDENCIES
if(${APPLICATION_NAME_CMAKE}_NEEDS_COMPONENT_EXTENSION)
set(COMPONENTS_DEPENDENCY_LIST "") #use for generating the project.xml file
foreach(COMPONENT_NEEDED ${${APPLICATION_NAME_CMAKE}_NEEDS_COMPONENT_EXTENSION})
......@@ -372,17 +369,17 @@ macro(camitk_application)
if(PACKAGING_NSIS)
add_dependencies(${APPLICATION_TARGET_NAME} component_${COMPONENT_NEEDED})
# add the dependency to the component automoc target
set_property(TARGET ${APPLICATION_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS component_${COMPONENT_NEEDED})
set_property(TARGET ${APPLICATION_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS component_${COMPONENT_NEEDED})
else()
add_dependencies(${APPLICATION_TARGET_NAME} component-${COMPONENT_NEEDED})
list(APPEND COMPONENTS_DEPENDENCY_LIST component-${COMPONENT_NEEDED})
# add the dependency to the component automoc target
set_property(TARGET ${APPLICATION_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS component-${COMPONENT_NEEDED})
set_property(TARGET ${APPLICATION_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS component-${COMPONENT_NEEDED})
endif()
endforeach()
endif()
# 3) ACTIONS DEPENDENCIES
# 3rd ACTIONS DEPENDENCIES
if(${APPLICATION_NAME_CMAKE}_NEEDS_ACTION_EXTENSION)
set(ACTIONS_DEPENDENCY_LIST "") #use for generating the project.xml file
foreach(ACTION_NEEDED ${${APPLICATION_NAME_CMAKE}_NEEDS_ACTION_EXTENSION})
......@@ -402,47 +399,17 @@ macro(camitk_application)
if (PACKAGING_NSIS)
add_dependencies(${APPLICATION_TARGET_NAME} action_${ACTION_NEEDED})
# add the dependency to the action automoc target
set_property(TARGET ${APPLICATION_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS action_${ACTION_NEEDED})
set_property(TARGET ${APPLICATION_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS action_${ACTION_NEEDED})
else()
add_dependencies(${APPLICATION_TARGET_NAME} action-${ACTION_NEEDED})
list(APPEND ACTIONS_DEPENDENCY_LIST action-${ACTION_NEEDED})
# add the dependency to the action automoc target
set_property(TARGET ${APPLICATION_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS action-${ACTION_NEEDED})
endif()
endforeach()
endif()
# 4) VIEWERS DEPENDENCIES
if(${APPLICATION_NAME_CMAKE}_NEEDS_VIEWER_EXTENSION)
set(VIEWERS_DEPENDENCY_LIST "") #use for generating the project.xml file
foreach(VIEWER_NEEDED ${${APPLICATION_NAME_CMAKE}_NEEDS_VIEWER_EXTENSION})
# include directories from build, camitk (local or global install).
include_directories(${CAMITK_BUILD_INCLUDE_DIR}/viewers/${VIEWER_NEEDED})
include_directories(${CAMITK_INCLUDE_DIR}/viewers/${VIEWER_NEEDED})
# file dependency
if (MSVC)
list(APPEND VIEWER_EXTENSION_LIBRARIES
debug ${CAMITK_BUILD_PRIVATE_LIB_DIR}/viewers/${VIEWER_NEEDED}${CAMITK_DEBUG_POSTFIX}.lib
optimized ${VIEWER_NEEDED}
)
else()
list(APPEND VIEWER_EXTENSION_LIBRARIES ${VIEWER_NEEDED})
endif()
# CMake / CDash dependencies
if (PACKAGING_NSIS)
add_dependencies(${APPLICATION_TARGET_NAME} viewer_${VIEWER_NEEDED})
# add the dependency to the viewer automoc target
set_property(TARGET ${APPLICATION_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS viewer_${VIEWER_NEEDED})
else()
add_dependencies(${APPLICATION_TARGET_NAME} viewer-${VIEWER_NEEDED})
list(APPEND VIEWERS_DEPENDENCY_LIST viewer-${VIEWER_NEEDED})
# add the dependency to the viewer automoc target
set_property(TARGET ${APPLICATION_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS viewer-${VIEWER_NEEDED})
set_property(TARGET ${APPLICATION_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS action-${ACTION_NEEDED})
endif()
endforeach()
endif()
# 5) CEP LIBRARIES DEPENDENCIES
# 4th CEP LIBRARIES DEPENDENCIES
if(${APPLICATION_NAME_CMAKE}_NEEDS_CEP_LIBRARIES)
set(CEP_LIBRARIES_DEPENDENCY_LIST "") #use for generating the project.xml file
foreach(CEP_LIBRARY_NEEDED ${${APPLICATION_NAME_CMAKE}_NEEDS_CEP_LIBRARIES})
......@@ -461,17 +428,17 @@ macro(camitk_application)
if (PACKAGING_NSIS)
add_dependencies(${APPLICATION_TARGET_NAME} library_${CEP_LIBRARY_NEEDED})
# add the dependency to the library automoc target
set_property(TARGET ${APPLICATION_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS library_${CEP_LIBRARY_NEEDED})
set_property(TARGET ${APPLICATION_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS library_${CEP_LIBRARY_NEEDED})
else()
add_dependencies(${APPLICATION_TARGET_NAME} library-${CEP_LIBRARY_NEEDED})
list(APPEND CEP_LIBRARIES_DEPENDENCY_LIST library-${CEP_LIBRARY_NEEDED})
# add the dependency to the library automoc target
set_property(TARGET ${APPLICATION_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS library-${CEP_LIBRARY_NEEDED})
set_property(TARGET ${APPLICATION_TARGET_NAME} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS library-${CEP_LIBRARY_NEEDED})
endif()
endforeach()
endif()
#########################################################################
# #
......@@ -489,16 +456,16 @@ macro(camitk_application)
add_definitions(-D${FLAG})
endforeach()
endif()
# USER INPUT CUSTOM COMPILER FLAG
if(${APPLICATION_NAME_CMAKE}_CXX_FLAGS)
foreach (FLAG ${${APPLICATION_NAME_CMAKE}_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG}")
endforeach()
endif()
#########################################################################
# #
# LINKING #
......@@ -508,9 +475,9 @@ macro(camitk_application)
# #
#########################################################################
# LINKING LIBRARIES
target_link_libraries(${APPLICATION_TARGET_NAME} ${CAMITK_CORE_LIBRARIES} ${CAMITK_LIBRARIES} ${COMPONENT_EXTENSION_LIBRARIES} ${ACTION_EXTENSION_LIBRARIES} ${VIEWER_EXTENSION_LIBRARIES} ${CEP_LIBRARIES} ${XERCESC_LIBRARY} ${CAMITK_ITK_LIBRARIES} ${PYTHON_LIBRARIES} ${EXTERNAL_LIBRARIES})
target_link_libraries(${APPLICATION_TARGET_NAME} ${CAMITK_CORE_LIBRARIES} ${CAMITK_LIBRARIES} ${COMPONENT_EXTENSION_LIBRARIES} ${ACTION_EXTENSION_LIBRARIES} ${CEP_LIBRARIES} ${XERCESC_LIBRARY} ${CAMITK_ITK_LIBRARIES} ${PYTHON_LIBRARIES} ${EXTERNAL_LIBRARIES})