cmake: Fix that allows FindEigen3.cmake to be executed

With this fix in the macros-and-definition script,
FindEigen3.cmake can be executed when needed, and hence
allows using custom Eigen 3rd-party library instead of
default installation version. I.e. it is enough to simply
place eigen in some folder, and then running export
EIGEN3_ROOT=/some/folder/eigen before compiling
will allow the FindEigen3.cmake script to find it.
This commit is contained in:
Biljana Bojovic
2023-02-13 19:53:51 +01:00
parent 7495938a2d
commit 7f8a1dfa8a

View File

@@ -646,19 +646,6 @@ macro(process_options)
endif()
endif()
set(ENABLE_EIGEN False)
if(${NS3_EIGEN})
find_package(Eigen3 QUIET)
if(${EIGEN3_FOUND})
set(ENABLE_EIGEN True)
add_definitions(-DHAVE_EIGEN3)
include_directories(${EIGEN3_INCLUDE_DIR})
else()
message(${HIGHLIGHTED_STATUS} "Eigen was not found")
endif()
endif()
if(${NS3_NATIVE_OPTIMIZATIONS} AND ${GCC})
add_compile_options(-march=native -mtune=native)
endif()
@@ -729,6 +716,19 @@ macro(process_options)
)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/build-support/3rd-party")
set(ENABLE_EIGEN False)
if(${NS3_EIGEN})
find_package(Eigen3 QUIET)
if(${EIGEN3_FOUND})
set(ENABLE_EIGEN True)
add_definitions(-DHAVE_EIGEN3)
include_directories(${EIGEN3_INCLUDE_DIR})
else()
message(${HIGHLIGHTED_STATUS} "Eigen was not found")
endif()
endif()
# GTK3 Don't search for it if you don't have it installed, as it take an
# insane amount of time
if(${NS3_GTK3})