Notice to GitKraken users: A vulnerability has been found in the SSH key generation of GitKraken versions 7.6.0 to 8.0.0 (https://www.gitkraken.com/blog/weak-ssh-key-fix). If you use GitKraken and have generated a SSH key using one of these versions, please remove it both from your local workstation and from your LRZ GitLab profile.

21.10.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit 784b6f41 authored by schultezub's avatar schultezub
Browse files

Major update in project structure:

The modules package is now itsself modular. Every subdirectory in modules/ builds its own submodule that can be individually switched on and off. Therefore each submodule needs its own submodule.cmake file to specify the build targets etc.
This is neat!

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@340 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent dcc0c5db
......@@ -31,6 +31,8 @@ ENDIF()
include(cmake/commonconf.cmake)
MESSAGE(STATUS "--------------------------------------------------------------------------------")
IF(CAMPVIS_BUILD_LIB_TGT)
ADD_SUBDIRECTORY(ext/tgt)
ENDIF()
......
......@@ -28,8 +28,8 @@
// ================================================================================================
#include "application/campvisapplication.h"
#include "modules/pipelines/dvrvis.h"
#include "modules/pipelines/slicevis.h"
#include "modules/vis/pipelines/dvrvis.h"
#include "modules/vis/pipelines/slicevis.h"
using namespace campvis;
......
......@@ -185,5 +185,59 @@ ELSE(OPENCL_FOUND)
MESSAGE(FATAL_ERROR "OpenCL not found!")
ENDIF(OPENCL_FOUND)
# detect modules
MESSAGE(STATUS "--------------------------------------------------------------------------------")
MESSAGE(STATUS "Detecting installed modules:")
# collect list of directories in modules directories
SET(ModulesDir ${CAMPVIS_HOME}/modules)
LIST_SUBDIRECTORIES(ModDirs ${ModulesDir} false)
# remove CMake realted directories
LIST(REMOVE_ITEM ModDirs CMakeFiles)
LIST(REMOVE_ITEM ModDirs campvis-modules.dir)
# go through each subdirectory
FOREACH(ModDir ${ModDirs})
# check whether module.cmake file exists
SET(ModFile ${ModulesDir}/${ModDir}/${ModDir}.cmake)
IF(EXISTS ${ModFile})
MESSAGE(STATUS "* Found Module ${ModDir}")
STRING(TOLOWER ${ModDir} ModDirLower)
STRING(TOUPPER ${ModDir} ModDirUpper)
# check whether the option to build this very module exists and is checked
IF(CAMPVIS_BUILD_MODULE_${ModDirUpper})
SET(ThisModDir ${ModulesDir}/${ModDir})
# load .cmake file
INCLUDE(${ModFile})
# merge module settings into global settings
LIST(APPEND CAMPVisModulesDefinitions ${ThisModDefinitions})
LIST(APPEND CAMPVisModulesIncludeDirs ${ThisModIncludeDirs})
LIST(APPEND CAMPVisModulesExternalLibs ${ThisModExternalLibs})
LIST(APPEND CAMPVisModulesSources ${ThisModSources})
LIST(APPEND CAMPVisModulesHeaders ${ThisModHeaders})
# unset module settings to avoid duplicates if module cmake file misses sth.
UNSET(ThisModDefinitions)
UNSET(ThisModIncludeDirs)
UNSET(ThisModExternalLibs)
UNSET(ThisModSources)
UNSET(ThisModHeaders)
ELSEIF(NOT DEFINED CAMPVIS_BUILD_MODULE_${ModDirUpper})
# add a CMake option for building this module
OPTION(CAMPVIS_BUILD_MODULE_${ModDirUpper} "Build Module ${ModDir}" OFF)
ENDIF(CAMPVIS_BUILD_MODULE_${ModDirUpper})
ELSE(EXISTS ${ModFile})
MESSAGE(STATUS "* WARNING: Found Directory ${ModDir} Without CMake file - ignored")
ENDIF(EXISTS ${ModFile})
ENDFOREACH(ModDir ${ModDirs})
SET(COMMONCONF_PROCESSED TRUE)
ENDIF(NOT COMMONCONF_PROCESSED)
PROJECT(campvis-modules)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
INCLUDE(../cmake/commonconf.cmake)
#INCLUDE(../cmake/commonconf.cmake)
MESSAGE(STATUS "Configuring CAMPVis Modules")
FILE(GLOB CAMPVIS_MODULES_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
classification/*.cpp
io/*.cpp
pipelines/*.cpp
preprocessing/*.cpp
vis/*.cpp
)
FILE(GLOB CAMPVIS_MODULES_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
classification/*.h
io/*.h
pipelines/*.h
preprocessing/*.h
vis/*.h
vis/*.frag
vis/*.cl
ADD_LIBRARY(campvis-modules
${CAMPVisModulesSources} ${CAMPVisModulesHeaders}
)
#SET(CAMPVIS_MODULES_SOURCES
# application/campvis.cpp
# application/campvispainter.cpp
# datastructures/
#)
# TODO: Remove Qt dependency as soon as the pipelines got cleaned up (and thus removed their hard link to tgt/qt/qtcontextmanager.h
#SET(CAMPVIS_MODULES_HEADERS
# application/campvispainter.h
#)
#
# Qt related stuff:
#
FIND_PACKAGE(Qt4 ${CAMPVIS_REQUIRED_QT_VERSION} REQUIRED QtCore QtGui QtOpenGL)
#QT4_WRAP_CPP(CAMPVIS_MODULES_MOC ${CAMPVIS_MODULES_HEADERS})
INCLUDE(${QT_USE_FILE})
ADD_LIBRARY(campvis-modules
${CAMPVIS_MODULES_SOURCES} ${CAMPVIS_MODULES_HEADERS}
# ${CAMPVIS_MODULES_MOC}
)
ADD_DEFINITIONS(${CAMPVIS_DEFINITIONS} ${QT_DEFINITIONS})
INCLUDE_DIRECTORIES(${CAMPVIS_INCLUDE_DIRECTORIES})
TARGET_LINK_LIBRARIES(campvis-modules campvis-core tgt kisscl ${CAMPVIS_EXTERNAL_LIBRARIES} ${QT_LIBRARIES})
ADD_DEFINITIONS(${CAMPVIS_DEFINITIONS} ${CAMPVisModulesDefinitions} ${QT_DEFINITIONS})
INCLUDE_DIRECTORIES(${CAMPVIS_INCLUDE_DIRECTORIES} ${CAMPVisModulesIncludeDirs})
TARGET_LINK_LIBRARIES(campvis-modules campvis-core tgt ${CAMPVisModulesExternalLibs} ${QT_LIBRARIES})
# CMake file for IO module
# Source files:
FILE(GLOB ThisModSources RELATIVE ${ModulesDir}
modules/io/processors/*.cpp
)
# Header files
FILE(GLOB ThisModHeaders RELATIVE ${ModulesDir}
modules/io/processors/*.h
)
# CMake file for OpenCL module
# Source files:
FILE(GLOB ThisModSources RELATIVE ${ModulesDir}
modules/opencl/processors/*.cpp
)
# Header files (including CL files so that they'll appear in VS projects)
FILE(GLOB ThisModHeaders RELATIVE ${ModulesDir}
modules/opencl/glsl/*.cl
modules/opencl/processors/*.h
)
LIST(APPEND ThisModExternalLibs kisscl)
\ No newline at end of file
......@@ -93,7 +93,7 @@ namespace campvis {
_clContext = CLRtm.createGlSharingContext();
if (_clContext != 0) {
_clProgram = CLRtm.loadProgram(_clContext, "modules/vis/clraycaster.cl");
_clProgram = CLRtm.loadProgram(_clContext, "modules/vis/cl/clraycaster.cl");
_clProgram->setBuildOptions(" -cl-fast-relaxed-math -cl-mad-enable");
_clProgram->build();
}
......
# CMake file for Preprocessing module
# Source files:
FILE(GLOB ThisModSources RELATIVE ${ModulesDir}
modules/preprocessing/processors/*.cpp
)
# Header files
FILE(GLOB ThisModHeaders RELATIVE ${ModulesDir}
modules/preprocessing/processors/*.h
)
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