Add Eigen to build.

pull/1170/head
Ryan Pavlik 2018-01-02 14:35:27 -06:00 committed by phkahler
parent ac91809a96
commit dca5ce607d
2 changed files with 17 additions and 1 deletions

View File

@ -57,6 +57,9 @@ set(ENABLE_OPENMP OFF CACHE BOOL
"Whether geometric operations will be parallelized using OpenMP")
set(ENABLE_LTO OFF CACHE BOOL
"Whether interprocedural (global) optimizations are enabled")
option(FORCE_VENDORED_Eigen3
"Whether we should use our bundled Eigen even in the presence of a system copy"
OFF)
set(OPENGL 3 CACHE STRING "OpenGL version to use (one of: 1 3)")
@ -190,6 +193,18 @@ set(MI_BUILD_TESTS OFF CACHE BOOL "")
add_subdirectory(extlib/mimalloc EXCLUDE_FROM_ALL)
set(MIMALLOC_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/extlib/mimalloc/include)
if(NOT FORCE_VENDORED_Eigen3)
find_package(Eigen3 CONFIG)
endif()
if(FORCE_VENDORED_Eigen3 OR NOT EIGEN3_FOUND)
message(STATUS "Using in-tree Eigen")
set(EIGEN3_FOUND YES)
set(EIGEN3_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extlib/eigen)
else()
message(STATUS "Using system Eigen: ${EIGEN3_INCLUDE_DIRS}")
endif()
if(WIN32 OR APPLE)
# On Win32 and macOS we use vendored packages, since there is little to no benefit
# to trying to find system versions. In particular, trying to link to libraries from

View File

@ -27,7 +27,8 @@ target_include_directories(slvs_deps INTERFACE SYSTEM
${PNG_PNG_INCLUDE_DIR}
${FREETYPE_INCLUDE_DIRS}
${CAIRO_INCLUDE_DIRS}
${MIMALLOC_INCLUDE_DIR})
${MIMALLOC_INCLUDE_DIR}
${EIGEN3_INCLUDE_DIRS})
target_link_libraries(slvs_deps INTERFACE
dxfrw
${ZLIB_LIBRARY}