Commit 119eee45 authored by promayon's avatar promayon

FIXED icescrum CAMITK-116 macros for CEP management/compatibility, e.g....

FIXED icescrum CAMITK-116 macros for CEP management/compatibility, e.g. camitk_tools now camitk_library, NEEDS_TOOLS now NEEDS_CEP_LIBRARIES
FIXED icescrum CAMITK-67   camitk-imp does not crash if application extension not found, but (more politely) ask to check the configuration


git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@720 ec899d31-69d1-42ba-9299-647d76f65fb3
parent af5693b3
......@@ -9,7 +9,7 @@
# => DO NOT FORGET to regenerate CMake in case you add/remove a source file to your project
# all CMake project names and variables should be in uppercase
project(CAMITK)
project(CAMITKSDK)
cmake_minimum_required(VERSION 2.6)
......@@ -24,7 +24,7 @@ include(${VTK_USE_FILE})
# Configure CamiTK
# update module path
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CAMITK_SOURCE_DIR}/cmake/modules)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
# include CamiTK Internal Build environment
include(CamiTKCoreBuild)
# include CamiTK variables
......@@ -47,11 +47,11 @@ camitk_sub_project_init()
# add all subprojects
add_subdirectory(cmake) # rules for cmake install
camitk_add_subdirectory(applications)
camitk_add_subdirectory(actions)
camitk_add_subdirectory(components)
add_subdirectory(core)
camitk_add_subdirectory(tools)
camitk_add_subdirectory(components)
camitk_add_subdirectory(actions)
camitk_add_subdirectory(applications)
# Validate and write down the Project.xml file
# This file contains all the CamiTK project description with subprojects and their CMake target dependencies
......
camitk_extension(ACTION_EXTENSION
NEEDS_LIBXML2
NEEDS_XSD
NEEDS_TOOL pml mml monitoring lml
NEEDS_CEP_LIBRARIES pml mml monitoring lml
NEEDS_COMPONENT_EXTENSION physicalmodel mml vtkmesh physicalmodel
)
......
......@@ -34,6 +34,7 @@
#include <Component.h>
#include <Action.h>
#include <Log.h>
#include <Core.h> // for getActionDir()
using namespace camitk;
// -- QT stuff
......@@ -120,6 +121,19 @@ void ImpMainWindow::setCentralViewer ( Viewer* theViewer ) {
// ------------- initActions -----------------
void ImpMainWindow::initActions() {
//-- Check for action applications
ActionExtension *applicationActionExtension = NULL;
QListIterator<ActionExtension*> it(ExtensionManager::getActionExtensions().values());
while (it.hasNext() && applicationActionExtension==NULL) {
ActionExtension* current=it.next();
if (current->getName() == "Application Level Action Extension")
applicationActionExtension = current;
}
if (applicationActionExtension==NULL) {
QMessageBox::critical(this,"Application Error", "This application <b>needs</b> the Application Action Extension and could not find it in the action extension directory (<tt>" + Core::getActionDir() + "</tt>).<br/><br/>Please check your CamiTK configuration and/or installation<br/><br/>E.g. run this application with the option <tt>--config</tt>.");
exit(EXIT_FAILURE);
}
//--- actions of the File menu
// get the CamiTK actions
fileOpen = Application::getAction ("Open")->getQAction();
......
......@@ -16,7 +16,7 @@ endif()
# use the application extension macro
application_extension(NEEDS_XSD
NEEDS_XERCESC
NEEDS_TOOL coreschema)
NEEDS_CEP_LIBRARIES coreschema)
if(APPLICATION_WIZARD)
# build-time FindCamiTK.cmake install
......
......@@ -156,7 +156,7 @@ void ExtensionGenerator::generateCMakeLists() throw (QString) {
// Checking for dependancies
QMap<QString, QString> neededLibs;
QStringList neededComponents;
QStringList neededTools;
QStringList neededCEPLibs;
if (! theExtension->external().empty() ) {
for (Extension::external_const_iterator it = theExtension->external().begin();
......@@ -171,7 +171,7 @@ void ExtensionGenerator::generateCMakeLists() throw (QString) {
neededLibs.insert(QString((*it).name().c_str()), ((*it).additional().present() ? QString((*it).additional().get().c_str()) : QString("")));
else
if (type == QString("tool"))
neededTools.push_back(QString((*it).name().c_str()));
neededCEPLibs.push_back(QString((*it).name().c_str()));
}
}
......@@ -209,11 +209,11 @@ void ExtensionGenerator::generateCMakeLists() throw (QString) {
}
}
else
if (text.contains(QRegExp("@NEEDEDTOOLS@"))) {
if (! neededTools.isEmpty()) {
out << "NEEDS_TOOL ";
if (text.contains(QRegExp("@NEEDEDCEPLIBRARIES@"))) {
if (! neededCEPLibs.isEmpty()) {
out << "NEEDS_CEP_LIBRARIES ";
for (QStringList::const_iterator it = neededTools.begin(); it < neededTools.end(); it++)
for (QStringList::const_iterator it = neededCEPLibs.begin(); it < neededCEPLibs.end(); it++)
out << (*it) << " ";
out << endl;
......
......@@ -7,7 +7,7 @@ include(CreateLaunchers)
camitk_extension(@EXTTYPEHIGH@_EXTENSION
DEFAULT
@NEEDEDLIBS@
@NEEDEDTOOLS@
@NEEDEDCEPLIBRARIES@
@NEEDEDCOMPEXT@
)
......
......@@ -20,6 +20,9 @@ string(TOLOWER "${CAMITK_PROJECT_NAME}-${CAMITK_VER_MAJ}.${CAMITK_VER_MIN}" CAMI
set(CAMITK_INTERNAL_BUILD TRUE CACHE BOOL "Is this a CamiTK build?" FORCE)
mark_as_advanced(CAMITK_INTERNAL_BUILD)
# TODO check if CEPization can remove this variable
set(CAMITK_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
# Package copy the CamiTKVersion.h to the source tree
if(EXISTS ${CAMITK_SOURCE_DIR}/core/CamiTKVersion.h)
# In packaged source tree, do not get the svn version
......@@ -36,12 +39,12 @@ else()
endif(Subversion_FOUND)
# prepare the file for the camitk package source build
set(CAMITK_VERSION_STRING "${CAMITK_PROJECT_NAME} ${CAMITK_VER_MAJ}.${CAMITK_VER_MIN}.${CAMITK_VER_PACKAGE_PAT}")
configure_file(${CAMITK_SOURCE_DIR}/core/CamiTKVersion.h.in ${CAMITK_BINARY_DIR}/CamiTKPackageVersion.h @ONLY)
configure_file(${CAMITK_SOURCE_DIR}/core/CamiTKVersion.h.in ${CMAKE_CURRENT_BINARY_DIR}/CamiTKPackageVersion.h @ONLY)
# create current version string
set(CAMITK_VERSION_STRING "${CAMITK_PROJECT_NAME} ${CAMITK_VER_MAJ}.${CAMITK_VER_MIN}.${CAMITK_VER_PAT}")
# now create the correct version header
configure_file(${CAMITK_SOURCE_DIR}/core/CamiTKVersion.h.in ${CAMITK_BINARY_DIR}/core/CamiTKVersion.h)
configure_file(${CAMITK_SOURCE_DIR}/core/CamiTKVersion.h.in ${CMAKE_CURRENT_BINARY_DIR}/core/CamiTKVersion.h)
endif()
message(STATUS "Welcome to ${CAMITK_VERSION_STRING}, enjoy your compilation!")
......
This diff is collapsed.
......@@ -177,7 +177,6 @@ if (UNIX AND NOT WIN32)
# package name
string(TOLOWER "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${CAMITK_VER_NICKNAME}-${LSB_DISTRIB}_${CPACK_PACKAGE_ARCHITECTURE}" CPACK_PACKAGE_FILE_NAME)
message(STATUS "CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}")
endif()
......@@ -409,27 +408,27 @@ include(CPack)
# create specific target for package source
add_custom_target(camitk_package_source
COMMAND ${CMAKE_COMMAND}
-E copy ${CAMITK_BINARY_DIR}/CamiTKPackageVersion.h
${CAMITK_SOURCE_DIR}/core/CamiTKVersion.h
-E copy ${CMAKE_CURRENT_BINARY_DIR}/CamiTKPackageVersion.h
${CMAKE_CURRENT_BINARY_DIR}/core/CamiTKVersion.h
COMMAND ${CMAKE_COMMAND}
--build ${CMAKE_BINARY_DIR}
--target package_source
COMMAND ${CMAKE_COMMAND}
-E remove ${CAMITK_SOURCE_DIR}/core/CamiTKVersion.h
-E remove ${CMAKE_CURRENT_BINARY_DIR}/core/CamiTKVersion.h
)
# create specific target for binary package
add_custom_target(camitk_package
COMMAND ${CMAKE_COMMAND}
-E copy ${CAMITK_BINARY_DIR}/core/CamiTKVersion.h
${CAMITK_BINARY_DIR}/core/CamiTKVersion.h-backup
-E copy ${CMAKE_CURRENT_BINARY_DIR}/core/CamiTKVersion.h
${CMAKE_CURRENT_BINARY_DIR}/core/CamiTKVersion.h-backup
COMMAND ${CMAKE_COMMAND}
-E copy ${CAMITK_BINARY_DIR}/CamiTKPackageVersion.h
${CAMITK_BINARY_DIR}/core/CamiTKVersion.h
-E copy ${CMAKE_CURRENT_BINARY_DIR}/CamiTKPackageVersion.h
${CMAKE_CURRENT_BINARY_DIR}/core/CamiTKVersion.h
COMMAND ${CMAKE_COMMAND}
--build ${CMAKE_BINARY_DIR}
--target package
COMMAND ${CMAKE_COMMAND}
-E copy ${CAMITK_BINARY_DIR}/core/CamiTKVersion.h-backup
${CAMITK_BINARY_DIR}/core/CamiTKVersion.h
-E copy ${CMAKE_CURRENT_BINARY_DIR}/core/CamiTKVersion.h-backup
${CMAKE_CURRENT_BINARY_DIR}/core/CamiTKVersion.h
)
......@@ -4,7 +4,7 @@
# all CMake project names and variables should be in uppercase
#
# CamiTK extension framework is based on Qt. It can only work if Qt is compiled as shared lib (.dll or .so)
# Use keyword STATIC for tool library
# Use keyword STATIC for CEP library
# Use keyword SHARED for extensions
# Use keyword MODULE for actions
......
......@@ -15,7 +15,7 @@ endif()
camitk_extension(COMPONENT_EXTENSION
NEEDS_LIBXML2
NEEDS_XSD
NEEDS_TOOL pml lml mml monitoringgui monitoring
NEEDS_CEP_LIBRARIES pml lml mml monitoringgui monitoring
NEEDS_COMPONENT_EXTENSION vtkmesh physicalmodel
HEADERS_TO_INSTALL MMLComponentExtension.h
MMLComponent.h
......
# build component extension
camitk_extension(
COMPONENT_EXTENSION
NEEDS_LIBXML2
NEEDS_TOOL pml lml
COMPONENT_EXTENSION
NEEDS_LIBXML2
NEEDS_CEP_LIBRARIES pml lml
INCLUDE_DIRECTORIES loads ${CMAKE_CURRENT_BINARY_DIR}/loads
DEFINES COMPILE_PHYSICALMODEL_COMPONENT_API
HEADERS_TO_INSTALL PMComponentAPI.h
......@@ -85,7 +85,7 @@ if(COMPONENT_PHYSICALMODEL)
string(REGEX REPLACE ";" " " DOXYGEN_INPUT_LIST "${DOXYGEN_SOURCE_DIR}")
configure_file(doxygen.conf.in ${CMAKE_CURRENT_BINARY_DIR}/doxygen.conf)
#set(HTML_TARGET ${DOXYGEN_OUTPUT_DIR}/html/index.html)
#set(HTML_TARGET ${DOXYGEN_OUTPUT_DIR}/html/index.html)
add_custom_target(api-doc ALL
${DOXYGEN} ${CMAKE_CURRENT_BINARY_DIR}/doxygen.conf
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/doxygen.conf)
......
......@@ -121,7 +121,7 @@ public:
/// unload an action extension using its .dll/.so/.dylib filename
static bool unloadActionExtension(QString);
/** get all the registered action extension.
/** get all the registered action extension (key is the share object/dll/dylib filename that contains the ActionExtension).
* This is the public method (return a const, the extensions map is private
* and cannot be modified externally).
*/
......@@ -131,7 +131,7 @@ public:
private:
/** get the singleton map of loaded component plugins for files (the key is the file extension)
* This is the private (intern) method.
* The component extension map is updated by loadExtension, unloadExtension and autoloadExtensions.
* The component extension map is updated by loadComponentExtension, unloadComponentExtension and autoloadComponentExtensions.
* This method follows the "construct on first use" idiom/design-pattern.
* It therefore avoids the infamous "static initialization order fiasco",
* see http://www.parashift.com/c++-faq/ctors.html
......@@ -147,9 +147,9 @@ private:
*/
static QMap<QString, ComponentExtension*> & getDataDirectoryComponentExtensionMap();
/** get the singleton map of loaded component plugins for files (the key is the file extension)
/** get the singleton map of loaded action plugins (the key is the shared object/dll/dylib filename)
* This is the private (intern) method.
* The component extension map is updated by loadExtension, unloadExtension and autoloadExtensions.
* The component extension map is updated by loadActionExtension, unloadActionExtension and autoloadActionExtensions.
* This method follows the "construct on first use" idiom/design-pattern.
* It therefore avoids the infamous "static initialization order fiasco",
* see http://www.parashift.com/c++-faq/ctors.html
......
......@@ -28,9 +28,9 @@ else()
set(MML_GENERATE_XSD_LIB OFF)
endif()
camitk_tool(STATIC
SOURCES ${XSD_H} ${XSD_SRCS}
NEEDS_XSD
camitk_library(STATIC
SOURCES ${XSD_H} ${XSD_SRCS}
NEEDS_XSD
)
#--------------
......
......@@ -50,9 +50,9 @@ set( SRCS
${HEADERS}
)
camitk_tool(STATIC
SOURCES ${SRCS}
NEEDS_LIBXML2
camitk_library(STATIC
SOURCES ${SRCS}
NEEDS_LIBXML2
)
#---------
......
......@@ -50,10 +50,10 @@ endif(MML_SOFA_SUPPORT)
add_definitions(-DCOMPILE_MML_MONIGORING_GUI_TOOL)
# add lib as a camitk tool
camitk_tool(STATIC
LIBNAME monitoringgui
SOURCES ${gui_SRCS}
INCLUDE_DIRECTORIES ${MML_INCLUDE_DIRECTORIES} ${CAMITK_INCLUDE_DIR}/monitoring ${QT_INCLUDE_DIR}
camitk_library(STATIC
LIBNAME monitoringgui
SOURCES ${gui_SRCS}
INCLUDE_DIRECTORIES ${MML_INCLUDE_DIRECTORIES} ${CAMITK_INCLUDE_DIR}/monitoring ${QT_INCLUDE_DIR}
)
add_dependencies(monitoringgui monitoring)
......
......@@ -358,11 +358,11 @@ endif(MML_GENERATE_GUI)
add_definitions(-DCOMPILE_MML_TOOL)
# add lib as a camitk tools
camitk_tool(SHARED
SOURCES ${monitoring_SRCS}
TARGET_LINK_LIBRARIES ${monitoring_LIBRARIES}
INCLUDE_DIRECTORIES ${monitoring_INCLUDE_DIR}
LINK_DIRECTORIES ${monitoring_link}
camitk_library(SHARED
SOURCES ${monitoring_SRCS}
TARGET_LINK_LIBRARIES ${monitoring_LIBRARIES}
INCLUDE_DIRECTORIES ${monitoring_INCLUDE_DIR}
LINK_DIRECTORIES ${monitoring_link}
)
add_dependencies(monitoring lml pml mml)
......
......@@ -35,10 +35,10 @@ endif()
# add lib as a camitk tool
# force to mml (default should be schema as it is in the schema dir, but schema is too generic!)
camitk_tool(STATIC
LIBNAME mml
SOURCES ${monitoringLib_SRCS}
NEEDS_XSD
camitk_library(STATIC
LIBNAME mml
SOURCES ${monitoringLib_SRCS}
NEEDS_XSD
)
#--------------
......
......@@ -58,10 +58,10 @@ set (SRCS Atom.cpp
)
camitk_tool(STATIC
SOURCES ${SRCS}
INCLUDE_DIRECTORIES ${PhysicalModelProperties_DIR}
NEEDS_LIBXML2
camitk_library(STATIC
SOURCES ${SRCS}
INCLUDE_DIRECTORIES ${PhysicalModelProperties_DIR}
NEEDS_LIBXML2
)
#-----------
......
......@@ -29,10 +29,10 @@ set(CUSTOM_PLOT_SOURCES
add_definitions(-DCOMPILE_QCUSTOMPLOT)
# add lib as a camitk tool
camitk_tool(SHARED
SOURCES ${CUSTOM_PLOT_SOURCES}
TARGET_LINK_LIBRARIES ${QT_LIBRARIES}
INCLUDE_DIRECTORIES ${QT_INCLUDE_DIR}
camitk_library(SHARED
SOURCES ${CUSTOM_PLOT_SOURCES}
TARGET_LINK_LIBRARIES ${QT_LIBRARIES}
INCLUDE_DIRECTORIES ${QT_INCLUDE_DIR}
)
# take all the headers for installation
......
......@@ -16,7 +16,7 @@ set(QT_MIN_VERSION "4.6.0")
FIND_PACKAGE(Qt4 REQUIRED)
if(NOT QT4_FOUND)
message(SEND_ERROR "Failed to find Qt 4.6 or greater. This is needed for qtpropertybrowser tool, and therefore for CamiTK.")
message(SEND_ERROR "Failed to find Qt 4.6 or greater. This is needed for qtpropertybrowser lib, and therefore for CamiTK.")
endif()
include(${QT_USE_FILE})
......@@ -130,9 +130,9 @@ set(SRCS ${extension_MOC}
add_definitions(-DCOMPILE_QTPROPERTYBROWSER)
camitk_tool(SHARED
SOURCES ${SRCS}
TARGET_LINK_LIBRARIES ${QT_LIBRARIES}
camitk_library(SHARED
SOURCES ${SRCS}
TARGET_LINK_LIBRARIES ${QT_LIBRARIES}
)
# take all the headers for installation
......
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