Browse Source

fixed for static build

Former-commit-id: 69d734c26287ab24532a5248cdcedb29e2c4ebb8
Daniele Panozzo 9 years ago
parent
commit
f26f4a020f
2 changed files with 27 additions and 1 deletions
  1. 1 1
      optional/CMakeLists.txt
  2. 26 0
      tutorial/cmake/FindEMBREEH.cmake

+ 1 - 1
optional/CMakeLists.txt

@@ -75,7 +75,7 @@ else (MATLAB_FOUND)
 endif(MATLAB_FOUND)
 
 ## Check for EMBREE, if not available skip the examples that depends on it
-find_package(EMBREE QUIET)
+find_package(EMBREEH QUIET)
 if (EMBREE_FOUND)
   include_directories( ${EMBREE_INCLUDE_DIR})
 else (EMBREE_FOUND)

+ 26 - 0
tutorial/cmake/FindEMBREEH.cmake

@@ -0,0 +1,26 @@
+#
+# Try to find EMBREE header files
+# Once done this will define
+#
+# EMBREE_FOUND           - system has EMBREE
+# EMBREE_INCLUDE_DIRS    - the EMBREE include directories
+
+FIND_PATH(EMBREE_INCLUDE_DIR embree2/rtcore.h
+	  PATHS
+		${PROJECT_SOURCE_DIR}/../../external/embree/include
+		${PROJECT_SOURCE_DIR}/../external/embree/include
+		${PROJECT_SOURCE_DIR}/../libigl/external/embree/include
+		NO_DEFAULT_PATH
+    )
+
+if(EMBREE_INCLUDE_DIR)
+	set(EMBREE_FOUND TRUE)
+endif(EMBREE_INCLUDE_DIR)
+
+IF (EMBREE_FOUND)
+   message(STATUS "Found EMBREE: ${EMBREE_INCLUDE_DIR}")
+
+   SET(EMBREE_INCLUDE_DIRS ${EMBREE_INCLUDE_DIR} ${EMBREE_INCLUDE_DIR}/embree)
+ELSE (EMBREE_FOUND)
+    message(STATUS "could NOT find EMBREE")
+ENDIF (EMBREE_FOUND)