From 4b88541d59302d4e65ecc66093a367091538c32d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 19 Mar 2015 15:41:41 +1100 Subject: CMake: unbundle eigen3 Optionally use systems eigen3 library. T41989 by @hasufell with edits --- CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e54ddc9274..2e8552f2a1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -261,6 +261,10 @@ endif() # (unix defaults to System OpenJPEG On) option(WITH_SYSTEM_OPENJPEG "Use the operating systems OpenJPEG library" OFF) +if(UNIX AND NOT APPLE) + option(WITH_SYSTEM_EIGEN3 "Use the systems Eigen3 library" OFF) +endif() + # Modifiers option(WITH_MOD_FLUID "Enable Elbeem Modifier (Fluid Simulation)" ON) @@ -811,6 +815,14 @@ if(UNIX AND NOT APPLE) endif() endif() + if(WITH_SYSTEM_EIGEN3) + find_package_wrapper(Eigen3) + if(NOT EIGEN3_FOUND) + message(FATAL_ERROR "Failed finding system Eigen3 version!") + endif() + endif() + # else values are set below for all platforms + if(WITH_PYTHON) # No way to set py34. remove for now. # find_package(PythonLibs) @@ -2246,6 +2258,9 @@ if(WITH_IMAGE_REDCODE) set(REDCODE_INC ${REDCODE}) endif() +if(NOT WITH_SYSTEM_EIGEN3) + set(EIGEN3_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/Eigen3) +endif() #----------------------------------------------------------------------------- # Configure OpenGL. -- cgit v1.2.3