File: sofa.cfg

package info (click to toggle)
sofa-framework 1.0~beta4-9
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 88,688 kB
  • ctags: 27,205
  • sloc: cpp: 151,126; ansic: 2,387; xml: 581; sh: 417; makefile: 67
file content (634 lines) | stat: -rw-r--r-- 19,113 bytes parent folder | download | duplicates (3)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
################################################
# YOU SHOULD NOT NEED TO MODIFY ANYTHING BELOW #
################################################

# Auto-detect SOFA_DIR if not specified
isEmpty(SOFA_DIR) {
  win32 {
    SOFA_DIR = $$system(echo %CD%)
  }
  else:macx {
    SOFA_DIR = $$(PWD)
  }
  else {
    SOFA_DIR = $$system(pwd)
  }
}

DLLDESTDIR = $$SOFA_DIR/bin

# Auto-detect Qt 4.x
# The QT variable was introduced in Qt 4
#!isEmpty(QT): DEFINES += SOFA_QT4
DEFINES += SOFA_QT4

!include( sofa-local.cfg ) {
  # Copy sofa-default.cfg to sofa-local.cfg and modify it to change local options
  include( sofa-default.cfg )
}


CONFIG -= qt

# QT4: for subdirs projects, parallel makes support
CONFIG += ordered

contains(DEFINES, SOFA_QT4) {
  # qmake 4.x supports this syntax
  win32:!build_pass {
    # Force release mode when generating visual studio solutions
    CONFIGDEBUG = release
  } else:contains (CONFIG, debug, debug|release) {
    CONFIGDEBUG = debug
  } else {
#  contains (CONFIG, release, debug|release) {
    CONFIGDEBUG = release
  }
}
else {
  contains (CONFIG, debug) {
    CONFIGDEBUG = debug
  }
  contains (CONFIG, release) {
    CONFIGDEBUG = release
  }
}
contains (QMAKE_CXXFLAGS, -pg) {
  CONFIGDEBUG *= profile
}


win32{
	CONFIG -= flat # preserve directory structure in files lists

	# No support for DLL yet
	CONFIGLIBRARIES=staticlib

	#CONFIGLIBRARIES=dll
	#MSVCPROJ_LIBOPTIONS=/IMPLIB:$(TargetDir)$(TargetName).lib

	# release libs have no suffix
	LIBSUFFIX=
	
	contains (CONFIGDEBUG, debug) {
		LIBSUFFIX = d
	}

	# Config for Visual C++ 7
	win32-msvc.net{
		CONFIGPROJECT=console vc7 thread
		contains (CONFIGDEBUG, debug) {
			LIBSDIRECTORY=win32/DebugVC7
			QMAKE_LFLAGS += /NODEFAULTLIB:libcd /NODEFAULTLIB:MSVCRT	
		}
		contains (CONFIGDEBUG, release) {
			LIBSDIRECTORY=win32/ReleaseVC7
			QMAKE_LFLAGS += /NODEFAULTLIB:libc /NODEFAULTLIB:MSVCRTD
		}
		QMAKE_CXXFLAGS_DEBUG = -wd4675 -wd4250 -wd4251 -wd4275 -GR -GX -MDd # -O1 -Og -Ob2 -GA -Ot -MDd # -G7 
		QMAKE_CXXFLAGS_RELEASE = -wd4675 -wd4250 -wd4251 -wd4275 -GR -GX -Ox -Og -Ob2 -GA -Ot -MD # -G7
	}
	
	# Config for Visual C++ 8
	win32-msvc2005{
		CONFIGPROJECT=console vc7 thread
		contains (CONFIGDEBUG, debug) {
			LIBSDIRECTORY=win32/DebugVC8
			QMAKE_LFLAGS += /NODEFAULTLIB:libcd /NODEFAULTLIB:MSVCRT	
		}
		contains (CONFIGDEBUG, release) {
			LIBSDIRECTORY=win32/ReleaseVC8
			QMAKE_LFLAGS += /NODEFAULTLIB:libc /NODEFAULTLIB:MSVCRTD
		}
		QMAKE_CXXFLAGS_DEBUG = -wd4996 -wd4250 -wd4251 -wd4275 -GR -EHsc -MDd  -Od -ZI -Gm /MP # -O1 -Og -Ob2 -GA -Ot -MDd # -G7
		QMAKE_CXXFLAGS_RELEASE = -wd4996 -wd4250 -wd4251 -wd4275 -GR -EHsc -Ox -Og -Ob2 -GA -Ot -MD /MP # -G7
	}

	# Config for Visual C++ 9
	win32-msvc2008{
		CONFIGPROJECT=console vc7 thread
		contains (CONFIGDEBUG, debug) {
			LIBSDIRECTORY=win32/DebugVC9
			QMAKE_LFLAGS += /NODEFAULTLIB:libcd /NODEFAULTLIB:MSVCRT	
		}
		contains (CONFIGDEBUG, release) {
			LIBSDIRECTORY=win32/ReleaseVC9
			QMAKE_LFLAGS += /NODEFAULTLIB:libc /NODEFAULTLIB:MSVCRTD
		}
		QMAKE_CXXFLAGS_DEBUG = -wd4996 -wd4250 -wd4251 -wd4275 -GR -EHsc -MDd  -Od -ZI -Gm # -O1 -Og -Ob2 -GA -Ot -MDd /MP # -G7 
		QMAKE_CXXFLAGS_RELEASE = -wd4996 -wd4250 -wd4251 -wd4275 -GR -EHsc -Ox -Og -Ob2 -GA -Ot -MD /MP # -G7
	}


	
	# Config for MinGW
	win32-g++{
		CONFIGPROJECT=console thread
		LIBSDIRECTORY=win32/gcc
	}

	INCLUDEPATH *= $$SOFA_DIR/include/win32
}
unix {
	macx {
		QMAKE_MACOSX_DEPLOYMENT_TARGET=10.5
		QMAKE_LFLAGS += -L/System/Library/Frameworks/
		
		LIBSDIRECTORY=macx

#		CONFIGLIBRARIES=staticlib 
		CONFIGLIBRARIES=dynamiclib
		QMAKE_LFLAGS_SONAME = -install_name$${LITERAL_WHITESPACE}@rpath/
		QMAKE_LFLAGS += -Wl,-rpath,@loader_path
		QMAKE_LFLAGS += -Wl,-rpath,@executable_path/../lib/macx
		QMAKE_LFLAGS += -Wl,-rpath,@executable_path/../../../../lib/macx

		contains (CONFIGDEBUG, debug) {
			LIBSUFFIX = d
		}

		BUNDLE_RESOURCES_SHADERS.path = Contents/Resources/shaders
#		BUNDLE_RESOURCES_SHADERS.files = $$SOFA_DIR/share/shaders/*
		BUNDLE_RESOURCES_SHADERS.files = $$system(ls share/shaders)
		BUNDLE_RESOURCES_SHADERS.files = $$join(BUNDLE_RESOURCES_SHADERS.files,' $$SOFA_DIR/share/shaders/','$$SOFA_DIR/share/shaders/','')
		APP_BUNDLE_DATA += BUNDLE_RESOURCES_SHADERS
		BUNDLE_RESOURCES_TEXTURES.path = Contents/Resources/textures
#		BUNDLE_RESOURCES_TEXTURES.files = $$SOFA_DIR/share/textures/*
		BUNDLE_RESOURCES_TEXTURES.files = share/textures/SOFA_logo.bmp $$system(ls share/textures/media*)
		BUNDLE_RESOURCES_TEXTURES.files = $$join(BUNDLE_RESOURCES_TEXTURES.files,' $$SOFA_DIR/','$$SOFA_DIR/','')
		APP_BUNDLE_DATA += BUNDLE_RESOURCES_TEXTURES
	}
 	
	!macx {
		LIBSDIRECTORY=linux

		# Use shared library unless we are profiling the code
		contains (CONFIGDEBUG, profile) {
			CONFIGLIBRARIES=staticlib
		}
		else {
			CONFIGLIBRARIES=dynamiclib
		}

		contains (CONFIGDEBUG, debug) {
			LIBSUFFIX = d
		}

		# Check that all symbols are resolved when building shared libraries
		#QMAKE_LFLAGS *= -Wl,--no-allow-shlib-undefined
		QMAKE_LFLAGS *= -Wl,-z,defs
	}
}



!contains (CONFIGDEBUG, debug) {
	DEFINES += NDEBUG
}

contains (CONFIGDEBUG, debug) {
	SUFFIX = d
}

contains (QMAKE_CXXFLAGS, -pg) {
	SUFFIX = $${SUFFIX}p
	LIBSUFFIX = $${LIBSUFFIX}
}

OBJECTS_DIR = OBJ/$$join(CONFIGDEBUG,,,)

CONFIGLIBRARIES+= \
                  stl \
                  rtti \
                  thread

CONFIGPROJECTGUI = $$CONFIGPROJECT
CONFIGPROJECTCMD = $$CONFIGPROJECT
CONFIGPROJECTCMD += console

INCLUDEPATH *= \
               $$SOFA_DIR/include \
               $$SOFA_DIR/framework \
               $$SOFA_DIR/modules \
               $$SOFA_DIR/applications \
               /usr/include/qt4 \
               /usr/include/qwt-qt4



DEPENDPATH  *= \
               $$SOFA_DIR/framework \
               $$SOFA_DIR/modules \
               $$SOFA_DIR/applications

QMAKE_LIBDIR = $$SOFA_DIR/lib/$$LIBSDIRECTORY 

!macx: QMAKE_LIBDIR += $$SOFA_DIR/lib/$$LIBSDIRECTORY/../Common

win32-gcc: QMAKE_LIBDIR += $$SOFA_DIR/bin

# List of libs to link with



win32 {
	SOFA_EXT_LIBS *= -lglut32 -lcomctl32 -lopengl32 -lglu32 -lAdvAPI32 -lUser32 -lShell32 -lGdi32 -lWSock32 -lWS2_32 -lOle32
}

unix {
	macx : SOFA_EXT_LIBS += -lpthread -framework OpenGL -framework GLUT
	!macx : SOFA_EXT_LIBS *= -L/usr/X11R6/lib -lglut -lGL -lGLU -lpthread -lX11
}

########################################################################
#  BOOST
########################################################################
contains(DEFINES,SOFA_HAVE_BOOST){
  SOFA_EXT_LIBS *= -lboost_thread
}else{
  # use miniBoost headers included in extlibs
  INCLUDEPATH *= $$SOFA_DIR/extlibs/miniBoost
}

########################################################################
#  CSPARSE
########################################################################
contains(DEFINES,SOFA_HAVE_CSPARSE){
  SOFA_EXT_LIBS *= -lcsparse
  # use csparse headers included in extlibs
  # INCLUDEPATH *= $$SOFA_DIR/extlibs/csparse
}

########################################################################
#  TinyXML (default parser)
########################################################################

!contains(DEFINES,SOFA_XML_PARSER_LIBXML){
  DEFINES *= SOFA_XML_PARSER_TINYXML
}

contains(DEFINES,SOFA_XML_PARSER_TINYXML){
#  DEFINES *= TIXML_USE_STL
  SOFA_EXT_LIBS += -ltinyxml$$LIBSUFFIX
#  INCLUDEPATH *= $$SOFA_DIR/extlibs/tinyxml
}

########################################################################
#  LibXML
########################################################################

# If PML is active, we need to include libxml even if it is not the active parser in SOFA
!contains(DEFINES,SOFA_PML):!contains(DEFINES,SOFA_XML_PARSER_LIBXML){
}
else{
  win32 {
    SOFA_EXT_LIBS *= -llibxml2 
  }
  unix {
    # Use xml2-config if available to get options for libxml2
    QMAKE_CXXFLAGS *= $$system(xml2-config --cflags 2>/dev/null || echo '-I/usr/include/libxml2')
    SOFA_EXT_LIBS *=  $$system(xml2-config --libs 2>/dev/null || echo '-lxml2 -lz')
    # TODO: in which case the following is still necessary ?
    INCLUDEPATH *= /usr/include/libxml2
  }
}

########################################################################
#  LAPACK
########################################################################
#You need to install Lapackpp: http://sourceforge.net/projects/lapackpp/
contains(DEFINES,SOFA_HAVE_LAPACK){
  win32 {
	INCLUDEPATH *= $$SOFA_DIR/include/lapackpp-2.5.2
 	SOFA_EXT_LIBS *= -llibblas32 -lliblapack32 -llapackpp 
  }else{
	INCLUDEPATH *= /usr/local/include/lapackpp
        QMAKE_LIBDIR += /usr/local/lib
 	SOFA_EXT_LIBS *= -llapackpp -llapack -lblas 
  } 
}

########################################################################
#  LibPNG
########################################################################
contains(DEFINES,SOFA_HAVE_PNG){
	win32 {
		SOFA_EXT_LIBS *= -llibpng -lzlib
	}
	unix {
		macx : SOFA_EXT_LIBS *= -lpng -lz 
		!macx : SOFA_EXT_LIBS *= -lpng -lz 
	}
}

########################################################################
#  NewMAT
########################################################################

#INCLUDEPATH *= $$SOFA_DIR/extlibs/newmat
SOFA_EXT_LIBS *=  -lnewmat

########################################################################
#  METIS
########################################################################

contains(DEFINES,SOFA_HAVE_METIS){
	SOFA_EXT_LIBS *= -lmetis
}


########################################################################
#  TAUCS
########################################################################

contains(DEFINES,SOFA_HAVE_TAUCS){
	SOFA_EXT_LIBS *= -ltaucs
}


########################################################################
#  GLEW
########################################################################
contains(DEFINES,SOFA_HAVE_GLEW){
	win32 {
		SOFA_EXT_LIBS *= -lglew32
	}
	unix {
		macx : SOFA_EXT_LIBS *= -lGLEW
		!macx : SOFA_EXT_LIBS *= -lGLEW
	}
}

########################################################################
# GLUT
########################################################################
contains (DEFINES, SOFA_GUI_GLUT) {
	SOFA_GUI_LIBS *= -lsofaguiglut$$LIBSUFFIX
}


########################################################################
# QT
########################################################################
contains (DEFINES, SOFA_GUI_QTVIEWER) {
	SOFA_GUI_LIBS *= -lsofaguiqt$$LIBSUFFIX
	macx: SOFA_GUI_EXT_LIBS += -framework QtCore -framework QtXml -framework QtSql -framework QtNetwork
	CONFIGPROJECTGUI += qt
	contains (DEFINES, SOFA_QT4) {	
	  QT += opengl qt3support
	}
	else {	
	  QT += opengl	
	}
#	INCLUDEPATH += $$SOFA_DIR/extlibs/qwt
#       SOFA_GUI_EXT_LIBS *= -lqwt
	SOFA_GUI_EXT_LIBS *= -lqwt-qt4
}

########################################################################
# QGLVIEWER
########################################################################
contains (DEFINES, SOFA_GUI_QGLVIEWER) {
	SOFA_GUI_LIBS *= -lsofaguiqt$$LIBSUFFIX
	macx: {
		SOFA_GUI_LIBS += -framework QtXml -framework QtSql -framework QtNetwork
#		INCLUDEPATH += /Library/Frameworks/QtXml.framework/Versions/4/Headers 
	}
	CONFIGPROJECTGUI += qt
	
	contains (DEFINES, SOFA_QT4) {	
	  QT += opengl qt3support
	}
	else {
	  QT += opengl	
	}
	unix:SOFA_GUI_EXT_LIBS *= -lqglviewer-qt4$${LIBSUFFIX}
	win32:SOFA_GUI_EXT_LIBS *= -lQGLViewer2$${LIBSUFFIX}
	INCLUDEPATH += /usr/include/qglviewer-qt4
	SOFA_GUI_EXT_LIBS *= -lqwt-qt4
}

########################################################################
# QTOGREVIEWER
########################################################################
contains (DEFINES, SOFA_GUI_QTOGREVIEWER) {
	SOFA_GUI_LIBS *= -lsofaguiqt$$LIBSUFFIX
	macx: {
		SOFA_GUI_EXT_LIBS += -framework Ogre -framework CoreFoundation
		INCLUDEPATH += /Library/Frameworks/Ogre.framework/Headers/
	}

	CONFIGPROJECTGUI += qt

	contains (DEFINES, SOFA_QT4) {
	  QT += opengl qt3support
	}
	else {
	  QT += opengl
	}

	win32 {
		INCLUDEPATH += $(OGRE_HOME)/include
		QMAKE_LIBDIR += $(OGRE_HOME)/lib
		LIBS += OgreMain.lib  
	}
#	INCLUDEPATH += $$SOFA_DIR/extlibs/qwt
	SOFA_GUI_EXT_LIBS *= -lqwt-qt4

	unix {
		macx:  QMAKE_CXXFLAGS += -Wno-unused
		
		!macx: {
                  	 QMAKE_CXXFLAGS += $$system(pkg-config --cflags OGRE )
		  LIBS += $$system(pkg-config --libs OGRE )
                }
	}        
}

########################################################################
# PML
########################################################################
contains(DEFINES,SOFA_PML){
	INCLUDEPATH += $$SOFA_DIR/extlibs/PML
	INCLUDEPATH += $$SOFA_DIR/extlibs/PML/PhysicalProperties
	INCLUDEPATH += $$SOFA_DIR/extlibs/LML
	SOFA_EXT_LIBS *= -lphysicalmodel$$LIBSUFFIX -lload$$LIBSUFFIX
	SOFA_MODULES_LIBS *= -lsofapml$$LIBSUFFIX
}

########################################################################
# CUDA
########################################################################
contains (DEFINES, SOFA_GPU_CUDA) {
	SOFA_MODULES_LIBS *= -lsofagpucuda$$LIBSUFFIX
	SOFA_EXT_LIBS *= -lcudart
	cuda.input = CUDA_SOURCES
	QMAKE_EXTRA_UNIX_COMPILERS *= cuda
	win32 {
		INCLUDEPATH += $(CUDA_INC_PATH)
		QMAKE_LIBDIR += $(CUDA_LIB_PATH)
		SOFA_EXT_LIBS *= -lcudart
		contains(CUDA_FLAGS,--device-emulation) {
			cuda.output = $${OBJECTS_DIR}/${QMAKE_FILE_BASE}_cudaemu.obj
			cuda.clean = $${OBJECTS_DIR}/${QMAKE_FILE_BASE}_cudaemu.obj
		}
		else {
			cuda.output = $${OBJECTS_DIR}/${QMAKE_FILE_BASE}_cuda.obj
			cuda.clean = $${OBJECTS_DIR}/${QMAKE_FILE_BASE}_cuda.obj
		}
		cuda.commands = $$(CUDA_BIN_PATH)/nvcc.exe -c $$CUDA_FLAGS -Xcompiler -nologo $${join(INCLUDEPATH,'" -I "','-I "','"')} $${join(DEFINES," -D","-D",)} ${QMAKE_FILE_NAME} -o ${QMAKE_FILE_OUT}
		cuda.dependency_type = TYPE_C
	}
	unix {
		# auto-detect CUDA path
		CUDA_DIR = $${system(which nvcc | sed 's,/bin/nvcc$,,')}
		INCLUDEPATH += $${CUDA_DIR}/include
		QMAKE_LIBDIR += $${CUDA_DIR}/lib
		SOFA_EXT_LIBS *= -lcudart
		macx: QMAKE_LFLAGS += -Wl,-rpath,$${CUDA_DIR}/lib
		contains(CUDA_FLAGS,--device-emulation) {
			cuda.output = ${OBJECTS_DIR}${QMAKE_FILE_BASE}_cudaemu.obj
			cuda.clean = ${OBJECTS_DIR}${QMAKE_FILE_BASE}_cudaemu.obj
		}
		else {
			cuda.output = ${OBJECTS_DIR}${QMAKE_FILE_BASE}_cuda.obj
			cuda.clean = ${OBJECTS_DIR}${QMAKE_FILE_BASE}_cuda.obj
		}
		cuda.commands = nvcc -c $$CUDA_FLAGS -Xcompiler -fPIC,$${join(QMAKE_CXXFLAGS_RELEASE,",")}  $${join(DEFINES," -D","-D")} $(INCPATH) ${QMAKE_FILE_NAME} -o ${QMAKE_FILE_OUT}
		cuda.dependency_type = TYPE_C
		macx: cuda.commands += --host-compilation 'C'
	}
}


########################################################################
#  FLOWVR
########################################################################
contains(DEFINES,SOFA_HAVE_FLOWVR){
	FLOWVR = $(FLOWVR_PREFIX)
	QMAKE_CXXFLAGS += `pkg-config --cflags flowvr-mod flowvr-ftl flowvr-render`
	QMAKE_LDFLAGS += `pkg-config --libs flowvr-mod flowvr-ftl flowvr-render`
	QMAKE_LFLAGS_DEBUG+= `pkg-config --libs flowvr-mod flowvr-ftl flowvr-render`
	QMAKE_LFLAGS_RELEASE+= `pkg-config --libs flowvr-mod flowvr-ftl flowvr-render`
}
else {
	SOFA_EXT_LIBS += -lminiFlowVR$$LIBSUFFIX
	INCLUDEPATH *= $$SOFA_DIR/extlibs/miniFlowVR/include
	DEFINES *= MINI_FLOWVR
}

########################################################################
#  MKL
########################################################################
contains(DEFINES,SOFA_HAVE_MKL){
	INCLUDEPATH += $$SOFA_DIR/extlibs/MKL
	INCLUDEPATH += "$$MKL_PATH/include"
	QMAKE_LIBDIR += "$$MKL_PATH/ia32/lib"
	SOFA_EXT_LIBS *= -lmkl_c -lmkl_lapack -llibguide40
}

########################################################################
#  SENSABLE PHANTOM
########################################################################
contains(DEFINES,SOFA_HAVE_SENSABLE){
win32{
#  3DTOUCH_BASE = C:\Program Files\SensAble\3DTouch
  INCLUDEPATH += $(3DTOUCH_BASE)/include
  INCLUDEPATH += $(3DTOUCH_BASE)/utilities/include
  SOFA_EXT_LIBS += -lhd -lhdu -lhl
  QMAKE_LIBDIR += $(3DTOUCH_BASE)/lib/win32/
  contains (CONFIGDEBUG, debug) {
    QMAKE_LIBDIR += $(3DTOUCH_BASE)/utilities/lib/Win32/Debug/
  }
  else {
    QMAKE_LIBDIR += $(3DTOUCH_BASE)/utilities/lib/Win32/Release/
  }
}
unix{
  SOFA_EXT_LIBS += -lHL -lHD -lHLU -lHDU -lPHANToMIO
}
}


########################################################################
#  OGRE 3D
########################################################################

contains( DEFINES, SOFA_GUI_QTOGREVIEWER){
	win32 {
		INCLUDEPATH += $(OGRE_HOME)/include
		QMAKE_LIBDIR += $(OGRE_HOME)/lib
		LIBS += OgreMain.lib
	}

	unix {
		macx:  QMAKE_CXXFLAGS += -Wno-unused
		
		!macx: {
                  	 QMAKE_CXXFLAGS += $$system(pkg-config --cflags OGRE )
		  LIBS += $$system(pkg-config --libs OGRE )
		  #CONFIG += link_pkgconfig
		  #PKGCONFIG += OGRE
		  #PKGCONFIG += CEGUI
		  #PKGCONFIG += OIS
                }
	}
      
}


########################################################################

SOFA_FRAMEWORK_LIBS *= -lsofahelper$$LIBSUFFIX -lsofadefaulttype$$LIBSUFFIX -lsofacore$$LIBSUFFIX

SOFA_COMPONENTS_LIBS = -lsofacomponentmastersolver$$LIBSUFFIX
SOFA_COMPONENTS_LIBS += -lsofacomponentfem$$LIBSUFFIX
SOFA_COMPONENTS_LIBS += -lsofacomponentinteractionforcefield$$LIBSUFFIX
SOFA_COMPONENTS_LIBS += -lsofacomponentcontextobject$$LIBSUFFIX
SOFA_COMPONENTS_LIBS += -lsofacomponentbehaviormodel$$LIBSUFFIX
SOFA_COMPONENTS_LIBS += -lsofacomponentengine$$LIBSUFFIX
SOFA_COMPONENTS_LIBS += -lsofacomponentlinearsolver$$LIBSUFFIX
SOFA_COMPONENTS_LIBS += -lsofacomponentodesolver$$LIBSUFFIX
SOFA_COMPONENTS_LIBS += -lsofacomponentbase$$LIBSUFFIX
SOFA_COMPONENTS_LIBS += -lsofacomponentcontroller$$LIBSUFFIX
SOFA_COMPONENTS_LIBS += -lsofacomponentvisualmodel$$LIBSUFFIX
SOFA_COMPONENTS_LIBS += -lsofacomponentmass$$LIBSUFFIX
SOFA_COMPONENTS_LIBS += -lsofacomponentforcefield$$LIBSUFFIX
SOFA_COMPONENTS_LIBS += -lsofacomponentmapping$$LIBSUFFIX
SOFA_COMPONENTS_LIBS += -lsofacomponentconstraint$$LIBSUFFIX
SOFA_COMPONENTS_LIBS += -lsofacomponentcollision$$LIBSUFFIX
SOFA_COMPONENTS_LIBS += -lsofacomponentmisc$$LIBSUFFIX

#SOFA_MODULES_LIBS *= $$SOFA_COMPONENTS_LIBS  -lsofasimulation$$LIBSUFFIX -lsofatree$$LIBSUFFIX
SOFA_MODULES_LIBS *= $$SOFA_COMPONENTS_LIBS -lsofacomponent$$LIBSUFFIX -lsofasimulation$$LIBSUFFIX -lsofatree$$LIBSUFFIX


SOFA_GUI_LIBS *= -lsofagui$$LIBSUFFIX -lsofaguimain$$LIBSUFFIX

# for binutils-gold
SOFA_EXTRA_LIBS += -ldl

# When using staticlib, rebuild applications if a library has changed
contains(CONFIGLIBRARIES,staticlib){
contains(TEMPLATE,app){
	SLIBS = $$SOFA_FRAMEWORK_LIBS $$SOFA_MODULES_LIBS $$SOFA_GUI_LIBS
	win32 {
		win32-g++ {
			SLIBS ~= s|-l(.*)|$${SOFA_DIR}/lib/$${LIBSDIRECTORY}/lib\1.a|g
		} else {
			SLIBS ~= s|-l(.*)|$${SOFA_DIR}/lib/$${LIBSDIRECTORY}/\1.lib|g
		}
	}
	unix {
		SLIBS ~= s|-l(.*)|$${SOFA_DIR}/lib/$${LIBSDIRECTORY}/lib\1.a|g
	}
	POST_TARGETDEPS += $$SLIBS
}
}

SOFA_LIBS = $${SOFA_MODULES_LIBS} $${SOFA_MODULES_LIBS} $${SOFA_FRAMEWORK_LIBS} $${SOFA_FRAMEWORK_LIBS} $${SOFA_EXT_LIBS} $${SOFA_EXTRA_LIBS}

SOFA_GUI_LIBS += $${SOFA_GUI_EXT_LIBS}

# default destination 
DESTDIR = $${SOFA_DIR}/lib/$${LIBSDIRECTORY}