Commit 8beb8280 authored by Artur Grunau's avatar Artur Grunau
Browse files

Build TGT as a shared library by default

This commit explicitly marks TGT to be built as a shared library and
adds several missing TGT_API annotations to TGT classes that are
required by other CAMPVIS modules.
parent d9e7da62
......@@ -92,6 +92,7 @@ IF(WIN32)
IF(CAMPVIS_SHARED_LIBS)
# Linking against Windows DLLs requires explicit instantiation of templates
LIST(APPEND CampvisGlobalDefinitions "-DDLL_TEMPLATE_INST")
LIST(APPEND CampvisGlobalDefinitions "-DVRN_DYNAMIC_LIBS")
IF(NOT CAMPVIS_GENERATE_MANIFEST)
# Do not embed manifest into binaries in debug mode (slows down incremental linking)
......
......@@ -90,7 +90,7 @@ ENDIF(TGT_WITH_QT)
################################################################################
# define library target
################################################################################
ADD_LIBRARY(tgt ${TGT_SOURCES} ${TGT_HEADERS})
ADD_LIBRARY(tgt SHARED ${TGT_SOURCES} ${TGT_HEADERS})
ADD_DEFINITIONS(${CampvisGlobalDefinitions} ${CampvisModulesDefinitions} ${QT_DEFINITIONS})
IF(CAMPVIS_SHARED_LIBS AND MSVC)
ADD_DEFINITIONS("-DTGT_BUILD_DLL")
......
......@@ -3,13 +3,14 @@
#include "tgt/exception.h"
#include "tgt/tgt_gl.h"
#include "tgt/types.h"
#include <set>
namespace tgt {
class VertexAttribute;
class BufferObject {
class TGT_API BufferObject {
public:
enum TargetType {
ARRAY_BUFFER = GL_ARRAY_BUFFER,
......
......@@ -3,6 +3,7 @@
#include "tgt/singleton.h"
#include "tgt/glcanvas.h"
#include "tgt/types.h"
#include <tbb/mutex.h> // TODO: TBB dependency in TGT is not that beautiful...
#include <map>
#include <string>
......@@ -15,7 +16,7 @@ namespace tgt {
/**
* Manages multiple shared OpenGL contexts and offers methods to ensure that only one context is active at a time.
*/
class GlContextManager : public Singleton<GlContextManager> {
class TGT_API GlContextManager : public Singleton<GlContextManager> {
public:
/**
* Creates a new QtGLContext for the OpenGL context of \a canvas.
......
......@@ -44,7 +44,7 @@ namespace tgt {
around a given center (or, if you will, to rotate the camera around and focus it
on that center while it is continuously moving on a sphere).
*/
class Trackball : public Navigation {
class TGT_API Trackball : public Navigation {
public:
/// Constructor
......
......@@ -33,6 +33,7 @@
#include "tgt/tgt_gl.h"
#include "tgt/singleton.h"
#include "tgt/types.h"
#include <tbb/atomic.h>
#include <tbb/concurrent_vector.h>
#include <tbb/spin_mutex.h>
......@@ -45,7 +46,7 @@ namespace tgt {
*
* This class is to be considered as thread-safe.
*/
class OpenGLGarbageCollector : public Singleton<OpenGLGarbageCollector> {
class TGT_API OpenGLGarbageCollector : public Singleton<OpenGLGarbageCollector> {
friend class Singleton<OpenGLGarbageCollector>;
public:
......
......@@ -26,6 +26,7 @@
#define TGT_QTCANVAS_H
#include "tgt/glcanvas.h"
#include "tgt/types.h"
#include <QGLWidget>
#include <QGLFormat>
......@@ -39,7 +40,7 @@ namespace tgt {
/**
* Qt implementation of GLCanvas. Inherits QGLWidget and combines the Qt methods and tgt methods.
*/
class QtCanvas : public GLCanvas, public QGLWidget {
class TGT_API QtCanvas : public GLCanvas, public QGLWidget {
public:
/**
* The constructor. Allows the user to specify a shared widget that this canvas will share
......
......@@ -4,6 +4,7 @@
#include "tgt/singleton.h"
#include "tgt/glcontextmanager.h"
#include "tgt/qt/qtthreadedcanvas.h"
#include "tgt/types.h"
#include <tbb/mutex.h> // TODO: TBB dependency in TGT is not that beautiful...
#include <map>
#include <string>
......@@ -16,7 +17,7 @@ namespace tgt {
* Manages multiple shared OpenGL contexts and offers methods to ensure that only one context is active at a time.
*
*/
class QtContextManager : public GlContextManager {
class TGT_API QtContextManager : public GlContextManager {
public:
/**
* Creates a new QtGLContext for the OpenGL context of \a canvas.
......
......@@ -2,13 +2,14 @@
#define QTTHREADEDCANVAS_H__
#include "tgt/qt/qtcanvas.h"
#include "tgt/types.h"
namespace tgt {
/**
* Subclass of QtCanvas that supports multi-threading.
*/
class QtThreadedCanvas : public tgt::QtCanvas {
class TGT_API QtThreadedCanvas : public tgt::QtCanvas {
public:
QtThreadedCanvas(
const std::string& title = "",
......
......@@ -3,6 +3,7 @@
#include "tgt/exception.h"
#include "tgt/tgt_gl.h"
#include "tgt/types.h"
#include <string>
#include <vector>
......@@ -20,7 +21,7 @@ namespace tgt {
* \note Because all member methods require a valid locked OpenGL context, we have
* implicit thread-safety.
*/
class VertexArrayObject {
class TGT_API VertexArrayObject {
public:
VertexArrayObject(bool autoBind = true) throw (tgt::Exception);
......
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