File: lib3mf.prf

package info (click to toggle)
openscad 2021.01-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 36,096 kB
  • sloc: cpp: 53,199; sh: 4,384; ansic: 4,382; python: 1,813; yacc: 853; javascript: 762; lex: 417; lisp: 163; xml: 127; makefile: 118
file content (58 lines) | stat: -rw-r--r-- 1,527 bytes parent folder | download | duplicates (4)
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
# Detect lib3mf, then use this priority list to determine
# which library to use:
#
# Priority
# 1. LIB3MF_INCLUDEPATH / LIB3MF_LIBPATH (env or qmake)
# 2. OPENSCAD_LIBRARIES (environment variable)
# 3. system's standard include paths

# read environment variables if not set as qmake parameter
isEmpty(LIB3MF_INCLUDEPATH) {
  LIB3MF_INCLUDEPATH = $$(LIB3MF_INCLUDEPATH)
}
isEmpty(LIB3MF_LIBPATH) {
  LIB3MF_LIBPATH = $$(LIB3MF_LIBPATH)
}

isEmpty(LIB3MF_INCLUDEPATH) {
  LIB3MF_CFLAGS = $$system("$$PKG_CONFIG --cflags lib3MF")
  LIB3MF_INCLUDEPATH = $$system("$$PKG_CONFIG --variable=includedir lib3MF")
  !isEmpty(LIB3MF_CFLAGS) {
    ENABLE_LIB3MF=yes
  }
} else {
  LIB3MF_CFLAGS = -I$$LIB3MF_INCLUDEPATH
}

isEmpty(LIB3MF_LIBPATH) {
  LIB3MF_LIBS = $$system("$$PKG_CONFIG --libs lib3MF")
  LIB3MF_LIBPATH = $$system("$$PKG_CONFIG --variable=libdir lib3MF")
  !isEmpty(LIB3MF_LIBS) {
    ENABLE_LIB3MF=yes
  }
} else {
  LIB3MF_LIBS = -L$$LIB3MF_LIBPATH -l3MF
}

exists($$LIB3MF_INCLUDEPATH/Model/COM/NMR_DLLInterfaces.h) {
  ENABLE_LIB3MF=yes
  LIB3MF_API="API 1.0"
} else:exists($$LIB3MF_INCLUDEPATH/lib3mf_implicit.hpp) {
  ENABLE_LIB3MF=yes
  LIB3MF_API="API 2.0"
  DEFINES += LIB3MF_API_2
  LIB3MF_LIBS = -L$$LIB3MF_LIBPATH -l3mf
} else {
  ENABLE_LIB3MF=
  LIB3MF_INCLUDEPATH =
  LIB3MF_LIBPATH =
}

!isEmpty(ENABLE_LIB3MF) {
  DEFINES += ENABLE_LIB3MF
  QMAKE_CXXFLAGS += $$LIB3MF_CFLAGS
  LIBS += $$LIB3MF_LIBS
  message("3MF Import/Export enabled $$LIB3MF_API")
} else {
  message("3MF Import/Export disabled")
}