File: MyGUIInstallDependencies.cmake

package info (click to toggle)
mygui 3.2.2+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 36,224 kB
  • sloc: cpp: 118,031; ansic: 30,202; xml: 15,544; cs: 12,602; tcl: 776; python: 417; makefile: 34
file content (75 lines) | stat: -rw-r--r-- 3,072 bytes parent folder | download | duplicates (3)
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
#####################################################
# Install dependencies on Windows
#####################################################

function(install_dll_file DEBUG_FILEPATH RELEASE_FILEPATH FILENAME)
	if (EXISTS ${DEBUG_FILEPATH}${FILENAME}_d.dll)
		install(FILES
			${DEBUG_FILEPATH}${FILENAME}_d.dll
			DESTINATION bin/debug CONFIGURATIONS Debug
		)
		install(FILES
			${RELEASE_FILEPATH}${FILENAME}.dll
			DESTINATION bin/release CONFIGURATIONS Release None ""
		)
		install(FILES
			${RELEASE_FILEPATH}${FILENAME}.dll
			DESTINATION bin/relwithdebinfo CONFIGURATIONS RelWithDebInfo
		)
		install(FILES
			${RELEASE_FILEPATH}${FILENAME}.dll
			DESTINATION bin/minsizerel CONFIGURATIONS MinSizeRel
		)
		
		configure_file(${DEBUG_FILEPATH}${FILENAME}_d.dll ${MYGUI_BINARY_DIR}/bin/debug/${FILENAME}_d.dll COPYONLY)
		configure_file(${RELEASE_FILEPATH}${FILENAME}.dll ${MYGUI_BINARY_DIR}/bin/release/${FILENAME}.dll COPYONLY)
		configure_file(${RELEASE_FILEPATH}${FILENAME}.dll ${MYGUI_BINARY_DIR}/bin/relwithdebinfo/${FILENAME}.dll COPYONLY)
		configure_file(${RELEASE_FILEPATH}${FILENAME}.dll ${MYGUI_BINARY_DIR}/bin/minsizerel/${FILENAME}.dll COPYONLY)
	endif ()
endfunction(install_dll_file)

if (MYGUI_DEPENDENCIES_DIR STREQUAL "")
	set(MYGUI_DEP_BIN_DIR ${MYGUI_SOURCE_DIR}/Dependencies/bin)
else ()
	set(MYGUI_DEP_BIN_DIR ${MYGUI_DEPENDENCIES_DIR}/bin)
endif ()

option(MYGUI_TRY_TO_COPY_DLLS "Copy dlls needed for sample builds" TRUE)

if (MYGUI_TRY_TO_COPY_DLLS)
	# copy the dependency DLLs to the right places
	if (MYGUI_SAMPLES_INPUT EQUAL 1)
		install_dll_file(${MYGUI_DEP_BIN_DIR}/debug/ ${MYGUI_DEP_BIN_DIR}/release/ OIS)
	elseif (MYGUI_SAMPLES_INPUT EQUAL 2)
	elseif (MYGUI_SAMPLES_INPUT EQUAL 3)
		install_dll_file(${MYGUI_DEP_BIN_DIR}/debug/ ${MYGUI_DEP_BIN_DIR}/release/ OIS)
	endif ()
	
	if (MYGUI_RENDERSYSTEM EQUAL 3)
		if (EXISTS ${OGRE_LIB_DIR}/../bin/debug/OgreMain_d.dll)
			set(DEBUG_DLLS_DIR ${OGRE_LIB_DIR}/../bin/debug)
			set(RELEASE_DLLS_DIR ${OGRE_LIB_DIR}/../bin/release)
			MESSAGE(STATUS "    DLL's were copied from bin")
		elseif (EXISTS "${OGRE_LIB_DIR}/OgreMain_d.dll")
			set(DEBUG_DLLS_DIR ${OGRE_LIB_DIR})
			set(RELEASE_DLLS_DIR ${OGRE_LIB_DIR})
			MESSAGE(STATUS "    DLL's were copied from lib")
		elseif (EXISTS ${OGRE_SOUCE_DIR}/bin/debug/OgreMain_d.dll)
			set(DEBUG_DLLS_DIR ${OGRE_SOUCE_DIR}/bin/debug)
			set(RELEASE_DLLS_DIR ${OGRE_SOUCE_DIR}/bin/release)
			MESSAGE(STATUS "    DLL's were copied from sdk's bin")
		elseif (EXISTS ${OGRE_BUILD}/bin/debug/OgreMain_d.dll)
			set(DEBUG_DLLS_DIR ${OGRE_BUILD}/bin/debug)
			set(RELEASE_DLLS_DIR ${OGRE_BUILD}/bin/release)
			MESSAGE(STATUS "    DLL's were copied from build bin")
		else ()
			set(DEBUG_DLLS_DIR "")
			set(RELEASE_DLLS_DIR "")
			MESSAGE(ERROR "    compiled OGRE DLL's wasn't found")
		endif ()
		
		install_dll_file(${DEBUG_DLLS_DIR}/ ${RELEASE_DLLS_DIR}/ OgreMain)
		install_dll_file(${DEBUG_DLLS_DIR}/ ${RELEASE_DLLS_DIR}/ RenderSystem_Direct3D9)
		install_dll_file(${DEBUG_DLLS_DIR}/ ${RELEASE_DLLS_DIR}/ RenderSystem_GL)
	endif ()
endif ()