0028932: Add possibility to install Eigen along the OCCT
authorski <ski@opencascade.com>
Thu, 24 Aug 2017 10:55:52 +0000 (13:55 +0300)
committerbugmaster <bugmaster@opencascade.com>
Wed, 30 Aug 2017 13:19:55 +0000 (16:19 +0300)
Added installation of Eigen.

CMakeLists.txt
adm/cmake/eigen.cmake
adm/cmake/vardescr.cmake

index 23ad2d6..feeaa9a 100644 (file)
@@ -656,11 +656,13 @@ if (CAN_USE_EIGEN)
     OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/eigen")
   else()
     OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EIGEN")
+    OCCT_CHECK_AND_UNSET ("INSTALL_EIGEN")
   endif()
 else()
   OCCT_CHECK_AND_UNSET ("USE_EIGEN")
 
   OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_EIGEN")
+  OCCT_CHECK_AND_UNSET ("INSTALL_EIGEN")
 endif()
 
 # Doxygen
index d0ae133..87b56ea 100644 (file)
@@ -1,5 +1,9 @@
 # eigen
 
+if (NOT DEFINED INSTALL_EIGEN)
+  set (INSTALL_EIGEN OFF CACHE BOOL "${INSTALL_EIGEN_DESCR}")
+endif()
+
 # eigen directory
 if (NOT DEFINED 3RDPARTY_EIGEN_DIR)
   set (3RDPARTY_EIGEN_DIR "" CACHE PATH "The directory containing eigen")
@@ -61,6 +65,18 @@ endif()
 
 if (3RDPARTY_EIGEN_INCLUDE_DIR AND EXISTS "${3RDPARTY_EIGEN_INCLUDE_DIR}")
   list (APPEND 3RDPARTY_INCLUDE_DIRS "${3RDPARTY_EIGEN_INCLUDE_DIR}")
+
+  # Install header files
+  if (INSTALL_EIGEN)
+    file(GLOB EIGEN_SUBDIRS "${3RDPARTY_EIGEN_INCLUDE_DIR}/*")
+    foreach(SUBDIR ${EIGEN_SUBDIRS})
+      if(IS_DIRECTORY "${SUBDIR}")
+        install (DIRECTORY "${SUBDIR}" DESTINATION "${INSTALL_DIR_INCLUDE}")
+      else()
+        install (FILES "${SUBDIR}" DESTINATION "${INSTALL_DIR_INCLUDE}")
+      endif()
+    endforeach()
+  endif()
 else()
   list (APPEND 3RDPARTY_NOT_INCLUDED 3RDPARTY_EIGEN_INCLUDE_DIR)
 
index 6fb0395..c232762 100644 (file)
@@ -84,6 +84,7 @@ INSTALL_MESSAGE (INSTALL_TEST_CASES       "non-regression OCCT test scripts")
 INSTALL_MESSAGE (INSTALL_DOC_Overview     "OCCT overview documentation (HTML format)")
 INSTALL_MESSAGE (INSTALL_FFMPEG           "FFmpeg binaries")
 INSTALL_MESSAGE (INSTALL_FREEIMAGE        "FreeImage binaries")
+INSTALL_MESSAGE (INSTALL_EIGEN            "EIGEN header files")
 INSTALL_MESSAGE (INSTALL_EGL              "EGL binaries")
 INSTALL_MESSAGE (INSTALL_GLES2            "OpenGL ES 2.0 binaries")
 INSTALL_MESSAGE (INSTALL_FREETYPE         "FreeType binaries")