Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/UniStuttgart-VISUS/megamol
Browse files Browse the repository at this point in the history
…into sphererenderer
  • Loading branch information
braunms committed Feb 21, 2020
2 parents 902dd4c + 89e531b commit 7c81316
Show file tree
Hide file tree
Showing 73 changed files with 4,593 additions and 1,051 deletions.
81 changes: 72 additions & 9 deletions CMakeExternals.cmake
@@ -1,4 +1,14 @@
include(External)
# Clone external script
if(NOT EXISTS "${CMAKE_BINARY_DIR}/script-externals")
message(STATUS "Downloading external scripts")
execute_process(COMMAND
${GIT_EXECUTABLE} clone https://github.com/UniStuttgart-VISUS/megamol-cmake-externals.git script-externals --depth 1
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()

# Include external script
include("${CMAKE_BINARY_DIR}/script-externals/cmake/External.cmake")

#
# Centralized function to require externals to add them once by invoking
Expand Down Expand Up @@ -119,6 +129,7 @@ function(require_external NAME)
CMAKE_ARGS
-DBUILD_SHARED_LIBS=OFF
-DBUILD_TESTING=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DADIOS2_USE_BZip2=OFF
-DADIOS2_USE_Fortran=OFF
-DADIOS2_USE_HDF5=OFF
Expand Down Expand Up @@ -163,21 +174,19 @@ function(require_external NAME)
return()
endif()

include(GNUInstallDirs)

if(WIN32)
set(GLFW_IMPORT_LIB "lib/glfw3dll.lib")
set(GLFW_LIB "lib/glfw3.dll")
set(MOVE_CMD COMMANDS COMMAND ${CMAKE_COMMAND} -E copy "\"<INSTALL_DIR>/lib/glfw3.dll\" \"<INSTALL_DIR>/bin/glfw3.dll\""
COMMAND ${CMAKE_COMMAND} -E remove -f \"<INSTALL_DIR>/lib/glfw3.dll\")
set(GLFW_IMPORT_LIB "${CMAKE_INSTALL_LIBDIR}/glfw3dll.lib")
set(GLFW_LIB "bin/glfw3.dll")
else()
set(GLFW_LIB "lib/libglfw.so")
set(MOVE_CMD)
set(GLFW_LIB "${CMAKE_INSTALL_LIBDIR}/libglfw.so")
endif()

add_external_project(glfw SHARED
GIT_REPOSITORY https://github.com/glfw/glfw.git
GIT_TAG "3.2.1"
GIT_TAG "3.3.2"
BUILD_BYPRODUCTS "<INSTALL_DIR>/${GLFW_LIB}" "<INSTALL_DIR>/${GLFW_IMPORT_LIB}"
${MOVE_CMD}
CMAKE_ARGS
-DBUILD_SHARED_LIBS=ON
-DGLFW_BUILD_EXAMPLES=OFF
Expand Down Expand Up @@ -564,6 +573,60 @@ function(require_external NAME)
mark_as_advanced(FORCE ZLIB_VERSION_PATCH)
mark_as_advanced(FORCE ZLIB_VERSION_TWEAK)

# vtkm
elseif(NAME STREQUAL "vtkm")
if(TARGET vtkm)
return()
endif()

set(VTKM_VER 1.4)

if(WIN32)
set(VTKM_LIB_CONT "lib/vtkm_cont-${VTKM_VER}.lib")
set(VTKM_LIB_DEBUG_CONT "lib/vtkm_cont-${VTKM_VER}.lib")
set(VTKM_LIB_RENDERER "lib/vtkm_rendering-${VTKM_VER}.lib")
set(VTKM_LIB_DEBUG_RENDERER "lib/vtkm_rendering-${VTKM_VER}.lib")
set(VTKM_LIB_WORKLET "lib/vtkm_worklet-${VTKM_VER}.lib")
set(VTKM_LIB_DEBUG_WORKLET "lib/vtkm_worklet-${VTKM_VER}.lib")
else()
include(GNUInstallDirs)
set(VTKM_LIB_CONT "lib/vtkm_cont-${VTKM_VER}.a")
set(VTKM_LIB_DEBUG_CONT "lib/vtkm_cont-${VTKM_VER}.a")
set(VTKM_LIB_RENDERER "lib/vtkm_rendering-${VTKM_VER}.a")
set(VTKM_LIB_DEBUG_RENDERER "lib/vtkm_rendering-${VTKM_VER}.a")
set(VTKM_LIB_WORKLET "lib/vtkm_worklet-${VTKM_VER}.a")
set(VTKM_LIB_DEBUG_WORKLET "lib/vtkm_worklet-${VTKM_VER}.a")
endif()

option(vtkm_ENABLE_CUDA "Option to build vtkm with cuda enabled" OFF)

add_external_project(vtkm
GIT_REPOSITORY https://gitlab.kitware.com/vtk/vtk-m.git
GIT_TAG "v1.4.0"
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=OFF
-DVTKm_ENABLE_TESTING:BOOL=OFF
-DVTKm_ENABLE_CUDA:BOOL=${vtkm_ENABLE_CUDA}
-DBUILD_TESTING:BOOL=OFF
-VTKm_ENABLE_DEVELOPER_FLAGS:BOOL=OFF
-DCMAKE_BUILD_TYPE=Release
)

add_external_library(vtkm_cont STATIC
PROJECT vtkm
LIBRARY_RELEASE "${VTKM_LIB_CONT}"
LIBRARY_DEBUG "${VTKM_LIB_DEBUG_CONT}")

add_external_library(vtkm_renderer STATIC
PROJECT vtkm
LIBRARY_RELEASE "${VTKM_LIB_RENDERER}"
LIBRARY_DEBUG "${VTKM_LIB_DEBUG_RENDERER}")

add_external_library(vtkm_worklet STATIC
PROJECT vtkm
LIBRARY_RELEASE "${VTKM_LIB_WORKLET}"
LIBRARY_DEBUG "${VTKM_LIB_DEBUG_WORKLET}")

else()
message(FATAL_ERROR "Unknown external required \"${NAME}\"")
endif()
Expand Down
7 changes: 4 additions & 3 deletions CMakeLists.txt
Expand Up @@ -77,13 +77,14 @@ add_subdirectory(utils)
# Examples
option(EXAMPLES "Get the MegaMol example repository" ON)
if(EXAMPLES)
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/examples")
if(NOT EXISTS "${CMAKE_BINARY_DIR}/examples")
message(STATUS "Downloading examples")
execute_process(COMMAND
${GIT_EXECUTABLE} clone https://github.com/UniStuttgart-VISUS/megamol-examples.git examples
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
${GIT_EXECUTABLE} clone https://github.com/UniStuttgart-VISUS/megamol-examples.git examples --depth 1
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
install(DIRECTORY "${CMAKE_BINARY_DIR}/examples" DESTINATION "${CMAKE_INSTALL_PREFIX}" PATTERN ".git" EXCLUDE)
endif()

# Validate dependencies
Expand Down
9 changes: 7 additions & 2 deletions Readme.md
Expand Up @@ -9,6 +9,10 @@ MegaMol is a visualization middleware used to visualize point-based molecular da
MegaMol succeeds ​MolCloud, which has been developed at the University of Stuttgart in order to visualize point-based data sets. MegaMol is written in C++, and uses an OpenGL as Rendering-API and GLSL-Shader. It supports the operating systems Microsoft Windows and Linux, each in 32-bit and 64-bit versions. In large parts, MegaMol is based on VISlib, a C++-class library for scientific visualization, which has also been developed at the University of Stuttgart.


## Changelog
​See [changelog](https://github.com/UniStuttgart-VISUS/megamol/wiki/Changelog) for newly available features in the current version of MegaMol.


## Building MegaMol
### Linux
1. Clone the MegaMol repository
Expand All @@ -18,7 +22,8 @@ MegaMol succeeds ​MolCloud, which has been developed at the University of Stut
5. Run `make install` to create your MegaMol installation
6. Test Megamol with

./megamol.sh -p ..\examples\testspheres.lua
$ ./megamol.sh -p ../examples/testspheres.lua


### Windows
1. Clone the MegaMol repository
Expand All @@ -29,7 +34,7 @@ MegaMol succeeds ​MolCloud, which has been developed at the University of Stut
5. Use the `INSTALL` target to create your MegaMol installation
6. Test Megamol with

mmconsole.exe -p ..\examples\testspheres.lua
> mmconsole.exe -p ..\examples\testspheres.lua


## MegaMol Configurator
Expand Down

0 comments on commit 7c81316

Please sign in to comment.