File: eigen.pri

package info (click to toggle)
openscad 2015.03-2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 30,804 kB
  • ctags: 5,692
  • sloc: cpp: 39,386; sh: 3,856; ansic: 3,674; python: 1,393; yacc: 496; lex: 272; lisp: 159; makefile: 67; xml: 60
file content (60 lines) | stat: -rw-r--r-- 1,581 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Detect eigen3
#
# Priority
# 0. EIGENDIR if set
# 1. OPENSCAD_LIBRARIES eigen3
# 3. system's standard include paths for eigen3

eigen {

# read environment variables
OPENSCAD_LIBRARIES_DIR = $$(OPENSCAD_LIBRARIES)
EIGEN_DIR = $$(EIGENDIR)

# Optionally specify location of Eigen3 using the 
# OPENSCAD_LIBRARIES env. variable
!isEmpty(OPENSCAD_LIBRARIES_DIR) {
  isEmpty(EIGEN_INCLUDEPATH) {
    exists($$OPENSCAD_LIBRARIES_DIR/include/eigen3) {
      EIGEN_INCLUDEPATH = $$OPENSCAD_LIBRARIES_DIR/include/eigen3
    } 
  }
}

!isEmpty(EIGEN_DIR) { 
  EIGEN_INCLUDEPATH = $$EIGEN_DIR
  message("User set EIGEN location: $$EIGEN_INCLUDEPATH")
}

isEmpty(EIGEN_INCLUDEPATH) {
  linux*|hurd*|unix: EIGEN_INCLUDEPATH = /usr/include/eigen3
  freebsd-g++: EIGEN_INCLUDEPATH = /usr/local/include/eigen3
  netbsd*: EIGEN_INCLUDEPATH = /usr/pkg/include/eigen3
  macx: EIGEN_INCLUDEPATH = /opt/local/include/eigen3
}

!exists($$EIGEN_INCLUDEPATH/Eigen/Core) {
  EIGEN_CFLAGS = $$system("pkg-config --cflags eigen3")
  EIGEN_INCLUDEPATH = $$replace(EIGEN_CFLAGS,"-I","")
}

# disable Eigen SIMD optimizations for platforms where it breaks compilation
!macx {
  !freebsd-g++ {
    QMAKE_CXXFLAGS += -DEIGEN_DONT_ALIGN
  }
}

# EIGEN being under 'include/eigen3' needs special prepending
contains(QT_VERSION, ^5\\..*) {
  QMAKE_INCDIR = $$EIGEN_INCLUDEPATH $$QMAKE_INCDIR
} else {
  QMAKE_INCDIR_QT = $$EIGEN_INCLUDEPATH $$QMAKE_INCDIR_QT
}

# qmakespecs on netbsd prepend system includes, we need eigen first. 
netbsd* {
  QMAKE_CXXFLAGS = -I$$EIGEN_INCLUDEPATH $$QMAKE_CXXFLAGS
}

} # eigen