QGLViewer.pro 8.04 KB
Newer Older
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
#		    l i b Q G L V i e w e r
#	C o m p i l a t i o n    c o n f i g u r a t i o n

# Run "qmake; make; make install" to compile and install the library on Unix systems.
# Optional arguments can tune install paths (as in "qmake PREFIX=$HOME"). See doc/download.html for details.

TEMPLATE = lib
TARGET = QGLViewer
VERSION = 2.6.1
CONFIG *= qt opengl warn_on shared thread create_prl rtti no_keywords

QGL_HEADERS = qglviewer.h \
	  camera.h \
	  manipulatedFrame.h \
	  manipulatedCameraFrame.h \
	  frame.h \
	  constraint.h \
	  keyFrameInterpolator.h \
	  mouseGrabber.h \
	  quaternion.h \
	  vec.h \
	  domUtils.h \
	  config.h

SOURCES = qglviewer.cpp \
	  camera.cpp \
	  manipulatedFrame.cpp \
	  manipulatedCameraFrame.cpp \
	  frame.cpp \
	  saveSnapshot.cpp \
	  constraint.cpp \
	  keyFrameInterpolator.cpp \
	  mouseGrabber.cpp \
	  quaternion.cpp \
	  vec.cpp

HEADERS *= $${QGL_HEADERS}
DISTFILES *= qglviewer-icon.xpm

TRANSLATIONS = qglviewer_fr.ts

QT *= xml opengl

contains ( $$[QT_VERSION], "^5.*" ) {
	QT *= gui widgets
}

!isEmpty( QGLVIEWER_STATIC ) {
  CONFIG *= staticlib
}

# -----------------------------------
# --  I m a g e I n t e r f a c e  --
# -----------------------------------
FORMS *= ImageInterface.ui

# ---------------------------------------------
# --  V e c t o r i a l   R e n d e r i n g  --
# ---------------------------------------------
# In case of compilation troubles with vectorial rendering, uncomment this line
# DEFINES *= NO_VECTORIAL_RENDER

contains( DEFINES, NO_VECTORIAL_RENDER ) {
  message( Vectorial rendering disabled )
} else {
  FORMS *= VRenderInterface.ui

  SOURCES *= \
	VRender/BackFaceCullingOptimizer.cpp \
	VRender/BSPSortMethod.cpp \
	VRender/EPSExporter.cpp \
	VRender/Exporter.cpp \
	VRender/FIGExporter.cpp \
	VRender/gpc.cpp \
	VRender/ParserGL.cpp \
	VRender/Primitive.cpp \
	VRender/PrimitivePositioning.cpp \
	VRender/TopologicalSortMethod.cpp \
	VRender/VisibilityOptimizer.cpp \
	VRender/Vector2.cpp \
	VRender/Vector3.cpp \
	VRender/NVector3.cpp \
	VRender/VRender.cpp

  VRENDER_HEADERS = \
	VRender/AxisAlignedBox.h \
	VRender/Exporter.h \
	VRender/gpc.h \
	VRender/NVector3.h \
	VRender/Optimizer.h \
	VRender/ParserGL.h \
	VRender/Primitive.h \
	VRender/PrimitivePositioning.h \
	VRender/SortMethod.h \
	VRender/Types.h \
	VRender/Vector2.h \
	VRender/Vector3.h \
	VRender/VRender.h

  HEADERS *= $${VRENDER_HEADERS}
}




# ---------------
# --  U n i x  --
# ---------------
unix {
  CONFIG -= debug debug_and_release
  CONFIG *= release

  # INCLUDE_DIR and LIB_DIR specify where to install the include files and the library.
  # Use qmake INCLUDE_DIR=... LIB_DIR=... , or qmake PREFIX=... to customize your installation.

  HOME_DIR = $$system(cd;pwd)

  isEmpty( PREFIX ) {
	PREFIX_=/usr
  } else {
	PREFIX_=$${PREFIX}
  }
  isEmpty( LIB_DIR ) {
	LIB_DIR_ = $${PREFIX_}/lib
  } else {
	LIB_DIR_ = $${LIB_DIR}
  }
  isEmpty( INCLUDE_DIR ) {
	INCLUDE_DIR_ = $${PREFIX_}/include
  } else {
	INCLUDE_DIR_ = $${INCLUDE_DIR}
  }
  isEmpty( DOC_DIR ) {
	macx|darwin-g++ {
	  isEmpty( PREFIX ) {
		DOC_DIR = $${HOME_DIR}/Library/Developer/Shared/Documentation/QGLViewer
	  } else {
		DOC_DIR = $${PREFIX}/Shared/Documentation/QGLViewer
	  }
	} else {
	  DOC_DIR = $${PREFIX_}/share/doc/QGLViewer
	}
  }

  # GLUT for Unix architecture
  !isEmpty( USE_GLUT ) {
	QMAKE_LIBS_OPENGL *= -lglut
  }

  macx|darwin-g++ {
  	# GLU is part of the OpenGL framework
  } else {
  	QMAKE_LIBS_OPENGL *= -lGLU
  }

  MOC_DIR = .moc
  OBJECTS_DIR = .obj

  # Adds a -P option so that "make install" as root creates files owned by root and links are preserved.
  # This is not a standard option, and it may have to be removed on old Unix flavors.
  !hpux {
	QMAKE_COPY_FILE = $${QMAKE_COPY_FILE} -P
  }

  # Make much smaller libraries (and packages) by removing debugging informations
  QMAKE_CFLAGS_RELEASE -= -g
  QMAKE_CXXFLAGS_RELEASE -= -g

  # install header
  include.path = $${INCLUDE_DIR_}/QGLViewer
  # Should be $$replace(TRANSLATIONS, .ts, .qm), but 'replace' only appeared in Qt 4.3
  include.files = $${QGL_HEADERS} qglviewer_fr.qm

  # install documentation html
  documentation.path = $${DOC_DIR}
  documentation.files = ../doc/*.html ../doc/*.css  ../doc/*.qch

  # install documentation images
  docImages.path = $${DOC_DIR}/images
  docImages.files = ../doc/images/*

  # install documentation examples
  #docExamples.path = $${DOC_DIR}/examples
  #docExamples.files = ../examples/*../examples/*/*

  # install documentation refManual
  docRefManual.path = $${DOC_DIR}/refManual
  docRefManual.files = ../doc/refManual/*

  # install static library
  #staticlib.extra = make -f Makefile.Release staticlib
  #staticlib.path = $${LIB_DIR_}
  #staticlib.files = lib$${TARGET}.a

  # install library
  target.path = $${LIB_DIR_}

  # "make install" configuration options
  INSTALLS *= target include documentation docImages docRefManual
}


# -----------------------
# --  S G I   I r i x  --
# -----------------------
irix-cc|irix-n32 {
  QMAKE_CFLAGS_RELEASE   -= -O3 -O2 -OPT:Olimit=30000
  QMAKE_LFLAGS_RELEASE   -= -O3 -O2 -OPT:Olimit=30000
  QMAKE_CXXFLAGS_RELEASE -= -O3 -O2 -OPT:Olimit=30000
  QMAKE_CFLAGS_RELEASE   *= -IPA -Ofast=IP35
  QMAKE_LFLAGS_RELEASE   *= -IPA -Ofast=IP35
  QMAKE_CXXFLAGS_RELEASE *= -IPA -Ofast=IP35
  QMAKE_CFLAGS           *= -LANG:std
  QMAKE_LFLAGS           *= -LANG:std
  QMAKE_CXXFLAGS         *= -LANG:std
  QMAKE_CFLAGS           *= -woff 1424,3201,1110,1188
  QMAKE_CXXFLAGS         *= -woff 1424,3201,1110,1188
  QMAKE_LIBS_OPENGL      -= -lXi
  # GLUT for SGI architecture
  !isEmpty( USE_GLUT ) {
	QMAKE_LIBDIR_OPENGL    *= /usr/local/lib32
	QMAKE_INCDIR_OPENGL    *= /usr/local/include
  }
}


# -------------------
# --  M a c O S X  --
# -------------------
macx|darwin-g++ {
  # This setting creates a Mac framework. Comment out this line to create a dylib instead.
  !staticlib: CONFIG *= lib_bundle

  include.files *= qglviewer.icns

  lib_bundle {
	FRAMEWORK_HEADERS.version = Versions
	# Should be $$replace(TRANSLATIONS, .ts, .qm), but 'replace' is only available in Qt 4.3
	FRAMEWORK_HEADERS.files = $${QGL_HEADERS} qglviewer.icns qglviewer_fr.qm
	FRAMEWORK_HEADERS.path = Headers
	QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS

	DESTDIR = $${HOME_DIR}/Library/Frameworks/

	# For a Framework, 'include' and 'lib' do no make sense.
	# These and prefix will all define the DESTDIR, in that order in case several are defined
	!isEmpty( INCLUDE_DIR ) {
	  DESTDIR = $${INCLUDE_DIR}
	}

	!isEmpty( LIB_DIR ) {
	  DESTDIR = $${LIB_DIR}
	}

	!isEmpty( PREFIX ) {
	  DESTDIR = $${PREFIX}
	}

	QMAKE_POST_LINK=cd $$DESTDIR/QGLViewer.framework/Headers && (test -L QGLViewer || ln -s . QGLViewer)

	#QMAKE_LFLAGS_SONAME  = -Wl,-install_name,@executable_path/../Frameworks/
	#QMAKE_LFLAGS_SONAME  = -Wl,-install_name,

	# Framework already installed, with includes
	INSTALLS -= include target
  } else {
	#QMAKE_LFLAGS_SONAME  = -Wl,-install_name,libQGLViewer.dylib
  }

  # GLUT for Macintosh architecture
  !isEmpty( USE_GLUT ) {
	QMAKE_LIBS_OPENGL -= -lglut
	QMAKE_LIBS_OPENGL *= -framework GLUT -lobjc
  }
}


# ---------------------
# --  W i n d o w s  --
# ---------------------
win32 {
  # Windows requires a debug lib version to link against debug applications
  CONFIG *= debug_and_release build_all

  # Needed by Intel C++, (icl.exe) so that WINGDIAPI is a defined symbol in gl.h.
  DEFINES *= WIN32

  staticlib {
	DEFINES *= QGLVIEWER_STATIC
  } else {
	DEFINES *= CREATE_QGLVIEWER_DLL
  }

  CONFIG *= embed_manifest_dll

  # TP : C++ source code
  # GR : Enables run-time type information (RTTI).
  # Zi : Generates complete debugging information (removed)
  # EHs : The exception-handling model that catches C++ exceptions only and tells the
  #       compiler to assume that functions declared as extern "C" may throw an exception.
  # FS : Enable parallel compilation
  # Any feedback on these flags is welcome.
  !win32-g++ {
	QMAKE_CXXFLAGS *= -TP -GR
	DEFINES += NOMINMAX
	win32-msvc {
	  QMAKE_CXXFLAGS *= -EH -FS
	} else {
	  QMAKE_CXXFLAGS *= -EHs
	}
  }
}


build_pass:CONFIG(debug, debug|release) {
  unix: TARGET = $$join(TARGET,,,_debug)
  else: TARGET = $$join(TARGET,,,d)
}