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 29d464c1 authored by saubatn's avatar saubatn
Browse files

FIXED : Add dependency for QTXML library in the CamiTK macros.

FIXED : ActionStateMachine application and Volume Rendering image action now uses it.

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@556 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 4361f15f
if(ACTION_VOLUMERENDERING)
# specific section in order to use the XML module of Qt
set (QT_USE_QTWEBKIT ON)
set (QT_USE_QTXML ON)
set (QT_USE_QTXMLPATTERNS ON)
find_package(Qt4 REQUIRED)
if(QT_USE_FILE)
include(${QT_USE_FILE})
else(QT_USE_FILE)
set(QT_LIBRARIES ${QT_QT_LIBRARY})
endif(QT_USE_FILE)
# warning: redefines CAMITK_LIBRARIES
set(CAMITK_LIBRARIES ${CAMITK_LIBRARIES} ${QT_LIBRARIES})
endif()
camitk_extension(
ACTION_EXTENSION
DEFAULT
NEEDS_QTXML
DEFINES COMPILE_VOLUME_RENDERING_ACTION_API)
if(APPLICATION_ACTIONSTATEMACHINE)
# specific section in order to use the XML module of Qt
set (QT_USE_QTWEBKIT ON)
set (QT_USE_QTXML ON)
set (QT_USE_QTXMLPATTERNS ON)
find_package(Qt4 REQUIRED)
if(QT_USE_FILE)
include(${QT_USE_FILE})
else(QT_USE_FILE)
set(QT_LIBRARIES ${QT_QT_LIBRARY})
endif(QT_USE_FILE)
# warning: redefines CAMITK_LIBRARIES
set(CAMITK_LIBRARIES ${CAMITK_LIBRARIES} ${QT_LIBRARIES})
endif()
# use the application extension macro
application_extension(DEFAULT
LIBRARIES QtXml4 QtXmlPatterns4
NEEDS_QTXML
)
......@@ -237,6 +237,7 @@ endmacro()
# [NEEDS_OPENCV]
# [NEEDS_IGSTK]
# [NEEDS_XSD]
# [NEEDS_QTXML]
# [NEEDS_TOOL tool1 tool2 ...]
# [NEEDS_COMPONENT_EXTENSION component1 component2 ...]
# [INCLUDE_DIRECTORIES dir1 dir2 ...]
......@@ -260,6 +261,7 @@ endmacro()
# NEEDS_OPENCV = add this if your component needs OpenCV
# NEEDS_IGSTK = add this if your component needs IgsTK
# NEEDS_XERCESC = add this if your action / component needs XercesC library
# NEEDS_QTXML = this application needs QtXML
# NEEDS_TOOL = list of needed camitk tools
# NEEDS_COMPONENT_EXTENSION = list of needed component extensions
# NEEDS_ACTION_EXTENSION = list of needed component extensions
......@@ -282,7 +284,7 @@ macro(camitk_extension)
parse_arguments(${EXTENSION_NAME_CMAKE} #prefix
"NEEDS_TOOL;NEEDS_COMPONENT_EXTENSION;NEEDS_ACTION_EXTENSION;INCLUDE_DIRECTORIES;LIBRARIES;HEADERS_TO_INSTALL;DEFINES;EXTERNAL_SOURCES" # possible lists
"ACTION_EXTENSION;COMPONENT_EXTENSION;DEFAULT;NEEDS_XERCESC;NEEDS_ITK;NEEDS_LIBXML2;NEEDS_XSD;NEEDS_OPENCV;NEEDS_IGSTK;INSTALL_ALL_HEADERS" # possible options
"ACTION_EXTENSION;COMPONENT_EXTENSION;DEFAULT;NEEDS_XERCESC;NEEDS_ITK;NEEDS_LIBXML2;NEEDS_XSD;NEEDS_QTXML;NEEDS_OPENCV;NEEDS_IGSTK;INSTALL_ALL_HEADERS" # possible options
${ARGN}
)
......@@ -419,6 +421,18 @@ macro(camitk_extension)
endif()
endif()
set(QT_LIBRARIES_WITH_QTXML)
if(${APPLICATION_NAME_CMAKE}_NEEDS_QTXML)
set (QT_USE_QTXML ON)
find_package(Qt4 REQUIRED)
if(QT_USE_FILE)
include(${QT_USE_FILE})
else(QT_USE_FILE)
set(QT_LIBRARIES ${QT_QT_LIBRARY})
endif(QT_USE_FILE)
set(QT_LIBRARIES_WITH_QTXML ${QT_LIBRARIES})
endif()
set(COMPONENT_EXTENSION_LIBRARIES)
# check for intra-component extension
if(${EXTENSION_NAME_CMAKE}_NEEDS_COMPONENT_EXTENSION)
......@@ -474,7 +488,7 @@ macro(camitk_extension)
# Set the libraries required to link the target
# An action has to be linked with ${CAMITK_CORE_LIB}. As CAMITK_CORE_LIB is always a DLL/shared lib, there should
# be no symbols loaded multiple times
target_link_libraries(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} ${CAMITK_LIBRARIES} ${CAMITK_CORE_LIB} ${COMPONENT_EXTENSION_LIBRARIES} ${ACTION_EXTENSION_LIBRARIES} ${ITK_LIBRARIES} ${LIBXML2_LIBRARIES} ${OpenCV_LIBRARIES} ${IGSTK_LIBRARIES} ${XERCESC_LIBRARY} ${TOOL_LIBRARIES} ${${EXTENSION_NAME_CMAKE}_LIBRARIES})
target_link_libraries(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} ${CAMITK_LIBRARIES} ${QT_LIBRARIES_WITH_QTXML} ${CAMITK_CORE_LIB} ${COMPONENT_EXTENSION_LIBRARIES} ${ACTION_EXTENSION_LIBRARIES} ${ITK_LIBRARIES} ${LIBXML2_LIBRARIES} ${OpenCV_LIBRARIES} ${IGSTK_LIBRARIES} ${XERCESC_LIBRARY} ${TOOL_LIBRARIES} ${${EXTENSION_NAME_CMAKE}_LIBRARIES})
# dependencies to core (only set for internal build)
if (CAMITK_INTERNAL_BUILD)
......@@ -756,6 +770,7 @@ endmacro()
# application_extension(
# [DEFAULT]
# [NEEDS_ITK]
# [NEEDS_QTXML]
# [NEEDS_TOOL tool1 tool2 ...]
# [NEEDS_COMPONENT_EXTENSION component1 component2 ...]
# [NEEDS_ACTION_EXTENSION ation1 action2 ...]
......@@ -765,6 +780,7 @@ endmacro()
# DEFAULT = means this is a default application to be compiled automatically
# NEEDS_ITK = means this application requires ITK to be compiled / run.
# NEEDS_TOOL = list of needed camitk tools
# NEEDS_QTXML = this application needs QtXML
# NEEDS_COMPONENT_EXTENSION = list of needed component extensions
# NEEDS_ACTION_EXTENSION = list of needed component extensions
#
......@@ -774,17 +790,14 @@ endmacro()
#
macro(application_extension)
get_directory_name(${CMAKE_CURRENT_SOURCE_DIR} APPLICATION_NAME)
parse_arguments(${APPLICATION_NAME_CMAKE}
"NEEDS_TOOL;NEEDS_COMPONENT_EXTENSION;NEEDS_ACTION_EXTENSION" # possible lists
"DEFAULT;NEEDS_ITK;ACTION_EXTENSION;COMPONENT_EXTENSION;NEEDS_XSD;NEEDS_XERCESC" # possible options
"DEFAULT;NEEDS_ITK;NEEDS_QTXML;ACTION_EXTENSION;COMPONENT_EXTENSION;NEEDS_XSD;NEEDS_XERCESC" # possible options
${ARGN}
)
# if it is the first cmake run, create the application variable with a correct initial value
if(NOT CAMITK_APPLICATION_${APPLICATION_NAME_CMAKE}_INTERNAL)
message(STATUS "Checking ${APPLICATION_NAME}")
......@@ -841,6 +854,18 @@ macro(application_extension)
message(STATUS "${APPLICATION_NAME}: xerces-c required")
endif()
endif()
set(QT_LIBRARIES_WITH_QTXML)
if(${APPLICATION_NAME_CMAKE}_NEEDS_QTXML)
set (QT_USE_QTXML ON)
find_package(Qt4 REQUIRED)
if(QT_USE_FILE)
include(${QT_USE_FILE})
else(QT_USE_FILE)
set(QT_LIBRARIES ${QT_QT_LIBRARY})
endif(QT_USE_FILE)
set(QT_LIBRARIES_WITH_QTXML ${QT_LIBRARIES})
endif()
# Looking for codesynthesis XSD CXX
if(${APPLICATION_NAME_CMAKE}_NEEDS_XSD)
......@@ -930,7 +955,7 @@ macro(application_extension)
endif()
# Set the libraries needed to build the application target
target_link_libraries(${APPLICATION_TARGET_NAME} ${COMPONENT_EXTENSION_LIBRARIES} ${ACTION_EXTENSION_LIBRARIES} ${CAMITK_LIBRARIES} ${CAMITK_CORE_LIB} ${TOOL_LIBRARIES} ${XERCESC_LIBRARY} ${ITK_LIBRARIES})
target_link_libraries(${APPLICATION_TARGET_NAME} ${COMPONENT_EXTENSION_LIBRARIES} ${ACTION_EXTENSION_LIBRARIES} ${CAMITK_LIBRARIES} ${QT_LIBRARIES_WITH_QTXML} ${CAMITK_CORE_LIB} ${TOOL_LIBRARIES} ${XERCESC_LIBRARY} ${ITK_LIBRARIES})
# installation
install(TARGETS ${APPLICATION_TARGET_NAME}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment