Skip to content

Commit

Permalink
look for EIGENDIR env var. (also look for EIGEN2DIR for backwards com…
Browse files Browse the repository at this point in the history
…patability)
  • Loading branch information
donbright committed Aug 19, 2012
1 parent a904531 commit 5d31f56
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 23 deletions.
3 changes: 1 addition & 2 deletions common.pri
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 2 additions & 2 deletions doc/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ 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 .
CGALDIR=$HOME/CGAL-3.9 BOOSTDIR=$HOME/boost-1.47.0 cmake .

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)
Expand Down
23 changes: 10 additions & 13 deletions eigen.pri
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand Down
3 changes: 1 addition & 2 deletions openscad.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
# MPFRDIR
# BOOSTDIR
# CGALDIR
# EIGEN2DIR
# EIGEN3DIR
# EIGENDIR
# GLEWDIR
# OPENCSGDIR
# OPENSCAD_LIBRARIES
Expand Down
9 changes: 5 additions & 4 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit 5d31f56

Please sign in to comment.