eigen.cmake 1.2 KB
Newer Older
Q
qijun 已提交
1 2 3
INCLUDE(ExternalProject)

SET(EIGEN_SOURCE_DIR ${THIRD_PARTY_PATH}/eigen3)
4 5
SET(EIGEN_INCLUDE_DIR ${EIGEN_SOURCE_DIR}/src/extern_eigen3)
INCLUDE_DIRECTORIES(${EIGEN_INCLUDE_DIR})
Q
qijun 已提交
6 7

ExternalProject_Add(
L
liaogang 已提交
8
    extern_eigen3
Q
qijun 已提交
9
    ${EXTERNAL_PROJECT_LOG_ARGS}
Q
qijun 已提交
10
    GIT_REPOSITORY  "https://github.com/RLovelett/eigen.git"
Q
Qiao Longfei 已提交
11
    GIT_TAG         70661066beef694cadf6c304d0d07e0758825c10
Q
qijun 已提交
12 13 14 15 16 17 18 19
    PREFIX          ${EIGEN_SOURCE_DIR}
    UPDATE_COMMAND  ""
    CONFIGURE_COMMAND ""
    BUILD_COMMAND     ""
    INSTALL_COMMAND   ""
    TEST_COMMAND      ""
)

L
liaogang 已提交
20 21
if (${CMAKE_VERSION} VERSION_LESS "3.3.0")
    set(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/eigen3_dummy.c)
22
    file(WRITE ${dummyfile} "const char *dummy_eigen3 = \"${dummyfile}\";")
L
liaogang 已提交
23 24 25 26
    add_library(eigen3 STATIC ${dummyfile})
else()
    add_library(eigen3 INTERFACE)
endif()
L
liaogang 已提交
27

L
liaogang 已提交
28 29 30
add_dependencies(eigen3 extern_eigen3)

LIST(APPEND external_project_dependencies eigen3)
31 32 33 34 35 36

IF(NOT WITH_C_API AND WITH_FLUID)
    INSTALL(FILES ${EIGEN_INCLUDE_DIR}/Eigen/Core DESTINATION third_party/eigen3/Eigen)
    INSTALL(DIRECTORY ${EIGEN_INCLUDE_DIR}/Eigen/src DESTINATION third_party/eigen3/Eigen)
    INSTALL(DIRECTORY ${EIGEN_INCLUDE_DIR}/unsupported/Eigen DESTINATION third_party/eigen3/unsupported)
ENDIF()