Commit e4ae19a6 by Maarten L. Hekkelman

cleaner makefile

parent 9cba754e
...@@ -199,20 +199,22 @@ endif() ...@@ -199,20 +199,22 @@ endif()
find_package(ZLIB REQUIRED) find_package(ZLIB REQUIRED)
find_package(Eigen3 REQUIRED) find_package(Eigen3 QUIET)
if(NOT Eigen3_FOUND) if(Eigen3_FOUND)
FetchContent_Declare( get_target_property(EIGEN_INCLUDE_DIR Eigen3::Eigen INTERFACE_INCLUDE_DIRECTORIES)
eigen3 else()
ExternalProject_Add(
local_Eigen3
GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
GIT_TAG 3.4.0 GIT_TAG 3.4.0
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/external
) )
FetchContent_MakeAvailable(eigen3) set(EIGEN3_D local_Eigen3)
set(EIGEN_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/external/include)
endif() endif()
get_target_property(EIGEN_INCLUDE_DIR Eigen3::Eigen INTERFACE_INCLUDE_DIRECTORIES)
include(FindFilesystem) include(FindFilesystem)
list(APPEND CIFPP_REQUIRED_LIBRARIES ${STDCPPFS_LIBRARY}) list(APPEND CIFPP_REQUIRED_LIBRARIES ${STDCPPFS_LIBRARY})
...@@ -355,6 +357,9 @@ else() ...@@ -355,6 +357,9 @@ else()
endif() endif()
target_compile_definitions(cifpp PUBLIC DATA_DIR="${CIFPP_DATA_DIR}") target_compile_definitions(cifpp PUBLIC DATA_DIR="${CIFPP_DATA_DIR}")
if(${EIGEN3_D})
add_dependencies(cifpp ${EIGEN3_D})
endif()
if(UNIX) if(UNIX)
if ("${CMAKE_PREFIX_PATH}" STREQUAL "/usr/local") if ("${CMAKE_PREFIX_PATH}" STREQUAL "/usr/local")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment