Commit 2a4b47b3 authored by schultezub's avatar schultezub
Browse files

* Updated CMake files to include additional link directories

* Added GenericPointerData class

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@480 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent 9c2d29ba
...@@ -31,6 +31,8 @@ ENDIF() ...@@ -31,6 +31,8 @@ ENDIF()
include(cmake/commonconf.cmake) include(cmake/commonconf.cmake)
include(cmake/parseModulesDir.cmake) include(cmake/parseModulesDir.cmake)
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
MESSAGE(STATUS "--------------------------------------------------------------------------------") MESSAGE(STATUS "--------------------------------------------------------------------------------")
IF(CAMPVIS_BUILD_LIB_TGT) IF(CAMPVIS_BUILD_LIB_TGT)
...@@ -59,7 +61,7 @@ ENDIF() ...@@ -59,7 +61,7 @@ ENDIF()
# #
IF(WIN32) IF(WIN32)
# gather Qt4 DLLs - TODO: remove redundant naming of required components # gather Qt4 DLLs - TODO: remove redundant naming of required components
FIND_PACKAGE(Qt4DLLs COMPONENTS QtCore QtGui QtOpenGL) FIND_PACKAGE(Qt4DLLs COMPONENTS QtCore QtGui QtOpenGL QtNetwork QtXmlPatterns)
LIST(APPEND CampvisExternalDllsDebug ${QT_DEBUG_DLLS}) LIST(APPEND CampvisExternalDllsDebug ${QT_DEBUG_DLLS})
LIST(APPEND CampvisExternalDllsRelease ${QT_RELEASE_DLLS}) LIST(APPEND CampvisExternalDllsRelease ${QT_RELEASE_DLLS})
......
...@@ -54,6 +54,7 @@ QT4_WRAP_CPP(CampvisApplicationMoc ${CampvisApplicationToBeMocced}) ...@@ -54,6 +54,7 @@ QT4_WRAP_CPP(CampvisApplicationMoc ${CampvisApplicationToBeMocced})
LIST(APPEND CampvisApplicationSources ${CampvisApplicationMoc}) LIST(APPEND CampvisApplicationSources ${CampvisApplicationMoc})
INCLUDE(${QT_USE_FILE}) INCLUDE(${QT_USE_FILE})
LINK_DIRECTORIES(${CampvisGlobalLinkDirectories} ${CampvisModulesLinkDirectories})
ADD_EXECUTABLE(campvis-application ADD_EXECUTABLE(campvis-application
${CampvisApplicationSources} ${CampvisApplicationHeaders} ${CampvisApplicationSources} ${CampvisApplicationHeaders}
......
...@@ -31,10 +31,13 @@ FOREACH(ModDir ${ModDirs}) ...@@ -31,10 +31,13 @@ FOREACH(ModDir ${ModDirs})
LIST(APPEND CampvisModulesDefinitions ${ThisModDefinitions}) LIST(APPEND CampvisModulesDefinitions ${ThisModDefinitions})
LIST(APPEND CampvisModulesIncludeDirs ${ThisModIncludeDirs}) LIST(APPEND CampvisModulesIncludeDirs ${ThisModIncludeDirs})
LIST(APPEND CampvisModulesExternalLibs ${ThisModExternalLibs}) LIST(APPEND CampvisModulesExternalLibs ${ThisModExternalLibs})
LIST(APPEND CampvisModulesLinkDirectories ${ThisModLinkDirectories})
LIST(APPEND CampvisModulesSources ${ThisModSources}) LIST(APPEND CampvisModulesSources ${ThisModSources})
LIST(APPEND CampvisModulesHeaders ${ThisModHeaders}) LIST(APPEND CampvisModulesHeaders ${ThisModHeaders})
LIST(APPEND CampvisModulesCoreSources ${ThisModCoreSources}) LIST(APPEND CampvisModulesCoreSources ${ThisModCoreSources})
LIST(APPEND CampvisModulesCoreHeaders ${ThisModCoreHeaders}) LIST(APPEND CampvisModulesCoreHeaders ${ThisModCoreHeaders})
LIST(APPEND CampvisExternalDllsDebug ${ThisModExternalDllsDebug})
LIST(APPEND CampvisExternalDllsRelease ${ThisModExternalDllsRelease})
# add definition that this module is activated # add definition that this module is activated
LIST(APPEND CampvisGlobalDefinitions -DCAMPVIS_HAS_MODULE_${ModDirUpper}) LIST(APPEND CampvisGlobalDefinitions -DCAMPVIS_HAS_MODULE_${ModDirUpper})
...@@ -43,10 +46,13 @@ FOREACH(ModDir ${ModDirs}) ...@@ -43,10 +46,13 @@ FOREACH(ModDir ${ModDirs})
UNSET(ThisModDefinitions) UNSET(ThisModDefinitions)
UNSET(ThisModIncludeDirs) UNSET(ThisModIncludeDirs)
UNSET(ThisModExternalLibs) UNSET(ThisModExternalLibs)
UNSET(ThisModLinkDirectories)
UNSET(ThisModSources) UNSET(ThisModSources)
UNSET(ThisModHeaders) UNSET(ThisModHeaders)
UNSET(ThisModCoreSources) UNSET(ThisModCoreSources)
UNSET(ThisModCoreHeaders) UNSET(ThisModCoreHeaders)
UNSET(ThisModExternalDllsDebug)
UNSET(ThisModExternalDllsRelease)
ELSE() ELSE()
MESSAGE(STATUS "* Found Module '${ModDir}'") MESSAGE(STATUS "* Found Module '${ModDir}'")
ENDIF(CAMPVIS_BUILD_MODULE_${ModDirUpper}) ENDIF(CAMPVIS_BUILD_MODULE_${ModDirUpper})
......
// ================================================================================================
//
// This file is part of the CAMPVis Software Framework.
//
// If not explicitly stated otherwise: Copyright (C) 2012, all rights reserved,
// Christian Schulte zu Berge <christian.szb@in.tum.de>
// Chair for Computer Aided Medical Procedures
// Technische Universität München
// Boltzmannstr. 3, 85748 Garching b. München, Germany
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
//
// The licensing of this softare is not yet resolved. Until then, redistribution in source or
// binary forms outside the CAMP chair is not permitted, unless explicitly stated in legal form.
// However, the names of the original authors and the above copyright notice must retain in its
// original state in any case.
//
// Legal disclaimer provided by the BSD license:
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// ================================================================================================
#ifndef GENERICPOINTERDATA_H__
#define GENERICPOINTERDATA_H__
#include "core/datastructures/abstractdata.h"
#include <string>
namespace campvis {
/**
* Class that generically wraps around a pointer of the template type and takes ownership of it.
* \tparam T Type of the pointer this AbstractData wraps around.
*/
template<typename T>
class GenericPointerData : public AbstractData {
public:
/**
* Creates a new GenericPointerData and initializes its pointer with \a data.
* \param data The initial pointer for this data, may be 0, GenericPointerData takes ownerwhip.
*/
GenericPointerData(T* data)
: AbstractData()
, _data(data)
{};
/**
* Destructor, deletes the pointer.
*/
virtual ~GenericPointerData() {
delete _data;
};
/**
* Returns the pointer to the wrapped data.
* \return _data, may be 0, GenericPointerData has ownership
*/
const T* getData() const {
return _data;
};
/**
* Returns the pointer to the wrapped data.
* \return _data, may be 0, GenericPointerData has ownership
*/
T* getData() {
return _data;
};
/**
* Sets the data to \a data.
* \param data The new pointer for this data, may be 0, GenericPointerData takes ownerwhip.
*/
void setData(T* data) {
_data = data;
};
/**
* Prototype - clone method, some people call this virtual constructor...
* \return A SHALLOW copy of this object.
*/
virtual AbstractData* clone() const {
// FIXME: This is only a shallow copy - not what you expect from clone!
return new GenericPointerData<T>(_data);
};
/**
* Returns the local memory footprint of the data in bytes.
* \return Number of bytes occupied in local memory by the data.
*/
virtual size_t getLocalMemoryFootprint() const {
return sizeof(T) + sizeof(T*);
};
/**
* Returns the video memory footprint of the data in bytes.
* \return Number of bytes occupied in video memory by the data.
*/
virtual size_t getVideoMemoryFootprint() const {
return 0;
};
protected:
T* _data; ///< Pointer to the data.
};
}
#endif // GENERICPOINTERDATA_H__
...@@ -4,6 +4,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR) ...@@ -4,6 +4,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
MESSAGE(STATUS "Configuring Campvis Modules") MESSAGE(STATUS "Configuring Campvis Modules")
LINK_DIRECTORIES(${CampvisGlobalLinkDirectories} ${CampvisModulesLinkDirectories})
ADD_LIBRARY(campvis-modules ADD_LIBRARY(campvis-modules
${CampvisModulesSources} ${CampvisModulesHeaders} ${CampvisModulesSources} ${CampvisModulesHeaders}
) )
...@@ -13,7 +14,6 @@ ADD_LIBRARY(campvis-modules ...@@ -13,7 +14,6 @@ ADD_LIBRARY(campvis-modules
FIND_PACKAGE(Qt4 ${CampvisRequiredQtVersion} REQUIRED QtCore QtGui QtOpenGL) FIND_PACKAGE(Qt4 ${CampvisRequiredQtVersion} REQUIRED QtCore QtGui QtOpenGL)
INCLUDE(${QT_USE_FILE}) INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${CampvisGlobalDefinitions} ${CampvisModulesDefinitions} ${QT_DEFINITIONS}) ADD_DEFINITIONS(${CampvisGlobalDefinitions} ${CampvisModulesDefinitions} ${QT_DEFINITIONS})
INCLUDE_DIRECTORIES(${CampvisGlobalIncludeDirs} ${CampvisModulesIncludeDirs}) INCLUDE_DIRECTORIES(${CampvisGlobalIncludeDirs} ${CampvisModulesIncludeDirs})
TARGET_LINK_LIBRARIES(campvis-modules campvis-core tgt ${CampvisGlobalExternalLibs} ${CampvisModulesExternalLibs} ${QT_LIBRARIES}) TARGET_LINK_LIBRARIES(campvis-modules campvis-core tgt ${CampvisGlobalExternalLibs} ${CampvisModulesExternalLibs} ${QT_LIBRARIES})
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