File: install-deps.cmake

package info (click to toggle)
mathgl 8.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 248,044 kB
  • sloc: cpp: 87,365; ansic: 3,299; javascript: 3,284; pascal: 1,562; python: 52; sh: 51; makefile: 47; f90: 22
file content (31 lines) | stat: -rw-r--r-- 1,110 bytes parent folder | download
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
include(GetPrerequisites)

message("\nInstalling depended libraries to ${CMAKE_INSTALL_PREFIX}/bin:\n")

file(GLOB_RECURSE exe_list "${CMAKE_INSTALL_PREFIX}/*.exe")
file(GLOB_RECURSE dll_list "${CMAKE_INSTALL_PREFIX}/*.dll")

if(NOT (exe_list OR dll_list))
	message("Exe and dll files not found, cannot generate dependency list")
	return()
endif(NOT (exe_list OR dll_list))

set(mgl_all_dep)
foreach(exe_file ${exe_list} ${dll_list})
	get_prerequisites(${exe_file} DEPENDENCIES 1 1 "" "${CMAKE_INSTALL_PREFIX}/bin")
	foreach(DEPENDENCY_FILE ${DEPENDENCIES})
		gp_resolve_item("${exe_file}" "${DEPENDENCY_FILE}" "" "${CMAKE_INSTALL_PREFIX}/bin" resolved_file)
		if(NOT resolved_file MATCHES ".*libmgl.*")
			list(APPEND mgl_all_dep ${resolved_file})
		endif(NOT resolved_file MATCHES ".*libmgl.*")
	endforeach(DEPENDENCY_FILE ${DEPENDENCIES})
endforeach(exe_file ${exe_list})

list(REMOVE_DUPLICATES mgl_all_dep)
list(SORT mgl_all_dep)

foreach(dll_file ${mgl_all_dep})
	message("Installing: ${dll_file}")
endforeach(dll_file ${mgl_all_dep})

file(COPY ${mgl_all_dep} DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")