Commit da98ed38 authored by promayon's avatar promayon
Browse files

NEW upstream version 3.0.7 (aka 3.1-rc1)

FIXED extensions have now so name (fix inner-dependencies, ld path and rpath) (best fix before eventual complete rewrite of extension management)
NEW Core has a new helpful diagnosis method (see camitk-imp --config and camitk-imp --printPath for result string)
FIXED updated man pages
FIXED some warnings


git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@435 ec899d31-69d1-42ba-9299-647d76f65fb3
parent bf8536ed
......@@ -132,7 +132,7 @@ void ImageReconstructionAction::build3DModel() {
threshold, keepLargestComponent,
subSample, subSampledImageXDim, subSampledImageYDim, subSampledImageZDim);
MeshComponent * result = new MeshComponent(resultPointSet, myComponent->getName() + "_mesh");
new MeshComponent(resultPointSet, myComponent->getName() + "_mesh");
Application::refresh();
}
......
......@@ -47,7 +47,7 @@ public:
/// set help string
void setDescription(std::string description);
/// parse command line and exit application was call with help or version arguments or if an parsing error occurs
/// parse command line and exit if application was call with help or version arguments or if an parsing error occurs
void parse();
/// print help (but do not exit the application)
......
.TH CAMITK-IMP "1" "July 2012" "camitk-imp 3.0.2" "User Commands"
.TH CAMITK-IMP "1" "February 2013" "camitk-imp 3.0.7" "User Commands"
.SH "NAME"
camitk-imp \- GUI flagship application for CamiTK
.SH "SYNOPSIS"
.B camitk-imp
[\fIOPTIONS\fR]... [\fIFILES\fR]...
.SH "DESCRIPTION"
.B camitk\-imp is build using CamiTK 3.0.2
.B camitk\-imp is build using CamiTK 3.0.7
.br
Please visit http://camitk.imag.fr for more information.
.br
......@@ -32,9 +32,15 @@ Print help and exit
\fB\-V\fR, \fB\-\-version\fR
Print version and exit
.TP
\fB\-\-noConsole\fR
\fB\-n\fR, \fB\-\-noConsole\fR
Disable CamiTK application consoleand redirect everything to
the standard output (default=off)
.TP
\fB\-p\fR, \fB\-\-printPath\fR
Print CamiTK path on the standard output and exit
.TP
\fB\-c\fR, \fB\-\-config\fR
Print all information for a complete CamiTK diagnosis and exit
.SH "AUTHORS"
CamiTK and camitk\-imp is currently developed by the UJF\-Grenoble 1, CNRS,
in the TIMC\-IMAG UMR 5525 laboratory.
......
......@@ -32,6 +32,7 @@
// -- Core stuff
#include <Application.h>
#include <Core.h>
#include <ExtensionManager.h>
using namespace camitk;
// Complete description
......@@ -67,14 +68,31 @@ int main(int argc, char *argv[]) {
CommandLineParser clp(argc, argv);
clp.setDescription(description);
clp.addOption("noConsole", "Disable CamiTK application console and redirect everything to\n the standard output (default=off)");
clp.addOption("printPath", "Print CamiTK path on the standard output and exit\n");
clp.addOption("config", "Print all information for a complete CamiTK diagnosis and exit\n");
clp.parse();
// init the camitk application context
Application a("imp", argc, argv);
if (clp.option("printPath")) {
std::cout << "CamiTK version: " << Core::version << std::endl;
std::cout << "- Install Directory............... " << Core::installDir << std::endl;
std::cout << "- Core Library Directory.......... " << Core::getCoreLibDir().toStdString() << std::endl;
std::cout << "- Test Data Directory............. " << Core::getTestDataDir().toStdString() << std::endl;
std::cout << "- Component Extension Directory... " << Core::getComponentDir().toStdString() << std::endl;
std::cout << "- Action Extension Directory...... " << Core::getActionDir().toStdString() << std::endl;
exit(EXIT_SUCCESS);
}
if (clp.option("config")) {
std::cout << Core::getConfig().toStdString() << std::endl;
exit(EXIT_SUCCESS);
}
// set the ImpMainWindow as the main window
a.setMainWindow(new ImpMainWindow());
// check for given filenames
for (std::vector<std::string>::iterator it = clp.getRemainingArguments().begin(); it!=clp.getRemainingArguments().end(); it++)
Application::open((*it).c_str());
......
......@@ -326,7 +326,6 @@ void ActionGenerator::writeCFile() throw (QString) {
text.replace(QRegExp("@FAMILY@"), family);
if (text.contains(QRegExp("@ADDITIONAL_INCLUDES@"))) {
int nbIncludes = additionalIncludes.size();
std::set<QString>::const_iterator it;
for (it = additionalIncludes.begin(); it != additionalIncludes.end(); it++) {
......
.TH CAMITK-WIZARD "1" "July 2012" "camitk-wizard 3.0.2" "User Commands"
.TH CAMITK-WIZARD "1" "February 2013" "camitk-wizard 3.0.7" "User Commands"
.SH NAME
camitk-wizard \- extension wizard for CamiTK developers
.SH SYNOPSIS
.B camitk-wizard
[\fIxmlFileName.xml pathToDevelopmentDirectory\fR]...
.SH DESCRIPTION
.B camitk\-wizard is build using CamiTK 3.0.2
.B camitk\-wizard is build using CamiTK 3.0.7
.br
Please visit http://camitk.imag.fr for more information.
.br
......
......@@ -7,7 +7,7 @@ set(CAMITK_PROJECT_NAME "CamiTK")
set (CAMITK_VER_MAJ "3")
set (CAMITK_VER_MIN "0")
set (CAMITK_VER_NICKNAME "white")
set (CAMITK_VER_PACKAGE_PAT "6") # patch version for packaging, change when appropriate
set (CAMITK_VER_PACKAGE_PAT "7") # patch version for packaging, change when appropriate
string(TOLOWER "${CAMITK_PROJECT_NAME}-${CAMITK_VER_MAJ}.${CAMITK_VER_MIN}" CAMITK_SHORT_VERSION_STRING)
......
......@@ -310,13 +310,15 @@ macro(camitk_extension)
set(CAMITK_${TYPE_EXTENSION_CMAKE}_${EXTENSION_NAME_CMAKE}_INTERNAL TRUE CACHE BOOL "Is variable ${TYPE_EXTENSION_CMAKE}_${EXTENSION_NAME} already created?")
mark_as_advanced(CAMITK_${TYPE_EXTENSION_CMAKE}_${EXTENSION_NAME_CMAKE}_INTERNAL)
endif()
message(STATUS "Building extension ${EXTENSION_NAME}")
# if this extension is enabled, do everything needed
# otherwise... do nothing
if (${TYPE_EXTENSION_CMAKE}_${EXTENSION_NAME_CMAKE})
# check for target name
set(${TYPE_EXTENSION_CMAKE}_TARGET_NAME ${TYPE_EXTENSION}-${EXTENSION_NAME})
message(STATUS "Building extension ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}")
# actions are compiled as shared object
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${TYPE_EXTENSION}s)
......@@ -422,9 +424,9 @@ macro(camitk_extension)
if(${EXTENSION_NAME_CMAKE}_NEEDS_COMPONENT_EXTENSION)
foreach(COMPONENT_NEEDED ${${EXTENSION_NAME_CMAKE}_NEEDS_COMPONENT_EXTENSION})
string(TOUPPER ${COMPONENT_NEEDED} ${COMPONENT_NEEDED}_INTERNAL)
set(COMPONENT_${${COMPONENT_NEEDED}_INTERNAL} ON CACHE BOOL "Required by extension ${EXTENSION_NAME}" FORCE )
set(COMPONENT_${${COMPONENT_NEEDED}_INTERNAL} ON CACHE BOOL "Required by extension ${EXTENSION_NAME}" FORCE )
set(COMPONENT_EXTENSION_LIBRARIES ${COMPONENT_EXTENSION_LIBRARIES} component-${COMPONENT_NEEDED})
include_directories(${CAMITK_INCLUDE_DIR}/components/${COMPONENT_NEEDED})
include_directories(${CAMITK_INCLUDE_DIR}/components/${COMPONENT_NEEDED})
endforeach()
endif()
......@@ -433,20 +435,17 @@ macro(camitk_extension)
if(${EXTENSION_NAME_CMAKE}_NEEDS_ACTION_EXTENSION)
foreach(ACTION_NEEDED ${${EXTENSION_NAME_CMAKE}_NEEDS_ACTION_EXTENSION})
string(TOUPPER ${ACTION_NEEDED} ${ACTION_NEEDED}_INTERNAL)
set(ACTION_${${ACTION_NEEDED}_INTERNAL} ON CACHE BOOL "Required by extension ${EXTENSION_NAME}" FORCE )
set(ACTION_${${ACTION_NEEDED}_INTERNAL} ON CACHE BOOL "Required by extension ${EXTENSION_NAME}" FORCE )
set(ACTION_EXTENSION_LIBRARIES ${ACTION_EXTENSION_LIBRARIES} action-${ACTION_NEEDED})
include_directories(${CAMITK_INCLUDE_DIR}/actions/${ACTION_NEEDED})
include_directories(${CAMITK_INCLUDE_DIR}/actions/${ACTION_NEEDED})
endforeach()
endif()
# check for target name
set(${TYPE_EXTENSION_CMAKE}_TARGET_NAME ${TYPE_EXTENSION}-${EXTENSION_NAME})
# check for libs in all known camitk dir + actions subdir (beware of the plateform bin or lib?)
link_directories( ${CAMITK_LIB_DIRECTORIES}
${CAMITK_BIN_DIR}
${CAMITK_BIN_DIR}
${CAMITK_BIN_DIR}/components
${CAMITK_BIN_DIR}/actions
${CAMITK_BIN_DIR}/actions
${CAMITK_INSTALL_ROOT}/lib/${CAMITK_SHORT_VERSION_STRING}/actions
${CAMITK_INSTALL_ROOT}/lib/${CAMITK_SHORT_VERSION_STRING}/components
${CAMITK_INSTALL_ROOT}/bin/components
......@@ -467,14 +466,14 @@ macro(camitk_extension)
# build the action extension module (library)
add_library(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} SHARED ${${EXTENSION_NAME_CMAKE}_SOURCES})
# Update XML Project description adding this target as a subproject of the main CamiTK project with
# its dependencies (in the CMake target point of view)
addSubProject(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} ${CAMITK_CORE_LIB} ${COMPONENT_EXTENSION_LIBRARIES} ${ACTION_EXTENSION_LIBRARIES} ${TOOL_LIBRARIES})
# Set the libraries required to link the target
# An action has to be linked with ${CAMITK_CORE_LIB}. As CAMTIK_CORE_LIB is always a DLL/shared lib, there should
# be no symbol loaded multiple times
# 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})
# dependencies to core (only set for internal build)
......@@ -482,11 +481,18 @@ macro(camitk_extension)
add_dependencies(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} ${CAMITK_CORE_LIB})
endif()
# see http://www.cmake.org/pipermail/cmake/2012-April/049889.html
# target properties (outputname and remove soname)
set_property(TARGET ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} PROPERTY NO_SONAME 1)
set_target_properties(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}
PROPERTIES OUTPUT_NAME ${EXTENSION_NAME}
# set_property(TARGET ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} PROPERTY NO_SONAME 1)
set_target_properties(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME}
PROPERTIES OUTPUT_NAME ${EXTENSION_NAME}
)
set(${TYPE_EXTENSION_CMAKE}_LIBRARY_PROPERTIES ${${TYPE_EXTENSION_CMAKE}_LIBRARY_PROPERTIES}
VERSION "${CAMITK_VER_MAJ}.${CAMITK_VER_MIN}.${CAMITK_VER_PAT}"
SOVERSION "${CAMITK_VER_MAJ}"
)
# set the library specific info (SONAME...)
set_target_properties(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} PROPERTIES ${${TYPE_EXTENSION_CMAKE}_LIBRARY_PROPERTIES} LINK_INTERFACE_LIBRARIES "")
# tools dependencies
if(${EXTENSION_NAME_CMAKE}_NEEDS_TOOL)
......@@ -499,9 +505,13 @@ macro(camitk_extension)
if(${EXTENSION_NAME_CMAKE}_NEEDS_COMPONENT_EXTENSION)
foreach(COMPONENT_NEEDED ${${EXTENSION_NAME_CMAKE}_NEEDS_COMPONENT_EXTENSION})
string(TOUPPER ${COMPONENT_NEEDED} COMPONENT_NEEDED_CMAKE)
# if this is not true, then the dependencies is from an external build, do not use add_dependencies
# if this is not true, then the dependencies is from an external build, do not use add_dependencies
if (CAMITK_COMPONENT_${COMPONENT_NEEDED_CMAKE}_INTERNAL)
add_dependencies(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} component-${COMPONENT_NEEDED})
add_dependencies(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} component-${COMPONENT_NEEDED})
# message(STATUS "............................................................ ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} depends on component-${COMPONENT_NEEDED}")
# if(NOT TARGET "component-${COMPONENT_NEEDED}")
# message(STATUS "............................................................ component-${COMPONENT_NEEDED} not existing (yet)")
# endif()
endif()
endforeach()
endif()
......@@ -510,9 +520,13 @@ macro(camitk_extension)
if(${EXTENSION_NAME_CMAKE}_NEEDS_ACTION_EXTENSION)
foreach(ACTION_NEEDED ${${EXTENSION_NAME_CMAKE}_NEEDS_ACTION_EXTENSION})
string(TOUPPER ${ACTION_NEEDED} ACTION_NEEDED_CMAKE)
# if this is not true, then the dependencies is from an external build, do not use add_dependencies
# if this is not true, then the dependencies is from an external build, do not use add_dependencies
if (CAMITK_ACTION_${ACTION_NEEDED_CMAKE}_INTERNAL)
add_dependencies(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} action-${ACTION_NEEDED})
add_dependencies(${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} action-${ACTION_NEEDED})
# message(STATUS "............................................................ ${${TYPE_EXTENSION_CMAKE}_TARGET_NAME} depends on action-${ACTION_NEEDED}")
# if(NOT TARGET "action-${ACTION_NEEDED}")
# message(STATUS "............................................................ action-${ACTION_NEEDED} not existing")
# endif()
endif()
endforeach()
endif()
......
......@@ -92,4 +92,5 @@ namespace camitk
const char * Core::version = "@CAMITK_VERSION_STRING@";
const char * Core::shortVersion = "@CAMITK_SHORT_VERSION_STRING@";
const char * Core::installDir = "@CAMITK_INSTALL_ROOT@";
const char * Core::soVersion = "@CAMITK_VER_MAJ@";
}
......@@ -27,16 +27,79 @@
#include "Core.h"
#include "CamiTKVersion.h"
#include "Log.h"
#include "ExtensionManager.h"
#include "Action.h"
// -- QT stuff
#include <QDir>
#include <QApplication>
namespace camitk
{
namespace camitk {
QString Core::binDirName;
// ------------- getConfig (static) -----------------
const QString Core::getConfig() {
QStringList diagnosis;
diagnosis << "CamiTK............................ " + QString(Core::version);
diagnosis << "- CamiTK Short Version............ " + QString(Core::shortVersion);
diagnosis << "- CamiTK SO NAME.................. " + QString(Core::soVersion);
diagnosis << "- Installed....................... " + QString(isInstalled()?"Yes":"No");
diagnosis << "- Root Dir........................ " + getRootDir();
//diagnosis << "- Bin Dir......................... " + getBinDirName();
diagnosis << "- Shared Lib Dir.................. " + sharedDirectory();
if (!hasBuildTypeDirectory().isEmpty())
diagnosis << "- Has Build Type Directory........ " + hasBuildTypeDirectory();
if (hasMacOSDirectory())
diagnosis << "- Has Mac OS Directory";
if (hasBinaryVersionSubdir())
diagnosis << "- Has Binary Version Sub Directory";
diagnosis << "- Install Directory............... " + QString(Core::installDir);
diagnosis << "- Core Library Directory.......... " + Core::getCoreLibDir();
diagnosis << "- Test Data Directory............. " + Core::getTestDataDir();
diagnosis << "- Component Extension Directory... " + Core::getComponentDir();
diagnosis << "- Action Extension Directory...... " + Core::getActionDir();
unsigned int componentCount = 0;
QStringList components;
const QMap<QString, ComponentExtension*> & allCE = ExtensionManager::getComponentExtensions();
foreach(ComponentExtension *ce, allCE.values().toSet()) {
components << "- " + ce->getName() + " (" + ce->getFileExtensions().join(" ") + ") : " + ce->getDescription();
componentCount++;
}
diagnosis << "- Number of Component Extensions.. " + QString::number(componentCount);
unsigned int actionCount = 0;
QStringList actions;
const QMap<QString, ActionExtension* >& allActions = ExtensionManager::getActionExtensions();
foreach(ActionExtension *ae, allActions.values()) {
actions << "- " + ae->getName() + ": " + ae->getDescription();
foreach(Action *a, ae->getActions()) {
actions << "\t- " + a->getName() + ": " + a->getDescription();
actionCount++;
}
}
diagnosis << "- Number of Action Extensions..... " + QString::number(actionCount);
diagnosis << "- Registered components:";
diagnosis += components;
diagnosis << "- Registered actions:";
diagnosis += actions;
return diagnosis.join("\n");
}
// ------------- getComponentDir (static) -----------------
const QString Core::getComponentDir() {
QDir rootDir(getRootDir()); // either install or build
......@@ -62,18 +125,18 @@ const QString Core::getComponentDir() {
const QString Core::getActionDir() {
QDir rootDir(getRootDir()); // either install or build
QString subDir = hasBuildTypeDirectory();
QString subDir = hasBuildTypeDirectory();
QString actionSubDir = sharedDirectory();
if (hasBinaryVersionSubdir())
actionSubDir += "/" + QString(Core::shortVersion);
actionSubDir += "/actions/" + hasBuildTypeDirectory();
actionSubDir += "/" + QString(Core::shortVersion);
actionSubDir += "/actions/" + hasBuildTypeDirectory();
// check actions subdir
if (!rootDir.cd(actionSubDir)) {
CAMITK_ERROR("Core", "getActionDir", "Action extension directory not found\n\tRoot dir: " << getRootDir().toStdString()<< "\n\tAction subdir: " << actionSubDir.toStdString());
return QString(); // null QString
CAMITK_ERROR("Core", "getActionDir", "Action extension directory not found\n\tRoot dir: " << getRootDir().toStdString()<< "\n\tAction subdir: " << actionSubDir.toStdString());
return QString(); // null QString
}
return rootDir.canonicalPath().toUtf8();
......@@ -128,10 +191,12 @@ const QString Core::hasBuildTypeDirectory() {
#if defined(Q_CC_MSVC)
// get the executable path
QDir binDir ( qApp->applicationDirPath() );
// check the name
if ( binDir.dirName().toLower() == "debug" || binDir.dirName().toLower() == "release" ) {
buildType = binDir.dirName();
}
#endif
return buildType;
......@@ -154,8 +219,10 @@ const bool Core::hasMacOSDirectory() {
// ------------- hasBinaryVersionSubdir (static) -----------------
const bool Core::hasBinaryVersionSubdir() {
#if defined(Q_CC_GNU) && !defined(__MINGW32__) // linux but not mingw32
if (isInstalled())
return true; // only when installed
#endif
return false;
}
......@@ -170,11 +237,12 @@ const bool Core::isInstalled() {
const QString Core::getRootDir() {
// get the executable path (bin dir)
QDir rootDir ( qApp->applicationDirPath() );
binDirName = "bin";
QString nullString;
binDirName = "bin";
QString nullString;
bool cdOk = true;
QString subdir = hasBuildTypeDirectory();
if (!subdir.isNull()) {
cdOk = cdOk && rootDir.cdUp(); // bin dir
}
......@@ -187,16 +255,18 @@ const QString Core::getRootDir() {
// here rootDir should be "bin"
if (rootDir.dirName() != binDirName) {
// check for "binDebug" (install of Debug version)
binDirName = "binDebug";
if (rootDir.dirName() != binDirName) {
CAMITK_ERROR("Core", "getRootDir", "Invalid binary directory.\tApplication " << qApp->applicationName().toStdString() << " in " << qApp->applicationDirPath().toStdString() << "\n\tbin directory:" << rootDir.canonicalPath().toStdString());
return nullString;
}
// check for "binDebug" (install of Debug version)
binDirName = "binDebug";
if (rootDir.dirName() != binDirName) {
CAMITK_ERROR("Core", "getRootDir", "Invalid binary directory.\tApplication " << qApp->applicationName().toStdString() << " in " << qApp->applicationDirPath().toStdString() << "\n\tbin directory:" << rootDir.canonicalPath().toStdString());
return nullString;
}
}
// So as we are in the bin directory, up we go!
cdOk = cdOk && rootDir.cdUp();
if ( !cdOk ) {
CAMITK_ERROR("Core", "getRootDir", "Invalid root directory.\tApplication " << qApp->applicationName().toStdString() << " in " << qApp->applicationDirPath().toStdString() << "\n\tRoot directory:" << rootDir.canonicalPath().toStdString());
return nullString;
......@@ -206,19 +276,23 @@ const QString Core::getRootDir() {
// starts from root dir
QDir camitkcoreDir(rootDir);
// check bin dir
cdOk = camitkcoreDir.cd(binDirName);
cdOk = camitkcoreDir.cd(binDirName);
if (!cdOk)
// try lib
cdOk = camitkcoreDir.cd("lib");
if (!subdir.isNull()) {
cdOk = cdOk && camitkcoreDir.cd(subdir); // bin dir
}
// bin or bin/Debug or bin/Release (and if not there lib) were tested
if (cdOk && checkCoreLibDir(camitkcoreDir.canonicalPath())) {
// the corelib is where it should be: this is an internall call, or else a external call
// but from the same build/install directory structure
return rootDir.canonicalPath();
}
// either there is no shared directory or the shared directory does not contains
// camitkcore, therefore getRootDir() must be called externally, root dir is installDir!
return QDir(installDir).canonicalPath();
......@@ -228,7 +302,7 @@ const QString Core::getRootDir() {
// ------------- checkCoreLibDir (static) -----------------
bool Core::checkCoreLibDir(QString dir) {
QStringList coreLibFilter;
coreLibFilter << "*camitkcore.so" << "*camitkcore.dll" << "*camitkcore.dylib";
coreLibFilter << "*camitkcore.so." + QString(Core::soVersion) << "*camitkcore.dll" << "*camitkcore.dylib";
QStringList coreLibs = QDir(dir).entryList(coreLibFilter, QDir::Files);
return (coreLibs.size()==1);
}
......@@ -242,19 +316,22 @@ const QString Core::getCoreLibDir() {
// check: core lib should be here
if (checkCoreLibDir(rootDir + "/" + corelibSubDir))
return rootDir + "/" + corelibSubDir;
return rootDir + "/" + corelibSubDir;
else
return QString();
}
// ------------- sharedDirectory (static) -----------------
const QString Core::sharedDirectory() {
if (binDirName.isEmpty())
binDirName="bin";
if (binDirName.isEmpty())
binDirName="bin";
QString sharedDir = binDirName;
#if defined(Q_CC_GNU) && !defined(__MINGW32__) // linux but not mingw32
if (isInstalled())
sharedDir = "lib";
#endif
return sharedDir;
}
......
......@@ -58,6 +58,9 @@ public:
/// get the camitk core lib directory name (where the camitkcore dll/shared/dynamic lib is)
static const QString getCoreLibDir();
/// get more information about installation, etc...
static const QString getConfig();
///@}
/// @name miscallaneous utility method or variables
......@@ -68,6 +71,8 @@ public:
static const char *shortVersion;
/// fall-back install directory (if the autodetection did not work...)
static const char *installDir;
/// version used for so name
static const char *soVersion;
///@}
private:
......
......@@ -60,8 +60,6 @@ QMap< QString, ComponentExtension* > & ExtensionManager::getDataDirectoryCompone
// -------------------- autoloadComponentExtensions --------------------
void ExtensionManager::autoloadComponentExtensions() {
// In order to manage static instances, add code here to load the static instances using QPluginLoader::staticInstances()
// get the executable path
QDir extensionsDir(Core::getComponentDir());
......@@ -81,7 +79,7 @@ void ExtensionManager::autoloadComponentExtensions() {
// try to load all Components in the directory
QStringList pluginFile;
// linux: .so, windows: .dll, macOs: .dylib
pluginFile << "*.so" << "*.dll" << "*.dylib";
pluginFile << "*.so." + QString(Core::soVersion) << "*.dll" << "*.dylib";
// loop to load component plugin, taking into account internal dependencies (i.e. dependency between
// one component and another one.
......@@ -294,8 +292,6 @@ const QMap< QString, ActionExtension* >& ExtensionManager::getActionExtensions()
// -------------------- autoloadActionExtensions --------------------
void ExtensionManager::autoloadActionExtensions() {
// TODO? may be try to first load the static instances using QPluginLoader::staticInstances() ?
// get the executable path
QDir actionsDir(Core::getActionDir());
......@@ -305,7 +301,7 @@ void ExtensionManager::autoloadActionExtensions() {
else {
// try to load all Components in the directory
QStringList extensionFile;
extensionFile << "*.so" << "*.dll" << "*.dylib";
extensionFile << "*.so." + QString(Core::soVersion) << "*.dll" << "*.dylib";
// loop to load action extension, taking into account internal dependencies (i.e. dependency between
// one action and another one.
......@@ -368,7 +364,7 @@ bool ExtensionManager::loadActionExtension(QString fileName) {
}
}
else {
CAMITK_ERROR("ExtensionManager", QString("loadAction(" + fileName + ")").toStdString(), "QPluginLoader error: " + pluginLoader.errorString().toStdString());
pluginLoader.unload(); // to make sure we could try again later
}
return false;
......
......@@ -252,7 +252,7 @@ void SettingsDialog::on_resetConfigurationButton_released() {
// ------------------------------ on_addComponentExtensionButton_released -------------------------------
void SettingsDialog::on_addComponentExtensionButton_released() {
QStringList files = QFileDialog::getOpenFileNames(0, "Add a ComponentExtension (Component) Plugin", Core::getComponentDir(), "Component Plugin (*.so *.dll *.dylib)");
QStringList files = QFileDialog::getOpenFileNames(0, "Add a ComponentExtension (Component) Plugin", Core::getComponentDir(), "Component Plugin (*.so.* *.dll *.dylib)");
QStringList pluginFile = files;
QStringList::Iterator it = pluginFile.begin();
......@@ -303,7 +303,7 @@ void SettingsDialog::on_componentExtensionList_cellClicked(int row, int column)
// ------------------------------ on_addActionExtensionButton_released -------------------------------
void SettingsDialog::on_addActionExtensionButton_released() {
QStringList files = QFileDialog::getOpenFileNames(0, "Add an Action Extension", Core::getActionDir(), "Action Extension (*.so *.dll *.dylib)");
QStringList files = QFileDialog::getOpenFileNames(0, "Add an Action Extension", Core::getActionDir(), "Action Extension (*.so.* *.dll *.dylib)");
QStringList pluginFile = files;
QStringList::Iterator it = pluginFile.begin();
......
Supports Markdown
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