summaryrefslogtreecommitdiffstats
path: root/dependencies.cmake.in
blob: 9d4d1f6399cf6290c7176184f272cdd1e92b0f0e (plain)
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
cmake_minimum_required(VERSION 2.8.9)

message(STATUS "Running install script...")

SET(Qt5_DIR @Qt5_DIR@)

IF(WIN32)
SET(LIB_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
ELSE()
SET(LIB_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/lib)
ENDIF()

INCLUDE(GetPrerequisites)
GET_PREREQUISITES(@BINARY_LOCATION@ MULTIMC_PREREQS 1 1 "" "")

message(STATUS "Prerequisites: ${MULTIMC_PREREQS}")

FOREACH(PREREQ ${MULTIMC_PREREQS})
	GET_FILENAME_COMPONENT(PREREQ_NAME "${PREREQ}" NAME)
	GET_FILENAME_COMPONENT(PREREQ_ACTUAL "${PREREQ}" REALPATH)
	IF(WIN32)
	SET(PREREQ_ACTUAL "${Qt5_DIR}/bin/${PREREQ}")
	ENDIF()
	
	message(STATUS "Adding install prerequisite: ${PREREQ_NAME}")
	
	FILE(INSTALL
		DESTINATION "${LIB_INSTALL_PREFIX}"
		TYPE PROGRAM
		RENAME "${PREREQ_NAME}"
		FILES "${PREREQ_ACTUAL}"
	)
ENDFOREACH()