Skip to content

Commit 106d33f

Browse files
authored
Merge pull request #1694 from SCIInstitute/ospray-qt4
Basic Ospray integration
2 parents 2fa1361 + afbcadc commit 106d33f

File tree

15 files changed

+2182
-36
lines changed

15 files changed

+2182
-36
lines changed

src/CMake/Modules/FindOSPRay.cmake

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
## ======================================================================================= ##
2+
## Copyright 2014-2015 Texas Advanced Computing Center, The University of Texas at Austin ##
3+
## All rights reserved. ##
4+
## ##
5+
## Licensed under the BSD 3-Clause License, (the "License"); you may not use this file ##
6+
## except in compliance with the License. ##
7+
## A copy of the License is included with this software in the file LICENSE. ##
8+
## If your copy does not contain the License, you may obtain a copy of the License at: ##
9+
## ##
10+
## http://opensource.org/licenses/BSD-3-Clause ##
11+
## ##
12+
## Unless required by applicable law or agreed to in writing, software distributed under ##
13+
## the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY ##
14+
## KIND, either express or implied. ##
15+
## See the License for the specific language governing permissions and limitations under ##
16+
## limitations under the License. ##
17+
## ======================================================================================= ##
18+
19+
20+
###############################################################################
21+
# Find OSPRay
22+
# defines:
23+
# OSPRAY_FOUND
24+
# OSPRAY_INCLUDE_DIRS
25+
# OSPRAY_LIBRARIES
26+
27+
set(OSPRAY_INSTALL_DIR "" CACHE PATH "install location of ospray")
28+
mark_as_advanced(OSPRAY_INSTALL_DIR)
29+
set(OSPRAY_BUILD_DIR "" CACHE PATH "build location of ospray")
30+
mark_as_advanced(OSPRAY_BUILD_DIR)
31+
if (OSPRAY_INSTALL_DIR AND OSPRAY_BUILD_DIR)
32+
message("Ignoring the ospray build location in favor of the intall location.")
33+
endif()
34+
35+
if (OSPRAY_INSTALL_DIR)
36+
37+
find_package(ospray CONFIG REQUIRED HINTS ${OSPRAY_INSTALL_DIR})
38+
39+
else()
40+
41+
if (OSPRAY_BUILD_DIR)
42+
#find corresponding source directory
43+
load_cache(${OSPRAY_BUILD_DIR} READ_WITH_PREFIX OSP_
44+
CMAKE_HOME_DIRECTORY
45+
embree_DIR
46+
)
47+
set(OSPRAY_SOURCE_DIR ${OSP_CMAKE_HOME_DIRECTORY})
48+
49+
set(OSPRAY_INCLUDE_DIRS
50+
${OSPRAY_BUILD_DIR}
51+
${OSPRAY_BUILD_DIR}/include
52+
${OSPRAY_SOURCE_DIR}
53+
${OSPRAY_SOURCE_DIR}/ospray/include
54+
)
55+
56+
# message(${OSP_embree_DIR})
57+
# message(${OSP_embree_DIR}/bin)
58+
# set(LIB_OSPRAY_EMBREE LIB_OSPRAY_EMBREE-NOTFOUND)
59+
# find_library(LIB_OSPRAY_EMBREE NAMES ospray_embree embree
60+
# PATHS ${OSPRAY_BUILD_DIR} ${OSPRAY_BUILD_DIR}/Release
61+
# ${OSP_embree_DIR} ${OSP_embree_DIR}/bin NO_DEFAULT_PATH)
62+
# mark_as_advanced(LIB_OSPRAY_EMBREE)
63+
64+
set(LIB_OSPRAY_COMMON LIB_OSPRAY_COMMON-NOTFOUND)
65+
find_library(LIB_OSPRAY_COMMON ospray_common
66+
PATHS ${OSPRAY_BUILD_DIR} ${OSPRAY_BUILD_DIR}/Release NO_DEFAULT_PATH)
67+
mark_as_advanced(LIB_OSPRAY_COMMON)
68+
69+
set(LIB_OSPRAY LIB_OSPRAY-NOTFOUND)
70+
find_library(LIB_OSPRAY ospray PATHS ${OSPRAY_BUILD_DIR} ${OSPRAY_BUILD_DIR}/Release NO_DEFAULT_PATH)
71+
mark_as_advanced(LIB_OSPRAY)
72+
73+
set(OSPRAY_LIBRARIES ${LIB_OSPRAY_COMMON} ${LIB_OSPRAY})
74+
75+
else()
76+
77+
message("Supply OSPRAY_INSTALL_DIR or OSPRAY_BUILD_DIR to find OSPRay")
78+
79+
endif()
80+
81+
endif()

src/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,15 @@ IF(WITH_TETGEN)
364364
ADD_DEFINITIONS(-DWITH_TETGEN)
365365
ENDIF()
366366

367+
########################################################################
368+
# Configure ospray module build-- TODO: convert into real external
369+
370+
OPTION(WITH_OSPRAY "Build with Ospray support." OFF)
371+
MARK_AS_ADVANCED(WITH_OSPRAY)
372+
IF(WITH_OSPRAY)
373+
ADD_DEFINITIONS(-DWITH_OSPRAY)
374+
ENDIF()
375+
367376
########################################################################
368377
# Copy Spire-SCIRun specific assets and shaders
369378

@@ -717,7 +726,7 @@ SET_PROPERTY(TARGET Testing_Utils PROPERTY FOLDER "Testing Support")
717726
SET_PROPERTY(TARGET Testing_ModuleTestBase PROPERTY FOLDER "Testing Support")
718727

719728
IF(BUILD_TESTING)
720-
729+
721730
#SET_PROPERTY(TARGET SCIRunTestData_external PROPERTY FOLDER "Testing Support")
722731

723732
SET_PROPERTY(TARGET Algorithms_Base_Tests PROPERTY FOLDER "Core/Algorithms/Tests")

0 commit comments

Comments
 (0)