Notice: If you are member of any public project or group, please make sure that your GitLab username is not the same as the LRZ identifier/Kennung (see https://gitlab.lrz.de/profile/account). Please change your username if necessary. For more information see the section "Public projects / Öffentliche Projekte" at https://doku.lrz.de/display/PUBLIC/GitLab . Thank you!

Commit 79bfc70a authored by Jakob Weiss's avatar Jakob Weiss

Merge branch 'qt5' into campvis-nx

parents c56f094b 0227c942
# = CAMPVis - Yet another medical visualization framework =====================
PROJECT(CAMPVis)
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0 FATAL_ERROR)
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.2 FATAL_ERROR)
cmake_policy(SET CMP0020 NEW)
SET(CAMPVIS_VERSION 1.0.0)
# = Global Build Options ======================================================
OPTION(BUILD_SHARED_LIBS "Build shared libraries (strongly recommended!)" ON)
OPTION(CAMPVIS_DEBUG "Activate debug code?" ON)
OPTION(CAMPVIS_BUILD_LIB_CGT "Build CGT Library" ON)
OPTION(CAMPVIS_BUILD_APPLICATION "Build CAMPVis Application" ON)
OPTION(CAMPVIS_BUILD_MODULES "Build CAMPVis Modules" ON)
OPTION(CAMPVIS_ENABLE_SCRIPTING "Add support for scripting CAMPVis using Lua" OFF)
......@@ -27,6 +29,10 @@ ENDIF()
SET(CAMPVIS_DEFAULT_ENABLED_MODULES "STABLE_NO_DEPENDENCIES" CACHE STRING "Default CAMPVis modules to activate")
SET_PROPERTY(CACHE CAMPVIS_DEFAULT_ENABLED_MODULES PROPERTY STRINGS "NONE" "STABLE_NO_DEPENDENCIES" "STABLE_WITH_EXTERNAL_DEPENDENCIES" "TESTING" "ALL")
IF(NOT BUILD_SHARED_LIBS)
MESSAGE(WARNING "Building shared libraries is turned off. Thus, CAMPVis will most probably not work as intended!\nPlease turn BUILD_SHARED_LIBS on unless you know what you're doing!")
ENDIF(NOT BUILD_SHARED_LIBS)
# propagate CAMPVIS_ENABLE_SCRIPTING to CAMPVIS_BUILD_LIB_LUA to support deprecated code
IF (CAMPVIS_ENABLE_SCRIPTING)
SET(CAMPVIS_BUILD_LIB_LUA ON)
......@@ -105,15 +111,9 @@ EXPORT(PACKAGE CAMPVis)
# = Copy Windows DLLs to binary dir for improved development experience =======
IF(WIN32)
# gather Qt4 DLLs - TODO: remove redundant naming of required components
FIND_PACKAGE(Qt4DLLs COMPONENTS QtCore QtGui QtOpenGL QtNetwork QtXmlPatterns)
LIST(APPEND CampvisExternalDllsDebug ${QT_DEBUG_DLLS})
LIST(APPEND CampvisExternalDllsRelease ${QT_RELEASE_DLLS})
LIST(REMOVE_DUPLICATES CampvisExternalDllsDebug)
LIST(REMOVE_DUPLICATES CampvisExternalDllsRelease)
IF(CAMPVIS_COPY_EXTERNAL_DLLS)
LIST(REMOVE_DUPLICATES CampvisExternalDllsDebug)
LIST(REMOVE_DUPLICATES CampvisExternalDllsRelease)
COPY_EXTERNAL_DLLS(CampvisExternalDllsDebug CampvisExternalDllsRelease false)
ENDIF()
ENDIF()
......
PROJECT(campvis-application)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
INCLUDE(../cmake/commonconf.cmake)
MESSAGE(STATUS "Configuring CAMPVis-Application")
......@@ -106,13 +105,7 @@ FOREACH(ModFile ${CampvisModulesApplicationToBeMocced})
LIST(APPEND CampvisApplicationToBeMocced ${ModFileRelative})
ENDFOREACH()
#
# Qt related stuff:
#
QT4_WRAP_CPP(CampvisApplicationMoc ${CampvisApplicationToBeMocced})
LIST(APPEND CampvisApplicationSources ${CampvisApplicationMoc})
QT4_WRAP_UI(CampvisApplicationFormsHeaders ${CampvisApplicationForms})
QT5_WRAP_UI(CampvisApplicationFormsHeaders ${CampvisApplicationForms})
LIST(APPEND CampvisApplicationSources ${CampvisApplicationFormsHeaders})
LINK_DIRECTORIES(${CampvisGlobalLinkDirectories} ${CampvisModulesLinkDirectories})
......@@ -127,14 +120,15 @@ ADD_LIBRARY(campvis-application-lib
${CampvisApplicationSources} ${CampvisApplicationHeaders}
${CampvisApplicationMoc}
)
ADD_DEFINITIONS(${CampvisGlobalDefinitions} ${CampvisModulesDefinitions} ${CampvisApplicationDefinitions} ${QT_DEFINITIONS})
ADD_DEFINITIONS(${CampvisGlobalDefinitions} ${CampvisModulesDefinitions} ${CampvisApplicationDefinitions})
INCLUDE_DIRECTORIES(${CampvisGlobalIncludeDirs} ${CampvisModulesIncludeDirs})
TARGET_LINK_LIBRARIES(campvis-application-lib ${CampvisMainLibs} ${CampvisGlobalExternalLibs} ${CampvisModulesExternalLibs} ${QT_LIBRARIES})
TARGET_LINK_LIBRARIES(campvis-application-lib ${CampvisMainLibs} ${CampvisGlobalExternalLibs} ${CampvisModulesExternalLibs} Qt5::Widgets Qt5::OpenGL)
# if campvis-core is built as a shared library, CMake will define the following flag to instruct
# the code to export DLL symbols
SET_TARGET_PROPERTIES(campvis-application-lib PROPERTIES DEFINE_SYMBOL "CAMPVIS_APPLICATION_BUILD_DLL")
IF(CAMPVIS_GROUP_SOURCE_FILES)
DEFINE_SOURCE_GROUPS_FROM_SUBDIR(CampvisApplicationSources ${CampvisHome} "")
DEFINE_SOURCE_GROUPS_FROM_SUBDIR(CampvisApplicationHeaders ${CampvisHome} "")
......@@ -144,9 +138,7 @@ INSTALL(TARGETS campvis-application-lib DESTINATION exports EXPORT campvis-targe
ADD_EXECUTABLE(campvis-application "campvis.cpp")
TARGET_LINK_LIBRARIES(campvis-application campvis-application-lib ${CampvisMainLibs} ${CampvisGlobalExternalLibs} ${CampvisModulesExternalLibs} ${QT_LIBRARIES})
TARGET_LINK_LIBRARIES(campvis-application campvis-application-lib ${CampvisMainLibs} ${CampvisGlobalExternalLibs} ${CampvisModulesExternalLibs} Qt5::Widgets Qt5::OpenGL)
IF(CAMPVIS_DEPLOY_SHADERS)
LIST(APPEND CampvisShaderDirectories "application/data")
......
......@@ -52,6 +52,7 @@
#include "tools/qtjobprocessor.h"
#include <QApplication>
#include <QThread>
#ifdef CAMPVIS_HAS_SCRIPTING
#include "scripting/glue/luavmstate.h"
......@@ -93,12 +94,11 @@ namespace campvis {
#endif
}
_localContext = new QtThreadedCanvas("", cgt::ivec2(16, 16));
_localContext = new cgt::QtThreadedCanvas("", cgt::ivec2(16, 16));
campvis::init(_localContext, searchPaths);
_mainWindow = new MainWindow(this);
cgt::GLContextScopedLock lock(_localContext);
{
GLJobProc.enqueueJobBlocking([&]() {
_mainWindow->init();
// load textureData from file
......@@ -133,7 +133,7 @@ namespace campvis {
if (! _luaVmState->injectGlobalObjectPointer(this, "campvis::CampVisApplication *", "application"))
LERROR("Could not inject the pipeline into the Lua VM.");
#endif
}
});
// parse argument list and create pipelines
QStringList pipelinesToAdd = this->arguments();
......@@ -185,10 +185,7 @@ namespace campvis {
for (auto it = _workflows.begin(); it != _workflows.end(); ++it)
(*it)->deinit();
{
// Deinit everything OpenGL related using the local context.
cgt::GLContextScopedLock lock(_localContext);
GLJobProc.enqueueJobBlocking([&]() {
delete _errorTexture;
// Deinit pipeline and painter first
......@@ -197,7 +194,9 @@ namespace campvis {
}
_mainWindow->deinit();
}
});
delete _mainWindow;
// now delete everything in the right order:
for (auto it = _pipelines.begin(); it != _pipelines.end(); ++it) {
......@@ -255,7 +254,8 @@ namespace campvis {
GLCtxtMgr.releaseContext(canvas, false);
s_PipelinesChanged.emitSignal();
pipeline->start();
startOpenGlThreadAndMoveQtThreadAffinity(pipeline, canvas);
}
void CampVisApplication::initGlContextAndPipeline(cgt::GLCanvas* canvas, AbstractPipeline* pipeline) {
......@@ -286,7 +286,7 @@ namespace campvis {
void CampVisApplication::rebuildAllShadersFromFiles() {
// rebuilding all shaders has to be done from OpenGL context, use the local one.
GLJobProc.enqueueJob(makeJobOnHeap(this, &CampVisApplication::triggerShaderRebuild));
GLJobProc.enqueueJob(cgt::makeJobOnHeap(this, &CampVisApplication::triggerShaderRebuild));
}
void CampVisApplication::triggerShaderRebuild() {
......
......@@ -38,6 +38,7 @@
namespace cgt {
class GLCanvas;
class QtCanvas;
class QtThreadedCanvas;
class Texture;
}
......@@ -170,7 +171,7 @@ namespace campvis {
void triggerShaderRebuild();
/// A local OpenGL context used for initialization
cgt::GLCanvas* _localContext;
cgt::QtCanvas* _localContext;
/// Main window hosting GUI stuff
MainWindow* _mainWindow;
......
......@@ -45,6 +45,9 @@ namespace campvis {
}
DataContainerFileLoaderWidget::~DataContainerFileLoaderWidget() {
delete _imgReader;
_imgReader = nullptr;
if (_dataContainer != 0) {
_dataContainer->s_dataAdded.disconnect(this);
}
......@@ -97,14 +100,6 @@ namespace campvis {
return false;
}
void DataContainerFileLoaderWidget::init() {
}
void DataContainerFileLoaderWidget::deinit() {
delete _imgReader;
_imgReader = nullptr;
}
void DataContainerFileLoaderWidget::onBtnCancelClicked() {
delete _imgReader;
_imgReader = nullptr;
......
......@@ -66,18 +66,7 @@ namespace campvis {
* \return QSize(300, 350)
*/
QSize sizeHint() const;
/**
* Initializes the OpenGL stuff (e.g. shaders).
* Must be called with a valid and locked OpenGL context.
*/
virtual void init();
/**
* Deinitializes the OpenGL stuff (e.g. shaders).
* Must be called with a valid and locked OpenGL context.
*/
void deinit();
private slots:
/**
......
......@@ -70,7 +70,6 @@ namespace campvis {
static_cast<Geometry1DTransferFunction*>(p_transferFunction.getTF())->addGeometry(TFGeometry1D::createQuad(cgt::vec2(0.f, 1.f), cgt::col4(0, 0, 0, 255), cgt::col4(255, 255, 255, 255)));
GLCtxtMgr.registerContextAndInitGlew(this, "DataContainerInspector");
GLCtxtMgr.releaseContext(this, false);
addProperty(p_currentSlice);
addProperty(p_transferFunction);
......@@ -103,10 +102,13 @@ namespace campvis {
p_renderGChannel.setVisible(false);
p_renderBChannel.setVisible(false);
p_renderAChannel.setVisible(false);
connect(this, &DataContainerInspectorCanvas::s_invalidated, this, &DataContainerInspectorCanvas::onInvalidated);
init();
}
DataContainerInspectorCanvas::~DataContainerInspectorCanvas() {
}
void DataContainerInspectorCanvas::init() {
......@@ -157,16 +159,17 @@ namespace campvis {
_geometriesDirty = false;
}
if (_textures.empty()) {
return;
}
glPushAttrib(GL_ALL_ATTRIB_BITS);
glViewport(0, 0, size_.x, size_.y);
glClearColor(0.7f, 0.7f, 0.7f, 1.f);
glClear(GL_COLOR_BUFFER_BIT);
LGL_ERROR;
if (_textures.empty()) {
glPopAttrib();
return;
}
// update layout dimensions
_numTiles.x = ceil(sqrt(static_cast<float>(_textures.size())));
_numTiles.y = ceil(static_cast<float>(_textures.size()) / _numTiles.x);
......@@ -249,16 +252,21 @@ namespace campvis {
LGL_ERROR;
}
void DataContainerInspectorCanvas::invalidate() {
void DataContainerInspectorCanvas::onInvalidated() {
// only if inited
if (_quad != 0 && _paintShader != 0) {
if (_quad != 0 && _paintShader != 0 && this->isVisible()) {
this->makeCurrent();
paint();
this->swap();
// avoid recursive paints.
if (! cgt::GlContextManager::getRef().checkWhetherThisThreadHasAcquiredOpenGlContext()) {
SimpleJobProc.enqueueJob([this] () {
cgt::GLContextScopedLock lock(this);
paint();
});
}
// if (! cgt::GlContextManager::getRef().checkWhetherThisThreadHasAcquiredOpenGlContext()) {
// SimpleJobProc.enqueueJob(
// [this] () {
// cgt::GLContextScopedLock lock(this);
// paint();
// });
// }
}
}
......@@ -267,11 +275,11 @@ namespace campvis {
}
void DataContainerInspectorCanvas::repaint() {
invalidate();
emit s_invalidated();
}
void DataContainerInspectorCanvas::sizeChanged(const cgt::ivec2& size) {
invalidate();
emit s_invalidated();
}
void DataContainerInspectorCanvas::mouseMoveEvent(cgt::MouseEvent* e)
......@@ -335,7 +343,7 @@ namespace campvis {
_tcp.process(_localDataContainer);
e->accept();
_geometriesDirty = true;
invalidate();
emit s_invalidated();
}
}
......@@ -357,7 +365,7 @@ namespace campvis {
}
if (_texturesDirty)
invalidate();
emit s_invalidated();
}
void DataContainerInspectorCanvas::setDataHandles(const std::vector< std::pair<QString, QtDataHandle> >& handles) {
......@@ -384,7 +392,7 @@ namespace campvis {
_texturesDirty = true;
}
invalidate();
emit s_invalidated();
}
void DataContainerInspectorCanvas::updateTextures() {
......@@ -440,12 +448,12 @@ namespace campvis {
void DataContainerInspectorCanvas::onPropertyChanged(const AbstractProperty* prop) {
// ignore properties of the geometry renderer
if (prop != &p_geometryRendererProperties)
invalidate();
emit s_invalidated();
}
void DataContainerInspectorCanvas::onGeometryRendererPropertyChanged(const AbstractProperty* prop) {
_geometriesDirty = true;
invalidate();
emit s_invalidated();
}
void DataContainerInspectorCanvas::renderGeometryIntoTexture(const std::string& name, int textureIndex) {
......
......@@ -131,6 +131,7 @@ namespace campvis {
signals:
void s_colorChanged(const cgt::svec3& texel, const cgt::vec4&);
void s_depthChanged(const cgt::svec3& texel, float depth);
void s_invalidated(); ///< signals an invalidation event
private slots:
/**
......@@ -140,20 +141,17 @@ namespace campvis {
*/
void onDataContainerChanged(const QString& key, QtDataHandle dh);
/**
* To be called when the canvas is invalidated, issues new paint job.
*/
void onInvalidated();
protected:
/**
* Performs the painting.
*/
virtual void paint();
/**
* Gets called when the data collection of this pipeline has changed and thus has notified its observers.
* If \a name equals the name of the renderTarget, the s_renderTargetChanged signal will be emitted.
* \param name Name of the added data.
* \param dh DataHandle to the newly added data.
*/
void onDataContainerDataAdded(const std::string& name, DataHandle dh);
/**
* Slot getting called when one of the observed properties changed and notifies its observers.
* \param prop Property that emitted the signal
......@@ -172,11 +170,6 @@ namespace campvis {
*/
void resetTrackball();
/**
* To be called when the canvas is invalidated, issues new paint job.
*/
void invalidate();
/**
* Renders the given 2D texture.
* Binds the texture to the shader, sets the uniforms and renders the quad.
......
......@@ -89,10 +89,6 @@ namespace campvis {
}
DataContainerInspectorWidget::~DataContainerInspectorWidget() {
if (_dataContainer != 0) {
_dataContainer->s_dataAdded.disconnect(this);
}
delete _pcWidget;
_pcWidget = nullptr;
}
......@@ -386,28 +382,17 @@ namespace campvis {
}
void DataContainerInspectorWidget::init() {
if (_canvas != 0)
_canvas->init();
_inited = true;
}
void DataContainerInspectorWidget::deinit() {
_inited = false;
if (_canvas != 0)
_canvas->deinit();
_pcWidget->updatePropCollection(0, 0);
_canvas->deinit();
if (_dataContainer != 0) {
_dataContainer->s_dataAdded.disconnect(this);
}
_dataContainer = 0;
_dctWidget->update(0);
if(_propEditorWid != nullptr)
_propEditorWid->deinit();
_inited = false;
}
void DataContainerInspectorWidget::onDCTWidgetSelectionModelSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected) {
......@@ -532,8 +517,8 @@ namespace campvis {
void DataContainerInspectorWidget::onBtnLoadFileClicked() {
// delete previous PropertyEditor, then create a new one
// the final one will be deleted with deinit()
if(nullptr != _propEditorWid)
_propEditorWid->deinit();
if (nullptr != _propEditorWid)
delete _propEditorWid;
_propEditorWid = new DataContainerFileLoaderWidget(this, nullptr);
_propEditorWid->setVisible(true);
......
......@@ -435,8 +435,6 @@ namespace campvis {
}
void MainWindow::onBtnProcessorFactoryClicked() {
cgt::OpenGLJobProcessor::ScopedSynchronousGlJobExecution jobGuard;
std::string name = this->_cbProcessorFactory->currentText().toStdString();
if (_selectedPipeline == nullptr)
return;
......@@ -447,9 +445,11 @@ namespace campvis {
if (p == nullptr)
return;
p->init();
_selectedPipeline->addProcessor(p);
GLJobProc.enqueueJobBlocking([&]() {
p->init();
});
_selectedPipeline->addProcessor(p);
emit updatePipelineWidget(_application->_dataContainers, _application->_pipelines);
}
......@@ -460,8 +460,9 @@ namespace campvis {
void MainWindow::onLuaCommandExecuted(const QString& cmd) {
#ifdef CAMPVIS_HAS_SCRIPTING
if (_application->getLuaVmState() != nullptr) {
cgt::OpenGLJobProcessor::ScopedSynchronousGlJobExecution jobGuard;
_application->getLuaVmState()->execString(cmd.toStdString());
GLJobProc.enqueueJobBlocking([&]() {
_application->getLuaVmState()->execString(cmd.toStdString());
});
_application->getLuaVmState()->getGlobalTable()->updateValueMap();
_scriptingConsoleWidget->_editCommand->setCompleter(new LuaCompleter(_application->getLuaVmState(), _scriptingConsoleWidget->_editCommand));
......
......@@ -64,6 +64,8 @@ namespace campvis {
updateManipulators();
setEventTypes(cgt::Event::MOUSEPRESSEVENT);
connect(this, &Geometry1DTransferFunctionEditor::s_invalidated, this, &Geometry1DTransferFunctionEditor::onInvalidated);
}
Geometry1DTransferFunctionEditor::~Geometry1DTransferFunctionEditor() {
......@@ -77,7 +79,7 @@ namespace campvis {
Geometry1DTransferFunction* gtf = static_cast<Geometry1DTransferFunction*>(_transferFunction);
_lblIntensityLeft->setText(QString::number(gtf->getIntensityDomain().x));
_lblIntensityRight->setText(QString::number(gtf->getIntensityDomain().y));
invalidate();
emit s_invalidated();
}
void Geometry1DTransferFunctionEditor::paint() {
......@@ -180,7 +182,7 @@ namespace campvis {
(*it)->setViewportSize(size);
}
}
invalidate();
emit s_invalidated();
}
void Geometry1DTransferFunctionEditor::mousePressEvent(cgt::MouseEvent* e) {
......@@ -200,16 +202,16 @@ namespace campvis {
}
else {
_selectedGeometry = 0;
invalidate();
emit s_invalidated();
e->ignore();
}
}
void Geometry1DTransferFunctionEditor::repaint() {
invalidate();
emit s_invalidated();
}
void Geometry1DTransferFunctionEditor::invalidate() {
void Geometry1DTransferFunctionEditor::onInvalidated() {
// TODO: check, whether this should be done in an extra thread
cgt::GLContextScopedLock lock(_canvas);
paint();
......@@ -298,7 +300,7 @@ namespace campvis {
void Geometry1DTransferFunctionEditor::onWholeTFGeometryManipulatorSelected(WholeTFGeometryManipulator* wtf /* :) */) {
_selectedGeometry = wtf;
invalidate();
emit s_invalidated();
}
void Geometry1DTransferFunctionEditor::onBtnAddGeometryClicked() {
......@@ -332,7 +334,7 @@ namespace campvis {
void Geometry1DTransferFunctionEditor::onCbLogScaleStateChanged(int state) {
_logScale = (state & Qt::Checked);
invalidate();
emit s_invalidated();
}
void Geometry1DTransferFunctionEditor::onTfAboutToBeDeleted() {
......
......@@ -94,6 +94,12 @@ namespace campvis {
*/
void onWholeTFGeometryManipulatorSelected(WholeTFGeometryManipulator* wtf /* :) */);
signals:
/**
* To be called when the canvas is invalidated, issues new paint job.
*/
void s_invalidated();
protected slots:
/**
* Slot to be called when _btnAddGeometry was clicked.
......@@ -111,6 +117,11 @@ namespace campvis {
*/
void onCbLogScaleStateChanged(int state);
/**
* Slot reacting to the invalidated signal, issueing a new paint job
*/
void onInvalidated();
protected:
/**
* Disconnects this editor from the handled TF and cleans up everything.
......@@ -133,11 +144,6 @@ namespace campvis {
*/
void updateManipulators();
/**
* To be called when the canvas is invalidated, issues new paint job.
*/
void invalidate();
/**
* Sets up the GUI stuff.
*/
......
......@@ -44,7 +44,7 @@ namespace campvis {
_logDisplay, SLOT(append(const QString&)));
}
void QTextEditLog::logFiltered(const std::string& cat, LogLevel level, const std::string& msg,
void QTextEditLog::logFiltered(const std::string& cat, cgt::LogLevel level, const std::string& msg,
const std::string& /*extendedInfo*/)
{
std::string output = "";
......
......@@ -33,14 +33,12 @@
#include <QTextEdit>
#include <QTextDocument>
using namespace cgt;
namespace campvis {
/**
* QTextEditLog implements logging to a QTextEdit instance.
*/
class CAMPVIS_APPLICATION_API QTextEditLog : private QObject, public Log {
class CAMPVIS_APPLICATION_API QTextEditLog : private QObject, public cgt::Log {
Q_OBJECT
......@@ -77,7 +75,7 @@ namespace campvis {
protected:
QTextEdit* _logDisplay;
void logFiltered(const std::string &cat, LogLevel level, const std::string &msg, const std::string &extendedInfo="");
void logFiltered(const std::string &cat, cgt::LogLevel level, const std::string &msg, const std::string &extendedInfo="");
};
}
......
......@@ -11,8 +11,9 @@ set(CAMPVIS_INCLUDE_DIRS "@CampvisGlobalIncludeDirs@;@CampvisModulesIncludeDirs@
SET(CAMPVIS_DEFINITIONS @CampvisGlobalDefinitions@)
FIND_PACKAGE(Qt4 ${CampvisRequiredQtVersion} REQUIRED QtCore QtGui QtOpenGL)
INCLUDE(${QT_USE_FILE})
FIND_PACKAGE(Qt5Widgets REQUIRED)
FIND_PACKAGE(Qt5OpenGL REQUIRED)
RESOLVE_QT5_DLL_LOCATIONS("Core;Gui;OpenGL;Widgets")
SET(CGT_WITH_QT true)
# Our library dependencies (contains definitions for IMPORTED targets)
......
......@@ -4,7 +4,7 @@
# LUA_INCLUDE_DIR
# LUA_LIBRARY
IF(CAMPVIS_BUILD_LIB_LUA)
IF(CAMPVIS_ENABLE_SCRIPTING)
SET(LUA_DIR "${CampvisHome}/ext/lua" CACHE PATH "If Lua is not found, set this path")
SET(LUA_INCLUDE_DIR "${LUA_DIR}/src" "${CMAKE_BINARY_DIR}/ext/lua")
......@@ -15,6 +15,6 @@ IF(CAMPVIS_BUILD_LIB_LUA)
ELSE()
SET(LUA_FOUND FALSE)
ENDIF()
ENDIF(CAMPVIS_BUILD_LIB_LUA)
ENDIF(CAMPVIS_ENABLE_SCRIPTING)
MARK_AS_ADVANCED(LUA_DIR LUA_INCLUDE_DIR LUA_LIBRARY)
# Try to find Win32 Qt DLLs to be copied to the bin directory. Once done this will define:
# QT_DLLS_FOUND
# QT_DEBUG_DLLS
# QT_RELEASE_DLLS
#
# Note: FIND_PACKAGE(Qt4 ...) has to be called before in order for ${QT_LIBRARY_DIR}
# and ${QT_BINARY_DIR} to be defined!
# DLLs are either located in Qt library or binary directory
IF(EXISTS ${QT_LIBRARY_DIR}/QtCored4.dll)
SET(DLL_DIR ${QT_LIBRARY_DIR})
ELSEIF(EXISTS ${QT_BINARY_DIR}/QtCored4.dll)
SET(DLL_DIR ${QT_BINARY_DIR})
ELSEIF(EXISTS ${QT_LIBRARY_DIR}/QtCore4.dll)
SET(DLL_DIR ${QT_LIBRARY_DIR})
ELSEIF(EXISTS ${QT_BINARY_DIR}/QtCore4.dll)
SET(DLL_DIR ${QT_BINARY_DIR})
ENDIF()
IF(DLL_DIR)
SET(QT_DLLS_FOUND TRUE)
FOREACH(component ${Qt4DLLs_FIND_COMPONENTS})
IF(EXISTS ${DLL_DIR}/${component}d4.dll)
LIST(APPEND QT_DEBUG_DLLS ${DLL_DIR}/${component}d4.dll)
ELSE()
MESSAGE("Failed to find Qt Debug DLL: ${component}d4.dll")
SET(QT_DLLS_FOUND FALSE)
ENDIF()
IF(EXISTS ${DLL_DIR}/${component}4.dll)
LIST(APPEND QT_RELEASE_DLLS ${DLL_DIR}/${component}4.dll)
ELSE()
MESSAGE(WARNING "Failed to find Qt Release DLL: ${component}4.dll")
SET(QT_DLLS_FOUND FALSE)
ENDIF()
ENDFOREACH()
ELSE()
SET(QT_DLLS_FOUND FALSE)
ENDIF()
UNSET(Qt4DLLsCAMPVIS_DIR)
MARK_AS_ADVANCED(Qt4DLLsCAMPVIS_DIR)
......@@ -33,7 +33,9 @@ IF (WIN32)
ELSEIF(CAMPVIS_MSVC11)
SET(TbbCompilerDirectory "vc11")
ELSEIF(CAMPVIS_MSVC12)
SET(TbbCompilerDirectory "vc12")
SET(TbbCompilerDirectory "vc12")
ELSEIF(CAMPVIS_MSVC14)
SET(TbbCompilerDirectory "vc14")
ELSE()
MESSAGE(WARNING "Compiler not supported by makefile, you might be able to fix that...")
ENDIF(CAMPVIS_MSVC2010)
......
......@@ -55,6 +55,10 @@ ELSEIF(${CMAKE_GENERATOR} STREQUAL "Visual Studio 12 Win64" OR ${CMAKE_GENERATOR
SET(CAMPVIS_MSVC12 TRUE)
SET(CAMPVIS_WIN64 TRUE)
MESSAGE("Visual Studio 12 Build (64 Bit)")
ELSEIF(${CMAKE_GENERATOR} STREQUAL "Visual Studio 14 Win64" OR ${CMAKE_GENERATOR} STREQUAL "Visual Studio 14 2015 Win64")
SET(CAMPVIS_MSVC14 TRUE)
SET(CAMPVIS_WIN64 TRUE)
MESSAGE("Visual Studio 12 Build (64 Bit)")
ELSEIF(${CMAKE_GENERATOR} MATCHES "NMake")
SET(CAMPVIS_NMAKE TRUE)