Attention une mise à jour du serveur va être effectuée le lundi 17 mai entre 13h et 13h30. Cette mise à jour va générer une interruption du service de quelques minutes.

Commit 2520d3e1 authored by nschnitz's avatar nschnitz

Merge branch 'master' of github.com:d-tk/dtk

parents 8318b022 f7632f78
......@@ -14,6 +14,8 @@
cmake_minimum_required(VERSION 2.8.11)
######################################################################
if(${CMAKE_MAJOR_VERSION} GREATER 2)
cmake_policy(SET CMP0028 NEW)
endif(${CMAKE_MAJOR_VERSION} GREATER 2)
......@@ -75,8 +77,8 @@ endif(APPLE)
if(NOT APPLE AND NOT MSVC)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11)
check_cxx_compiler_flag("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-unknown-pragmas")
elseif(COMPILER_SUPPORTS_CXX0X)
......@@ -107,9 +109,9 @@ endif(CMAKE_SIZEOF_VOID_P MATCHES 8)
## Options
## #################################################################
option(DTK_ENABLE_COVERAGE "enable coverage report" false)
option(DTK_COVERAGE_USE_COBERTURA "use cobertura coverage format" true)
option(DTK_ENABLE_MEMCHECK "enable valgrind memcheck report" false)
option(DTK_ENABLE_COVERAGE "enable coverage report" false)
option(DTK_COVERAGE_USE_COBERTURA "use cobertura coverage format" true)
option(DTK_ENABLE_MEMCHECK "enable valgrind memcheck report" false)
option(DTK_BUILD_COMPOSER "Build composer layer" false)
option(DTK_BUILD_DISTRIBUTED "Build distributed layer" true)
......@@ -131,8 +133,9 @@ option(DTK_BUILD_SUPPORT_VR "Build support layer" false)
if(DTK_ENABLE_MEMCHECK)
find_program( CTEST_MEMORYCHECK_COMMAND valgrind )
set( CTEST_MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full --xml=yes --suppressions=${CMAKE_SOURCE_DIR}/tst/gtk.suppressions --xml-file=valgrind-%p.xml" )
find_program(CTEST_MEMORYCHECK_COMMAND valgrind)
set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full --xml=yes --suppressions=${CMAKE_SOURCE_DIR}/tst/gtk.suppressions --xml-file=valgrind-%p.xml")
function(add_test name binary)
set(memcheck_command "${CTEST_MEMORYCHECK_COMMAND} ${CTEST_MEMORYCHECK_COMMAND_OPTIONS}")
......@@ -173,8 +176,7 @@ find_package(Qt5 REQUIRED COMPONENTS
Test
Svg
Widgets
Xml
)
Xml)
## ###################################################################
## Doc setup
......@@ -183,8 +185,8 @@ find_package(Qt5 REQUIRED COMPONENTS
set(dtk_INSTALL_DOCS ${CMAKE_BINARY_DIR}/html)
set(dtk_CONFIG_DOCS ${CMAKE_BINARY_DIR}/doc/cfg)
# variables used by doc and tst
get_target_property(QT5_QMAKE_EXECUTABLE Qt5::qmake LOCATION)
get_filename_component(QT5_BINARY_DIR ${QT5_QMAKE_EXECUTABLE} PATH)
## #################################################################
......@@ -205,6 +207,7 @@ find_package(SWIG REQUIRED)
if(SWIG_FOUND)
include(${SWIG_USE_FILE})
set(CMAKE_SWIG_FLAGS "")
macro(dtk_wrap project target name language input deps)
......@@ -308,13 +311,12 @@ if (ZLIB_FOUND)
set(DTK_HAVE_ZLIB "YES")
endif (ZLIB_FOUND)
set(DTK_HAVE_VRPN "NO")
if(DTK_BUILD_SUPPORT_VR)
## #################################################################
## OpenNI / Nite && VRPN
## OpenNI / Nite
## #################################################################
find_path(OPENNI_INCLUDES XnOpenNI.h /usr/include/ni)
......@@ -352,8 +354,8 @@ find_path(QUAT_INCLUDES quat.h /usr/include /usr/local/include)
find_path(VRPN_INCLUDES vrpn_Configure.h /usr/include /usr/local/include)
if(QUAT_INCLUDES AND VRPN_INCLUDES)
include_directories(${QUAT_INCLUDES})
include_directories(${VRPN_INCLUDES})
include_directories(${QUAT_INCLUDES})
include_directories(${VRPN_INCLUDES})
endif(QUAT_INCLUDES AND VRPN_INCLUDES)
mark_as_advanced(VRPN_INCLUDES)
......@@ -416,15 +418,15 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/dtkConfigVersion.cmake.in
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/dtkSetTestEnvironment.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/dtkSetTestEnvironment.cmake" @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CodeCoverage.cmake
"${CMAKE_CURRENT_BINARY_DIR}/CodeCoverage.cmake" @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/dtkCodeCoverage.cmake
"${CMAKE_CURRENT_BINARY_DIR}/dtkCodeCoverage.cmake" @ONLY)
set_directory_properties(PROPERTIES TEST_INCLUDE_FILE "${CMAKE_CURRENT_BINARY_DIR}/dtkSetTestEnvironment.cmake")
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/install/dtkConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/dtkConfigVersion.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/CodeCoverage.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/dtkCodeCoverage.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/dtk)
install(EXPORT dtkDepends DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/dtk)
......
......@@ -29,6 +29,7 @@ target_link_libraries(${PROJECT_NAME}
dtkComposer
dtkDistributed
dtkLog
dtkWidgets
)
target_link_libraries(${PROJECT_NAME} Qt5::Core)
......
......@@ -19,6 +19,7 @@
#include <dtkDistributed>
#include <dtkComposer>
#include <dtkCore>
#include <dtkWidgets>
#include <dtkCoreSupport/dtkPluginManager.h>
#include <dtkCoreSupport/dtkAbstractProcessFactory.h>
......@@ -27,13 +28,13 @@
int main(int argc, char **argv)
{
dtkDistributedApplication *application = dtkDistributed::create(argc, argv);
dtkDistributedGuiApplication *application = dtkDistributedGuiApplication::create(argc, argv);
application->setApplicationName("dtkComposerEvaluator");
application->setApplicationVersion("1.0.0");
application->setOrganizationName("inria");
application->setOrganizationDomain("fr");
bool no_gui = dtkDistributed::app()->noGui();
bool no_gui = application->noGui();
QCommandLineParser *parser = application->parser();
parser->setApplicationDescription("DTK composer evaluator. Run the given compostion (XML file).");
......
......@@ -27,8 +27,8 @@ void dtkConceptGenerator::accept()
//define variables required for abstraction
values.insert("${ABSTRACTION}", prefix+"Abstract"+name);
values.insert("${LAYER_NAME}",prefix+layer);
values.insert("${_LAYER_NAME}",(prefix+layer).toUpper());
values.insert("${LAYER_NAME}", prefix+layer);
values.insert("${_LAYER_NAME}", (prefix+layer).toUpper());
bool inheritsCustom,inheritsQObject,inheritsQRunnable,pluginSystem, inherits=false;
......@@ -60,9 +60,9 @@ void dtkConceptGenerator::accept()
{
QString separator=inherits?",": "";
values.insert("${QRUNNABLE}",separator+"QRunnable");
values.insert("${QRUNNABLE}",separator+"public QRunnable");
values.insert("${QRUNNABLE_CTR}",separator+"QRunnable()");
values.insert("${QRUNNABLE_INCLUDE}","#include<QRunnable>");
values.insert("${QRUNNABLE_INCLUDE}","#include <QRunnable>");
inherits=true;
}
......@@ -104,7 +104,7 @@ void dtkConceptGenerator::accept()
values.insert("${NAMESPACE}",namespaceText);
//values for node
values.insert("${NODE_CLASS_NAME}",prefix+name+"ComposerNode");
values.insert("${NODE_CLASS_NAME}",prefix+name+"Node");
generate("abstraction",values,outputFilesPath);
......
......@@ -23,8 +23,6 @@
#include <dtkLog>
/*!
\class dtkDistributedApplication
\inmodule dtkDistributed
......@@ -32,7 +30,7 @@
*/
dtkDistributedApplication::dtkDistributedApplication(int &argc, char **argv): dtkCoreApplication(argc, argv)
dtkDistributedApplication::dtkDistributedApplication(int &argc, char **argv): QCoreApplication(argc, argv)
{
d = new dtkDistributedApplicationPrivate;
......@@ -64,6 +62,11 @@ void dtkDistributedApplication::unspawn(void)
d->unspawn();
}
QCommandLineParser *dtkDistributedApplication::parser(void)
{
return d->parser;
}
dtkDistributedPolicy *dtkDistributedApplication::policy(void)
{
return &(d->policy);
......
......@@ -17,13 +17,13 @@
#include "dtkDistributedExport.h"
#include <dtkCore/dtkCoreApplication.h>
#include <QtCore>
class dtkDistributedCommunicator;
class dtkDistributedPolicy;
class dtkDistributedApplicationPrivate;
class DTKDISTRIBUTED_EXPORT dtkDistributedApplication: public dtkCoreApplication
class DTKDISTRIBUTED_EXPORT dtkDistributedApplication: public QCoreApplication
{
public:
dtkDistributedApplication(int &argc, char **argv);
......@@ -35,6 +35,15 @@ public:
virtual void spawn(QMap<QString, QString> options = QMap<QString, QString>() );
virtual void unspawn(void);
public:
QCommandLineParser *parser(void);
public:
static dtkDistributedApplication *create(int &argc, char *argv[])
{
return new dtkDistributedApplication(argc, argv);
}
public:
bool isMaster(void);
virtual bool noGui(void);
......
......@@ -29,7 +29,7 @@
*/
dtkDistributedGuiApplication::dtkDistributedGuiApplication(int &argc, char **argv): dtkApplication(argc, argv)
dtkDistributedGuiApplication::dtkDistributedGuiApplication(int &argc, char **argv): QApplication(argc, argv)
{
d = new dtkDistributedApplicationPrivate;
......@@ -49,6 +49,15 @@ void dtkDistributedGuiApplication::initialize(void)
d->initialize();
}
QCommandLineParser *dtkDistributedGuiApplication::parser(void)
{
return d->parser;
}
bool dtkDistributedGuiApplication::noGui(void)
{
return !(qApp && qobject_cast<QGuiApplication *>(qApp) && (QGuiApplication::platformName() != "minimal")) ;
}
void dtkDistributedGuiApplication::exec(QRunnable *task)
{
......
......@@ -17,13 +17,14 @@
#include "dtkWidgetsExport.h"
#include "dtkApplication.h"
#include <QApplication>
#include <QtCore>
class dtkDistributedCommunicator;
class dtkDistributedPolicy;
class dtkDistributedApplicationPrivate;
class DTKWIDGETS_EXPORT dtkDistributedGuiApplication: public dtkApplication
class DTKWIDGETS_EXPORT dtkDistributedGuiApplication: public QApplication
{
public:
dtkDistributedGuiApplication(int &argc, char **argv);
......@@ -35,6 +36,12 @@ public:
virtual void spawn(QMap<QString, QString> options = QMap<QString, QString>() );
virtual void unspawn(void);
public:
virtual bool noGui(void);
public:
QCommandLineParser *parser(void);
public:
static dtkDistributedGuiApplication *create(int &argc, char *argv[])
{
......
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