You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FindThirdPartyEigen.cmake 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # ---------------------------------
  2. # Finds Eigen headers
  3. #
  4. # Adds include path
  5. # ---------------------------------
  6. IF(WIN32)
  7. SET(PATH_EIGEN "PATH_EIGEN-NOTFOUND")
  8. FIND_PATH(PATH_EIGEN Eigen/Eigen PATHS ${OV_CUSTOM_DEPENDENCIES_PATH}/eigen NO_DEFAULT_PATH)
  9. IF(PATH_EIGEN)
  10. SET(EIGEN_FOUND TRUE)
  11. SET(EIGEN_INCLUDE_DIRS ${PATH_EIGEN})
  12. SET(EIGEN_CFLAGS "")
  13. #SET(EIGEN_LIBRARIES_RELEASE EIGEN)
  14. #SET(EIGEN_LIBRARIES_DEBUG EIGENd)
  15. #SET(EIGEN_LIBRARY_DIRS ${PATH_EIGEN}/lib )
  16. ENDIF(PATH_EIGEN)
  17. ENDIF(WIN32)
  18. IF(UNIX)
  19. # @FIXME remove that when an Ubuntu package will be available
  20. # Find in priority local library for eigen even if linux package has been installed
  21. # reason: package on distri Ubuntu 16.04 is still bugged (eigen 3.2.92)
  22. INCLUDE("FindPkgConfig")
  23. UNSET(PATH_EIGEN_LOCAL CACHE)
  24. FIND_PATH(PATH_EIGEN_LOCAL eigen3 PATHS "/usr/local/include" NO_DEFAULT_PATH)
  25. SET(EIGEN_FOUND FALSE)
  26. IF (PATH_EIGEN_LOCAL)
  27. SET(EIGEN_INCLUDE_DIRS "${PATH_EIGEN_LOCAL}/eigen3")
  28. SET(EIGEN_CFLAGS "-I${EIGEN_INCLUDE_DIRS}")
  29. SET(EIGEN_FOUND TRUE)
  30. ELSE()
  31. pkg_check_modules(EIGEN eigen3)
  32. ENDIF()
  33. # @FIXME uncomment that when an Ubuntu package will be available
  34. #SET(EIGEN_FOUND FALSE)
  35. #INCLUDE("FindPkgConfig")
  36. #pkg_check_modules(EIGEN eigen3)
  37. ENDIF(UNIX)
  38. IF(EIGEN_FOUND)
  39. debug_message( "Found eigen3... [${EIGEN_INCLUDE_DIRS}]")
  40. INCLUDE_DIRECTORIES("${EIGEN_INCLUDE_DIRS}")
  41. ADD_DEFINITIONS(${EIGEN_CFLAGS})
  42. ADD_DEFINITIONS(-DTARGET_HAS_ThirdPartyEIGEN)
  43. ELSE(EIGEN_FOUND)
  44. MESSAGE(WARNING " FAILED to find eigen3...")
  45. ENDIF(EIGEN_FOUND)