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

UPDATED Compilation & linking of action-application

parent 541f9d33
......@@ -49,7 +49,7 @@
#include "ChangeLanguage.h"
// --------------- declare the extension -------------------
Q_EXPORT_PLUGIN2(applicationaction, ApplicationActionExtension)
// Q_EXPORT_PLUGIN2(applicationaction, ApplicationActionExtension)
// --------------- constructor -------------------
ApplicationActionExtension::ApplicationActionExtension() : ActionExtension() {}
......
......@@ -43,6 +43,7 @@
class ApplicationActionExtension : public camitk::ActionExtension {
Q_OBJECT
Q_INTERFACES(camitk::ActionExtension)
Q_PLUGIN_METADATA(IID "fr.imag.camitk.action.application")
public:
/// the constructor (needed to initialize the icon resources)
......
......@@ -22,8 +22,10 @@
*
* $CAMITK_LICENCE_END$
****************************************************************************/
#include <QThread>
#ifndef GENERATE_BUG_REPORT_PROCESS_H
#define GENERATE_BUG_REPORT_PROCESS_H
#include <QThread>
class GenerateBugReportProcess : public QThread {
Q_OBJECT
......@@ -32,4 +34,6 @@ public:
signals:
void resultReady(const QString &s);
};
\ No newline at end of file
};
#endif // GENERATE_BUG_REPORT_PROCESS_H
\ No newline at end of file
......@@ -40,18 +40,15 @@ OpenAction::OpenAction (ActionExtension * extension) : Action (extension) {
setEmbedded (false);
setDescription (tr("Open data (component) from a file"));
setComponent ("");
if (qApp->type() != QApplication::Tty)
setIcon (QPixmap (":/fileOpen"));
// Setting classification family and tags
setFamily ("Application");
addTag (tr("Open"));
// add a shortcut
if (qApp->type() != QApplication::Tty) {
getQAction()->setShortcut( QKeySequence::Open );
getQAction()->setShortcutContext(Qt::ApplicationShortcut);
}
setIcon(QPixmap(":/fileOpen"));
getQAction()->setShortcut( QKeySequence::Open );
getQAction()->setShortcutContext(Qt::ApplicationShortcut);
}
// --------------- destructor -------------------
......
......@@ -45,18 +45,15 @@ OpenFile::OpenFile (ActionExtension * extension) : Action (extension) {
setDescription(tr("Open data (component) from a given file"));
setComponent("");
if (qApp->type() != QApplication::Tty)
setIcon (QPixmap (":/fileOpen"));
setIcon (QPixmap (":/fileOpen"));
// Setting classification family and tags
setFamily("Application");
addTag(tr("Open"));
// add a shortcut
if (qApp->type() != QApplication::Tty) {
getQAction()->setShortcut( QKeySequence::Open );
getQAction()->setShortcutContext(Qt::ApplicationShortcut);
}
getQAction()->setShortcut( QKeySequence::Open );
getQAction()->setShortcutContext(Qt::ApplicationShortcut);
// the unique property is the filename
Property* fileNameProperty = new Property(tr("File name"), "", tr("The name of the file to open."), "");
......
......@@ -178,11 +178,8 @@ macro(camitk_application)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MACOSX_BUNDLE_ICON} ${MACOSX_BUNDLE_RESOURCES})
endif()
# CMAKE TARGET DEFINITION
add_executable(${APPLICATION_TARGET_NAME} ${${APPLICATION_NAME}_SOURCES})
#########################################################################
# #
# ADDITIONAL KNOWN LIBRARY DEPENDENCIES #
......@@ -683,9 +680,6 @@ macro(camitk_application)
endif()
endif()
# QT
qt5_use_modules(${APPLICATION_TARGET_NAME} ${CAMITK_QT_COMPONENTS})
# EXTERNAL LIBRARIES
set(EXTERNAL_LIBRARIES)
if(${APPLICATION_NAME_CMAKE}_EXTERNAL_LIBRARIES)
......@@ -725,7 +719,31 @@ macro(camitk_application)
link_directories(${CAMITK_LINK_DIRECTORIES})
#########################################################################
# #
# TARGET COMPILATION DEFINITION #
# #
# * Additional sources files to consider at compilation (.cpp) #
# * CMake project target definition #
# #
#########################################################################
# CMAKE TARGET DEFINITION
add_executable(${APPLICATION_TARGET_NAME} ${${APPLICATION_NAME}_SOURCES})
#########################################################################
# #
# QT LINKING LIBRARIES #
# #
# * Set at linking the Qt5 libraries #
# #
#########################################################################
qt5_use_modules(${APPLICATION_TARGET_NAME} ${CAMITK_QT_COMPONENTS})
#########################################################################
# #
# CAMITK ACTION / COMPONENT / LIBRARIES DEPENDENCIES #
......
......@@ -74,6 +74,12 @@
macro(camitk_extension)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
#########################################################################
# #
# ARGUMENTS PARSING #
......@@ -185,23 +191,7 @@ macro(camitk_extension)
# 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(${EXTENSION_NAME_CMAKE})
#########################################################################
# #
# TARGET COMPILATION DEFINITION #
# #
# * Additional sources files to consider at compilation (.cpp) #
# * CMake project target definition #
# #
#########################################################################
# EXTERNAL SOURCES
set(${EXTENSION_NAME_CMAKE}_SOURCES ${${EXTENSION_NAME_CMAKE}_SOURCES} ${${EXTENSION_NAME_CMAKE}_EXTERNAL_SOURCES})
# CMAKE TARGET DEFINITION
add_library(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} SHARED ${${EXTENSION_NAME_CMAKE}_SOURCES})
#########################################################################
......@@ -921,9 +911,6 @@ macro(camitk_extension)
endif()
endif()
# QT
qt5_use_modules(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} ${CAMITK_QT_COMPONENTS})
# EXTERNAL LIBRARIES
set(EXTERNAL_LIBRARIES)
if(${EXTENSION_NAME_CMAKE}_EXTERNAL_LIBRARIES)
......@@ -948,21 +935,48 @@ macro(camitk_extension)
endif()
#########################################################################
# #
# LINK DIRECTORIES #
# #
# * Link directories are used to indicate the compiler where #
# to look for folder containing libraries to link with. #
# * Must be done BEFORE creating the CMake target with add_library #
# #
#########################################################################
# CAMITK BASIC LIB DIRECTORIES
link_directories(${CAMITK_LINK_DIRECTORIES})
#########################################################################
# #
# TARGET COMPILATION DEFINITION #
# #
# * Additional sources files to consider at compilation (.cpp) #
# * CMake project target definition #
# #
#########################################################################
# EXTERNAL SOURCES
set(${EXTENSION_NAME_CMAKE}_SOURCES ${${EXTENSION_NAME_CMAKE}_SOURCES} ${${EXTENSION_NAME_CMAKE}_EXTERNAL_SOURCES})
# CMAKE TARGET DEFINITION
add_library(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} SHARED ${${EXTENSION_NAME_CMAKE}_SOURCES})
#########################################################################
# #
# QT LINKING LIBRARIES #
# #
# * Set at linking the Qt5 libraries #
# #
#########################################################################
qt5_use_modules(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} ${CAMITK_QT_COMPONENTS})
#########################################################################
# #
......@@ -1128,7 +1142,6 @@ macro(camitk_extension)
#########################################################################
# LINKING LIBRARIES
# Any component or action has to be linked with ${CAMITK_CORE_LIBRARIES} and with all its dependencies
# Nico : a supprimé ${QT_MODULES_LIBRARIES} de l'édition de liens
target_link_libraries(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} ${CAMITK_CORE_LIBRARIES} ${CAMITK_LIBRARIES} ${COMPONENT_EXTENSION_LIBRARIES} ${ACTION_EXTENSION_LIBRARIES} ${CEP_LIBRARIES} ${ITK_LIBRARIES} ${LIBXML2_LIBRARY} ${OpenCV_LIBRARIES} ${IGSTK_LIBRARIES} ${XERCESC_LIBRARIES} ${GDCM_LIBRARIES} ${EXTERNAL_LIBRARIES})
......
......@@ -160,35 +160,6 @@ macro(camitk_library)
#########################################################################
# #
# TARGET COMPILATION DEFINITION #
# #
# * Additional sources files to consider at compilation (.cpp) #
# * CMake project target definition depending on library type #
# public / private #
# #
#########################################################################
# CMAKE TARGET DEFINITION DEPENDENDING ON THE LIBRARY TYPE (SHARED or STATIC)
if (${DEFAULT_LIBRARY_NAME_CMAKE}_SHARED) # shared library
message(STATUS "Building shared library: ${LIBRARY_TARGET_NAME}")
add_library(${LIBRARY_TARGET_NAME} SHARED ${${DEFAULT_LIBRARY_NAME_CMAKE}_SOURCES})
# prepare the library specific info (SONAME...)
set(${LIBRARY_TARGET_NAME}_LIBRARY_PROPERTIES ${${LIBRARY_TARGET_NAME}_LIBRARY_PROPERTIES}
VERSION "${CAMITK_VERSION_MAJOR}.${CAMITK_VERSION_MINOR}.${CAMITK_VERSION_PATCH}"
SOVERSION "${CAMITK_VERSION_MAJOR}"
)
#
set_target_properties(${LIBRARY_TARGET_NAME} PROPERTIES ${${LIBRARY_TARGET_NAME}_LIBRARY_PROPERTIES} LINK_INTERFACE_LIBRARIES "")
elseif (${DEFAULT_LIBRARY_NAME_CMAKE}_STATIC) # static library
message(STATUS "Building static library: ${LIBRARY_TARGET_NAME}")
add_library(${LIBRARY_TARGET_NAME} STATIC ${${DEFAULT_LIBRARY_NAME_CMAKE}_SOURCES})
else()
message(FATAL_ERROR "In adding static library ${LIBRARY_TARGET_NAME}.\n Please specify the library type: SHARED or STATIC")
endif()
#########################################################################
# #
# ADDITIONAL KNOWN LIBRARY DEPENDENCIES #
......@@ -699,7 +670,6 @@ macro(camitk_library)
message(STATUS "${LIBRARY_TARGET_NAME}: found Qt ${Qt5_VERSION}.")
set(QT_INCLUDE_DIRS ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS} ${Qt5XmlPatterns_INCLUDE_DIRS} ${Qt5Declarative_INCLUDE_DIRS} ${Qt5Help_INCLUDE_DIRS} ${Qt5UiTools_INCLUDE_DIRS} ${Qt5OpenGL_INCLUDE_DIRS} ${Qt5OpenGLExtensions_INCLUDE_DIRS})
include_directories(${QT_INCLUDE_DIRS})
qt5_use_modules(${LIBRARY_TARGET_NAME} ${QT_COMPONENTS})
else()
message(SEND_ERROR "${LIBRARY_TARGET_NAME}: Failed to find Qt 5.x. This is needed by ${LIBRARY_TARGET_NAME}.")
endif()
......@@ -742,6 +712,49 @@ macro(camitk_library)
#########################################################################
# #
# TARGET COMPILATION DEFINITION #
# #
# * Additional sources files to consider at compilation (.cpp) #
# * CMake project target definition depending on library type #
# public / private #
# #
#########################################################################
# CMAKE TARGET DEFINITION DEPENDENDING ON THE LIBRARY TYPE (SHARED or STATIC)
if (${DEFAULT_LIBRARY_NAME_CMAKE}_SHARED) # shared library
message(STATUS "Building shared library: ${LIBRARY_TARGET_NAME}")
add_library(${LIBRARY_TARGET_NAME} SHARED ${${DEFAULT_LIBRARY_NAME_CMAKE}_SOURCES})
# prepare the library specific info (SONAME...)
set(${LIBRARY_TARGET_NAME}_LIBRARY_PROPERTIES ${${LIBRARY_TARGET_NAME}_LIBRARY_PROPERTIES}
VERSION "${CAMITK_VERSION_MAJOR}.${CAMITK_VERSION_MINOR}.${CAMITK_VERSION_PATCH}"
SOVERSION "${CAMITK_VERSION_MAJOR}"
)
#
set_target_properties(${LIBRARY_TARGET_NAME} PROPERTIES ${${LIBRARY_TARGET_NAME}_LIBRARY_PROPERTIES} LINK_INTERFACE_LIBRARIES "")
elseif (${DEFAULT_LIBRARY_NAME_CMAKE}_STATIC) # static library
message(STATUS "Building static library: ${LIBRARY_TARGET_NAME}")
add_library(${LIBRARY_TARGET_NAME} STATIC ${${DEFAULT_LIBRARY_NAME_CMAKE}_SOURCES})
else()
message(FATAL_ERROR "In adding static library ${LIBRARY_TARGET_NAME}.\n Please specify the library type: SHARED or STATIC")
endif()
#########################################################################
# #
# QT LINKING LIBRARIES #
# #
# * Set at linking the Qt5 libraries #
# #
#########################################################################
if(${DEFAULT_LIBRARY_NAME_CMAKE}_NEEDS_QT)
qt5_use_modules(${LIBRARY_TARGET_NAME} ${QT_COMPONENTS})
endif()
#########################################################################
# #
# CAMITK LIBRARIES DEPENDENCIES #
......@@ -792,7 +805,6 @@ macro(camitk_library)
# #
#########################################################################
# LINKING LIBRARIES
#Nico : TODO has removed ${QT_MODULES_LIBRARIES}
target_link_libraries(${LIBRARY_TARGET_NAME} ${CEP_LIBRARIES} ${LINKER_EXTERNAL_LIBRARIES} ${LIBXML2_LIBRARY} ${ITK_LIBRARIES} ${XERCESC_LIBRARIES})
......
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