look for EIGENDIR env var. (also look for EIGEN2DIR for backwards compatability)

felipesanches-svg
don bright 2012-08-19 08:10:33 -05:00
parent a9045315ba
commit 5d31f56d93
5 changed files with 19 additions and 23 deletions

View File

@ -9,6 +9,5 @@ include(bison.pri)
include(cgal.pri)
include(opencsg.pri)
include(glew.pri)
include(boost.pri)
include(eigen.pri)
include(boost.pri)

View File

@ -85,7 +85,7 @@ Some versions of Xvfb may fail, however.
1. Trouble finding libraries on unix
To help CMAKE find eigen2, OpenCSG, CGAL, Boost, and GLEW, you can use
To help CMAKE find eigen, OpenCSG, CGAL, Boost, and GLEW, you can use
environment variables, just like for the main qmake & openscad.pro. Examples:
OPENSCAD_LIBRARIES=$HOME cmake .
@ -93,7 +93,7 @@ Some versions of Xvfb may fail, however.
Valid variables are as follows:
BOOSTDIR, CGALDIR, EIGEN2DIR, GLEWDIR, OPENCSGDIR, OPENSCAD_LIBRARIES
BOOSTDIR, CGALDIR, EIGENDIR, GLEWDIR, OPENCSGDIR, OPENSCAD_LIBRARIES
When running, this might help find your locally built libraries (assuming
you installed into $HOME)

View File

@ -2,18 +2,18 @@
# which eigen to use:
#
# Priority
# 3. EIGEN3DIR / EIGEN2DIR if set
# 0. EIGENDIR if set (also EIGEN2DIR for backwards compatability)
# 1. OPENSCAD_LIBRARIES eigen3
# 2. OPENSCAD_LIBRARIES eigen2
# 4. system's standard include paths for eigen3
# 5. system's standard include paths for eigen2
# 3. system's standard include paths for eigen3
# 4. system's standard include paths for eigen2
eigen {
# read environment variables
OPENSCAD_LIBRARIES_DIR = $$(OPENSCAD_LIBRARIES)
EIGEN2_DIR = $$(EIGEN2DIR)
EIGEN3_DIR = $$(EIGEN3DIR)
EIGEN_DIR = $$(EIGENDIR)
CONFIG(mingw-cross-env) {
EIGEN_INCLUDEPATH = mingw-cross-env/include/eigen2
@ -36,17 +36,14 @@ CONFIG(mingw-cross-env) {
# Optionally specify location of Eigen using the
# EIGEN3DIR env. variable
!isEmpty(EIGEN3_DIR) {
EIGEN_INCLUDEPATH = $$EIGEN3_DIR
message("EIGEN3 location: $$EIGEN3_INCLUDEPATH")
}
# Optionally specify location of Eigen using the
# EIGEN2DIR env. variable
# EIGENDIR env. variable (EIGEN2 for backwards compatability)
!isEmpty(EIGEN2_DIR) {
EIGEN_INCLUDEPATH = $$EIGEN2_DIR
message("EIGEN2 location: $$EIGEN2_INCLUDEPATH")
message("User set EIGEN location: $$EIGEN2_INCLUDEPATH")
}
!isEmpty(EIGEN_DIR) {
EIGEN_INCLUDEPATH = $$EIGEN_DIR
message("User set EIGEN location: $$EIGEN_INCLUDEPATH")
}
isEmpty(EIGEN_INCLUDEPATH) {

View File

@ -3,8 +3,7 @@
# MPFRDIR
# BOOSTDIR
# CGALDIR
# EIGEN2DIR
# EIGEN3DIR
# EIGENDIR
# GLEWDIR
# OPENCSGDIR
# OPENSCAD_LIBRARIES

View File

@ -179,18 +179,19 @@ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif()
# Priority
# 3. EIGEN3DIR / EIGEN2DIR if set
# 3. EIGENDIR if set (EIGEN2DIR for backwards compatability)
# 1. OPENSCAD_LIBRARIES eigen3
# 2. OPENSCAD_LIBRARIES eigen2
# 4. system's standard include paths for eigen3
# 5. system's standard include paths for eigen2
set(EIGEN3_DIR "$ENV{EIGEN3DIR}")
set(EIGEN2_DIR "$ENV{EIGEN2DIR}")
set(EIGEN_DIR "$ENV{EIGENDIR}")
set(OPENSCAD_LIBDIR "$ENV{OPENSCAD_LIBRARIES}")
if (EIGEN3_DIR)
find_path(EIGEN_INCLUDE_DIR Eigen/Core HINTS "${EIGEN3_DIR}/include/eigen3" "${EIGEN3_DIR}")
if (EIGEN_DIR)
set(EIGEN_HINTS "${EIGEN_DIR}/include/eigen3" "${EIGEN_DIR}/include/eigen2" "${EIGEN_DIR}")
find_path(EIGEN_INCLUDE_DIR Eigen/Core HINTS "${EIGEN_HINTS}")
endif()
if (EIGEN2_DIR)
find_path(EIGEN_INCLUDE_DIR Eigen/Core HINTS "${EIGEN2_DIR}/include/eigen2" "${EIGEN2_DIR}")