File: fixupbundle.cmake.in

package info (click to toggle)
freespace2 24.0.2%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: trixie
  • size: 43,188 kB
  • sloc: cpp: 583,107; ansic: 21,729; python: 1,174; sh: 464; makefile: 248; xml: 181
file content (56 lines) | stat: -rw-r--r-- 1,802 bytes parent folder | download | duplicates (7)
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
# - Configurable script to fix up a VR Juggler bundle
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file ../../LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

function(gp_resolve_item_override _context _item _exepath _dirs _resolved_item _resolved)
	if(NOT ${_resolved})
		set(ri "ri-NOTFOUND")
		if("${_item}" MATCHES "@executable_path")
			get_filename_component(itemname "${_item}" NAME)
			message(STATUS "Was incompletely embedded, now looking for ${itemname}")
			find_file(ri "${itemname}" ${_exepath} ${_dirs} NO_DEFAULT_PATH)
			find_file(ri "${itemname}" ${_exepath} ${_dirs} /usr/lib)
			if(ri)
				get_filename_component(ri "${ri}" REALPATH)
				message(STATUS "override info: 'find_file' on filename '${itemname} in exepath/dirs (${ri})")
				set(${_resolved} 1 PARENT_SCOPE)
				set(${_resolved_item} "${ri}" PARENT_SCOPE)
				set(ri "ri-NOTFOUND")
			endif()
		endif()
	endif()

endfunction()


set(CMAKE_MODULE_PATH @CMAKE_MODULE_PATH@)

include(BundleUtilities)
set(IS_XCODE @IS_XCODE@)
if(IS_XCODE)
	set(APP "$ENV{TARGET_BUILD_DIR}/@_target@.app")
else()
	set(APP "@TARGET_LOCATION@")
endif()
#set(APP "@_target@")

set(BUNDLE_LIBS_INPUT "@BUNDLE_LIBS@")
foreach(lib ${BUNDLE_LIBS_INPUT})
	if(IS_ABSOLUTE "${lib}")
		list(APPEND BUNDLE_LIBS "${lib}")
		message(STATUS "  ${lib}")
	else()
		message(STATUS "* ${CMAKE_INSTALL_PREFIX}/${lib}")
		list(APPEND BUNDLE_LIBS "${CMAKE_INSTALL_PREFIX}/${lib}")
	endif()
endforeach()

fixup_bundle("${CMAKE_INSTALL_PREFIX}/${APP}" "${BUNDLE_LIBS}" "@BUNDLE_LIB_DIRS@")