1# - Include the VR Juggler runtime files in an installation or built package.
2#
3#  VRJUGGLERRUNTIME_BUNDLE
4#  VRJUGGLERRUNTIME_BUNDLE_DEBUG - set to yes to include debug dll's as well
5#
6# Requires these CMake modules:
7#  FindVRJuggler22 and its dependencies
8#
9# Original Author:
10# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
11# http://academic.cleardefinition.com
12# Iowa State University HCI Graduate Program/VRAC
13#
14# Copyright Iowa State University 2009-2010.
15# Distributed under the Boost Software License, Version 1.0.
16# (See accompanying file LICENSE_1_0.txt or copy at
17# http://www.boost.org/LICENSE_1_0.txt)
18
19if(WIN32)
20	option(VRJUGGLERRUNTIME_BUNDLE
21		"Install a local copy of the VR Juggler runtime files with the project."
22		on)
23	option(VRJUGGLERRUNTIME_BUNDLE_DEBUG
24		"Install the VR Juggler debug runtime files as well."
25		off)
26	mark_as_advanced(VRJUGGLERRUNTIME_BUNDLE_DEBUG)
27else()
28	# TODO - how to handle when not on Windows?
29	#option(VRJUGGLERRUNTIME_BUNDLE "Install a local copy of the VR Juggler runtime files with the project." off)
30endif()
31
32mark_as_advanced(VRJUGGLERRUNTIME_BUNDLE VRJUGGLERRUNTIME_BUNDLE_DEBUG)
33
34if(VRJUGGLERRUNTIME_BUNDLE AND VRJUGGLER22_FOUND)
35	if(WIN32)
36		get_filename_component(_vrjlibdir "${VRJ22_LIBRARY_RELEASE}" PATH)
37		get_filename_component(_vrjroot "${_vrjlibdir}/../" ABSOLUTE)
38
39		# TODO - make sure gadgeteer and sonix can find their DSO's at runtime...
40
41		foreach(_dir bin lib)
42			if(VRJUGGLERRUNTIME_BUNDLE_DEBUG)
43				install(DIRECTORY "${_vrjroot}/${_dir}/"
44						DESTINATION bin
45						PATTERN "*.lib" EXCLUDE		# exclude static and link libraries
46						PATTERN "*.exe" EXCLUDE		# exclude unneeded executables
47						PATTERN "*.py" EXCLUDE		# exclude unneeded python executables
48						PATTERN "*.pyc" EXCLUDE		# exclude unneeded python executables
49				)
50			else()
51				install(DIRECTORY ${_vrjroot}/${_dir}/
52						DESTINATION bin
53						PATTERN "*.lib" EXCLUDE		# exclude static and link libraries
54						PATTERN "*.exe" EXCLUDE		# exclude unneeded executables
55						PATTERN "*.py" EXCLUDE		# exclude unneeded python executables
56						PATTERN "*.pyc" EXCLUDE		# exclude unneeded python executables
57
58						PATTERN "*d.dll" EXCLUDE	# exclude debug dll's
59						PATTERN "*-gd-*.dll" EXCLUDE	# exclude Boost debug dll's
60				)
61			endif()
62
63		endforeach()
64
65		install(DIRECTORY ${_vrjroot}/share/
66				DESTINATION share
67				FILES_MATCHING
68
69				# Runtime files
70				PATTERN "*.dll"
71				PATTERN "*.jar"
72
73				# Data files
74				PATTERN "*.wav"
75				PATTERN "*.xml"
76				PATTERN "*.xsl"
77				PATTERN "*.xsd"
78				PATTERN "*.flt"
79				PATTERN "*.dat"
80				PATTERN "*.table"
81
82
83				# Config files
84				PATTERN "*.jdef"
85				PATTERN "*.jconf"
86				PATTERN "*.cfg"
87				PATTERN "hosts.allow"
88
89				# Other Files
90				PATTERN "*.txt"
91				PATTERN "COPYING*"
92				PATTERN "ChangeLog"
93		)
94
95	endif()
96
97
98
99endif()
100