File: InstallResources.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 (116 lines) | stat: -rw-r--r-- 4,396 bytes parent folder | download | duplicates (2)
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
##################################################################
# Generate and install the config files needed for the samples
##################################################################


function(install_file FILENAME)
	if (WIN32)
		install(FILES
			${MYGUI_BINARY_DIR}/bin/debug/${FILENAME}
			DESTINATION "bin${MYGUI_DEBUG_PATH}" CONFIGURATIONS Debug
		)
		install(FILES
			${MYGUI_BINARY_DIR}/bin/release/${FILENAME}
			DESTINATION "bin${MYGUI_RELEASE_PATH}" CONFIGURATIONS Release None ""
		)
		install(FILES
			${MYGUI_BINARY_DIR}/bin/release/${FILENAME}
			DESTINATION "bin${MYGUI_RELWDBG_PATH}" CONFIGURATIONS RelWithDebInfo
		)
		install(FILES
			${MYGUI_BINARY_DIR}/bin/release/${FILENAME}
			DESTINATION "bin${MYGUI_MINSIZE_PATH}" CONFIGURATIONS MinSizeRel
		)
	else ()
		install(FILES
			${MYGUI_BINARY_DIR}/bin/${FILENAME}
			DESTINATION "bin"
		)
	endif ()
endfunction(install_file)

if (MYGUI_RENDERSYSTEM EQUAL 3)
	if (WIN32)
		option(MYGUI_OGRE_WAS_BUILT_WITH_DIRECTX "Ogre have DirectX render ssystem and we don't need to disable it" TRUE)
		MARK_AS_ADVANCED(MYGUI_OGRE_WAS_BUILT_WITH_DIRECTX)
		
		set(MYGUI_PLUGIN_DIR_DBG ".")
		set(MYGUI_PLUGIN_DIR_REL ".")
		if (MYGUI_OGRE_WAS_BUILT_WITH_DIRECTX)
			set(MYGUI_NO_PLUGIN_OGRE_DIRECTX "")
		else ()
			set(MYGUI_NO_PLUGIN_OGRE_DIRECTX "#")
		endif ()
	elseif (UNIX)
		set(MYGUI_PLUGIN_DIR_DBG ${OGRE_PLUGIN_DIR_DBG})
		set(MYGUI_PLUGIN_DIR_REL ${OGRE_PLUGIN_DIR_REL})
		set(MYGUI_NO_PLUGIN_OGRE_DIRECTX "#")
	endif()
endif ()

# install resource files
if (MYGUI_INSTALL_SAMPLES OR MYGUI_INSTALL_TOOLS)
	if (WIN32)
		set(MYGUI_MEDIA_DIR "../../Media")
	elseif (UNIX)
		set(MYGUI_MEDIA_DIR "../share/MYGUI/Media")
	else ()
		set(MYGUI_MEDIA_DIR "../../Media")
	endif ()
	if (WIN32)
		# create resources.xml
		configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/debug/resources.xml)
		configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/release/resources.xml)
		if (MYGUI_RENDERSYSTEM EQUAL 3)
			# create plugins.cfg
			configure_file(${MYGUI_TEMPLATES_DIR}/plugins_d.cfg.in ${MYGUI_BINARY_DIR}/bin/debug/plugins.cfg)
			configure_file(${MYGUI_TEMPLATES_DIR}/plugins.cfg.in ${MYGUI_BINARY_DIR}/bin/release/plugins.cfg)
		endif ()
	else() # other OS only need one cfg file
		string(TOLOWER "${CMAKE_BUILD_TYPE}" MYGUI_BUILD_TYPE)
		if (MYGUI_BUILD_TYPE STREQUAL "debug" AND NOT APPLE)
			set(MYGUI_CFG_SUFFIX "_d")
		endif ()
		# create resources.xml
		configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/resources.xml)
		if (MYGUI_RENDERSYSTEM EQUAL 3)
			# create plugins.cfg
			configure_file(${MYGUI_TEMPLATES_DIR}/plugins${MYGUI_CFG_SUFFIX}.cfg.in ${MYGUI_BINARY_DIR}/bin/plugins.cfg)
		endif ()
	endif ()
	
	install_file (resources.xml)
	if (MYGUI_RENDERSYSTEM EQUAL 3)
		install_file (plugins.cfg)
	endif ()
else ()

	set(MYGUI_MEDIA_DIR "${MYGUI_SOURCE_DIR}/Media")

	if (WIN32)
		# create resources.xml
		configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/debug/resources.xml)
		configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/release/resources.xml)
		configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/relwithdebinfo/resources.xml)
		configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/minsizerel/resources.xml)
		if (MYGUI_RENDERSYSTEM EQUAL 3)
			# create plugins.cfg
			configure_file(${MYGUI_TEMPLATES_DIR}/plugins_d.cfg.in ${MYGUI_BINARY_DIR}/bin/debug/plugins.cfg)
			configure_file(${MYGUI_TEMPLATES_DIR}/plugins.cfg.in ${MYGUI_BINARY_DIR}/bin/release/plugins.cfg)
			configure_file(${MYGUI_TEMPLATES_DIR}/plugins.cfg.in ${MYGUI_BINARY_DIR}/bin/relwithdebinfo/plugins.cfg)
			configure_file(${MYGUI_TEMPLATES_DIR}/plugins.cfg.in ${MYGUI_BINARY_DIR}/bin/minsizerel/plugins.cfg)
		endif ()
	else() # other OS only need one cfg file
		string(TOLOWER "${CMAKE_BUILD_TYPE}" MYGUI_BUILD_TYPE)
		if (MYGUI_BUILD_TYPE STREQUAL "debug" AND NOT APPLE)
			set(MYGUI_CFG_SUFFIX "_d")
		endif ()
		# create resources.xml
		configure_file(${MYGUI_TEMPLATES_DIR}/resources.xml.in ${MYGUI_BINARY_DIR}/bin/resources.xml)
		if (MYGUI_RENDERSYSTEM EQUAL 3)
			# create plugins.cfg
			configure_file(${MYGUI_TEMPLATES_DIR}/plugins${MYGUI_CFG_SUFFIX}.cfg.in ${MYGUI_BINARY_DIR}/bin/plugins.cfg)
		endif ()
	endif ()

endif ()