Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
bernstein committed Oct 28, 2013
2 parents 7dd18b0 + e76c75f commit dc39de0
Show file tree
Hide file tree
Showing 37 changed files with 1,319 additions and 320 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
*.dot
*.gsm

*.opensdf

build
lib
doc/html
Expand Down
88 changes: 68 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,34 @@ set(GUACAMOLE_PACKAGENAME "GUACAMOLE")
# We require at least version 2.8.0
cmake_minimum_required(VERSION 2.8.0)

find_package(PkgConfig)
if (UNIX)
find_package(PkgConfig)
endif(UNIX)

# Location where cmake first looks for modules.
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)

################################################################
# Configure and find libraries
################################################################

pkg_check_modules(ASSIMP REQUIRED assimp)
pkg_check_modules(JSON REQUIRED jsoncpp)
pkg_check_modules(GL REQUIRED gl)
pkg_check_modules(GLEW REQUIRED glew)

set(GLOBAL_EXT_DIR ${GUACAMOLE_SOURCE_DIR}/externals)

if (UNIX)
pkg_check_modules(ASSIMP REQUIRED assimp)
pkg_check_modules(JSON REQUIRED jsoncpp)
pkg_check_modules(GL REQUIRED gl)
pkg_check_modules(GLEW REQUIRED glew)
elseif (WIN32)
include(find_assimp)
endif (UNIX)

include(find_compiler)
include(find_schism)
include(find_boost)
include(find_ev)
include(find_cuda)
#include(find_ev)
include(find_bullet)
include(find_json)

set(LIBS
${SCHISM_LIBRARIES}
Expand All @@ -45,18 +55,21 @@ set(LIBS
${GLEW_LIBRARIES}
${EV_LIBRARIES}
${BULLET_LIBRARIES}
${CUDA_LIBRARIES}
#profiler
#tcmalloc
)
link_libraries(${LIBS})

set(LIB_PATHS
${ASSIMP_LIBRARY_DIRS}
${JSON_LIBRARY_DIRS}
${GL_LIBRARY_DIRS}
${GLEW_LIBRARY_DIRS}
${BOOST_LIBRARY_DIRS}
${BULLET_LIBRARY_DIRS}
${SCHISM_LIBRARY_DIRS}
${CUDA_LIBRARY_DIRS}
)
link_directories(${LIB_PATHS})

set(INCLUDE_PATHS
${CMAKE_CURRENT_SOURCE_DIR}/build
Expand All @@ -69,15 +82,20 @@ set(INCLUDE_PATHS
${GLEW_INCLUDE_DIRS}
${EV_INCLUDE_DIRS}
${BULLET_INCLUDE_DIRS}
${CUDA_INCLUDE_DIRS}
)
include_directories(${INCLUDE_PATHS})

if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()

set(CMAKE_CXX_FLAGS_RELEASE "-s -O4 --std=c++0x -fpermissive")
set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall --std=c++0x -fpermissive")
IF (UNIX)
set(CMAKE_CXX_FLAGS_RELEASE "-s -O4 --std=c++0x -fpermissive")
set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall --std=c++0x -fpermissive")
ELSEIF(MSVC)
set(CMAKE_CXX_FLAGS_RELEASE "-D _SECURE_SCL=0 -D _SCL_SECURE_NO_WARNINGS -D _CRT_SECURE_NO_DEPRECATE /MD /MP")
set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG /MDd /Zi")
ENDIF(UNIX)

################################################################
# Create GuaRC
Expand All @@ -94,6 +112,8 @@ file(GLOB_RECURSE RESOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
resources/*
)

MESSAGE(${RESOURCES})

if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/include/gua/generated/)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/gua/generated)
endif()
Expand All @@ -102,16 +122,30 @@ if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/gua/generated/)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/gua/generated)
endif()

ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/gua/generated/R.inl
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/guarc/guarc
# ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/gua/generated/R.inl
# COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/guarc/guarc
# ${CMAKE_CURRENT_SOURCE_DIR}/resources
# ${CMAKE_CURRENT_SOURCE_DIR}/include/gua/generated/R.inl
# ${CMAKE_CURRENT_SOURCE_DIR}/src/gua/generated/R.inl
# DEPENDS ${RESOURCES} guarc
# )

ADD_CUSTOM_TARGET(CompileResources ALL
DEPENDS ${RESOURCES} guarc
)

SET (_GUARC_EXECUTABLE "")
IF (UNIX)
SET (_GUARC_EXECUTABLE "/guarc/guarc")
ELSEIF(WIN32)
SET (_GUARC_EXECUTABLE "/guarc/$(Configuration)/guarc.exe")
ENDIF(UNIX)

ADD_CUSTOM_COMMAND(TARGET CompileResources POST_BUILD
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}${_GUARC_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/resources
${CMAKE_CURRENT_SOURCE_DIR}/include/gua/generated/R.inl
${CMAKE_CURRENT_SOURCE_DIR}/src/gua/generated/R.inl
DEPENDS ${RESOURCES} guarc
)

ADD_CUSTOM_TARGET(CompileResources ALL
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/gua/generated/R.inl
)

################################################################
Expand All @@ -132,16 +166,29 @@ message( " build type: ${CMAKE_BUILD_TYPE}" )
message( "" )
message( " schism:" )
message( " library: ${SCHISM_LIBRARIES}" )
message( " library path: ${SCHISM_LIBRARY_DIRS}" )
message( " include: ${SCHISM_INCLUDE_DIRS}" )
message( "" )
message( " boost:" )
message( " library: ${BOOST_LIBRARIES}" )
message( " library path: ${BOOST_LIBRARY_DIRS}" )
message( " include: ${BOOST_INCLUDE_DIRS}" )
message( "" )
message( " assimp:" )
message( " library: ${ASSIMP_LIBRARIES}" )
message( " library path: ${ASSIMP_LIBRARY_DIRS}" )
message( " include: ${ASSIMP_INCLUDE_DIRS}" )
message( "" )
message( " json:" )
message( " library: ${JSON_LIBRARIES}" )
message( " library path: ${JSON_LIBRARY_DIRS}" )
message( " include: ${JSON_INCLUDE_DIRS}" )
message( "" )
message( " cuda:" )
message( " library: ${CUDA_LIBRARIES}" )
message( " library path: ${CUDA_LIBRARY_DIRS}" )
message( " include: ${CUDA_INCLUDE_DIRS}" )
message( "" )
message( " gl:" )
message( " library: ${GL_LIBRARIES}" )
message( " include: ${GL_INCLUDE_DIRS}" )
Expand All @@ -156,5 +203,6 @@ message( " include: ${EV_INCLUDE_DIRS}" )
message( "" )
message( " bullet:" )
message( " library: ${BULLET_LIBRARIES}" )
message( " library path: ${BULLET_LIBRARY_DIRS}" )
message( " include: ${BULLET_INCLUDE_DIRS}" )
message( "" )
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,35 @@ Guacamole

[![Build Status](https://secure.travis-ci.org/vrsys/guacamole.png)](http://travis-ci.org/vrsys/guacamole)

Guacamole is an extendable and efficient rendering system for visualizing
different data types. It features a lightweight scene graph and a modern
deferred shading system. Many common post processing effects are already
integrated, e.g. screen space ambient occlusion, HDR, FXAA, volumetric light
effects, bloom and fog.

Installation
------------

You need a NVIDIA GPU that supports OpenGL 4.2 and CUDA.

### Windows

We recommend building guacamole with Visual Studio 2013. We created a zip file
with all necessary dependencies.
Get `externals_vc120RC.zip` from https://github.com/vrsys/guacamole-externals.
Create a new directory `externals/` under the project root.
Unpack `externals_vc120RC.zip` into the `externals/` directory.
Then configure with `cmake` and build the library with Visual Studio.

### Linux

You need schism, boost, CUDA, bullet, assimp, libjson, and cmake.

* [schism](https://github.com/chrislu/schism)
* [assimp](https://github.com/assimp/assimp)

Configure with cmake and build with make.

Get involved!
-------------

Expand All @@ -16,3 +45,4 @@ Authors
* Felix Lauer
* Andreas Bernstein
* André Schollmeyer
* Andrey Babanin
80 changes: 80 additions & 0 deletions cmake/modules/find_assimp.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
SET(ASSIMP_INCLUDE_SEARCH_DIRS
${GLOBAL_EXT_DIR}/inc/assimp
/opt/assimp/current
)

SET(ASSIMP_LIBRARY_SEARCH_DIRS
${GLOBAL_EXT_DIR}/lib
/opt/assimp/current/assimp-build
)

message("-- checking for ASSIMP")

IF (NOT ASSIMP_INCLUDE_DIRS)

SET(_ASSIMP_FOUND_INC_DIRS "")

FOREACH(_SEARCH_DIR ${ASSIMP_INCLUDE_SEARCH_DIRS})
FIND_PATH(_CUR_SEARCH
NAMES assimp/assimp.h
PATHS ${_SEARCH_DIR}
NO_DEFAULT_PATH)
IF (_CUR_SEARCH)
LIST(APPEND _ASSIMP_FOUND_INC_DIRS ${_CUR_SEARCH})
ENDIF(_CUR_SEARCH)
SET(_CUR_SEARCH _CUR_SEARCH-NOTFOUND CACHE INTERNAL "internal use")
ENDFOREACH(_SEARCH_DIR ${ASSIMP_INCLUDE_SEARCH_DIRS})

IF (NOT _ASSIMP_FOUND_INC_DIRS)
MESSAGE(FATAL_ERROR "find_assimp.cmake: unable to find assimp headers")
ENDIF (NOT _ASSIMP_FOUND_INC_DIRS)

FOREACH(_INC_DIR ${_ASSIMP_FOUND_INC_DIRS})
LIST(APPEND ASSIMP_INCLUDE_DIRS ${_INC_DIR})
ENDFOREACH(_INC_DIR ${_BOOST_FOUND_INC_DIRS})

ENDIF(NOT ASSIMP_INCLUDE_DIRS)


IF(UNIX)
SET(ASSIMP_LIB_FILENAME "libassimp.so")
ELSEIF(WIN32)
SET(ASSIMP_LIB_FILENAME "assimp.lib")
ENDIF(UNIX)


IF ( ASSIMP_INCLUDE_DIRS
AND NOT ASSIMP_LIBRARIES)

SET(_ASSIMP_FOUND_LIB_DIR "")
SET(_ASSIMP_POSTFIX "")

FOREACH(_SEARCH_DIR ${ASSIMP_LIBRARY_SEARCH_DIRS})
FIND_PATH(_CUR_SEARCH
NAMES ${ASSIMP_LIB_FILENAME}
PATHS ${_SEARCH_DIR}
PATH_SUFFIXES debug release
NO_DEFAULT_PATH)
IF (_CUR_SEARCH)
LIST(APPEND _ASSIMP_FOUND_LIB_DIR ${_SEARCH_DIR})
ENDIF(_CUR_SEARCH)
SET(_CUR_SEARCH _CUR_SEARCH-NOTFOUND CACHE INTERNAL "internal use")
ENDFOREACH(_SEARCH_DIR ${ASSIMP_LIBRARY_SEARCH_DIRS})

IF (NOT _ASSIMP_FOUND_LIB_DIR)
MESSAGE(FATAL_ERROR "find_assimp.cmake: unable to find assimp libraries")
ELSE (NOT _ASSIMP_FOUND_LIB_DIR)
SET(ASSIMP_LIBRARY_DIRS ${_ASSIMP_FOUND_LIB_DIR} CACHE STRING "The assimp library directory")
message("-- found matching version")
ENDIF (NOT _ASSIMP_FOUND_LIB_DIR)

FOREACH(_LIB_DIR ${_ASSIMP_FOUND_LIB_DIR})
LIST(APPEND ASSIMP_LIBRARIES ${ASSIMP_LIB_FILENAME})
ENDFOREACH(_LIB_DIR ${_ASSIMP_FOUND_INC_DIRS})


ENDIF( ASSIMP_INCLUDE_DIRS
AND NOT ASSIMP_LIBRARIES)



Loading

0 comments on commit dc39de0

Please sign in to comment.