summaryrefslogtreecommitdiffstats
path: root/cmake/EchoTarget.cmake
blob: 12759256b474a58544af6edfaac38f87bcb2ebcf (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
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
function(echo_target_property tgt prop)
	# v for value, d for defined, s for set
	get_property(v TARGET ${tgt} PROPERTY ${prop})
	get_property(d TARGET ${tgt} PROPERTY ${prop} DEFINED)
	get_property(s TARGET ${tgt} PROPERTY ${prop} SET)
 
	# only produce output for values that are set
	if(s)
		message("tgt='${tgt}' prop='${prop}'")
		message("    value='${v}'")
		message("    defined='${d}'")
		message("    set='${s}'")
		message("")
	endif()
endfunction()
 
function(echo_target tgt)
	if(NOT TARGET ${tgt})
		message("There is no target named '${tgt}'")
		return()
	endif()

	set(props
		DEBUG_OUTPUT_NAME
		RELEASE_OUTPUT_NAME
		DEBUG_POSTFIX
		RELEASE_POSTFIX
		ARCHIVE_OUTPUT_DIRECTORY
		ARCHIVE_OUTPUT_DIRECTORY_DEBUG
		ARCHIVE_OUTPUT_DIRECTORY_RELEASE
		ARCHIVE_OUTPUT_NAME
		ARCHIVE_OUTPUT_NAME_DEBUG
		ARCHIVE_OUTPUT_NAME_RELEASE
		AUTOMOC
		AUTOMOC_MOC_OPTIONS
		BUILD_WITH_INSTALL_RPATH
		BUNDLE
		BUNDLE_EXTENSION
		COMPILE_DEFINITIONS
		COMPILE_DEFINITIONS_DEBUG
		COMPILE_DEFINITIONS_RELEASE
		COMPILE_FLAGS
		DEBUG_POSTFIX
		DEFINE_SYMBOL
		ENABLE_EXPORTS
		EXCLUDE_FROM_ALL
		EchoString
		FOLDER
		FRAMEWORK
		Fortran_FORMAT
		Fortran_MODULE_DIRECTORY
		GENERATOR_FILE_NAME
		GNUtoMS
		HAS_CXX
		IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
		IMPORTED
		IMPORTED_CONFIGURATIONS
		IMPORTED_IMPLIB
		IMPORTED_IMPLIB_RELEASE
		IMPORTED_IMPLIB_RELEASE
		IMPORTED_LINK_DEPENDENT_LIBRARIES
		IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBUG
		IMPORTED_LINK_DEPENDENT_LIBRARIES_RELEASE
		IMPORTED_LINK_INTERFACE_LANGUAGES
		IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG
		IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE
		IMPORTED_LINK_INTERFACE_LIBRARIES
		IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG
		IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE
		IMPORTED_LINK_INTERFACE_MULTIPLICITY
		IMPORTED_LINK_INTERFACE_MULTIPLICITY_DEBUG
		IMPORTED_LINK_INTERFACE_MULTIPLICITY_RELEASE
		IMPORTED_LOCATION
		IMPORTED_LOCATION_DEBUG
		IMPORTED_LOCATION_RELEASE
		IMPORTED_NO_SONAME
		IMPORTED_NO_SONAME_DEBUG
		IMPORTED_NO_SONAME_RELEASE
		IMPORTED_SONAME
		IMPORTED_SONAME_DEBUG
		IMPORTED_SONAME_RELEASE
		IMPORT_PREFIX
		IMPORT_SUFFIX
		INCLUDE_DIRECTORIES
		INSTALL_NAME_DIR
		INSTALL_RPATH
		INSTALL_RPATH_USE_LINK_PATH
		INTERPROCEDURAL_OPTIMIZATION
		INTERPROCEDURAL_OPTIMIZATION_DEBUG
		INTERPROCEDURAL_OPTIMIZATION_RELEASE
		LABELS
		LIBRARY_OUTPUT_DIRECTORY
		LIBRARY_OUTPUT_DIRECTORY_DEBUG
		LIBRARY_OUTPUT_DIRECTORY_RELEASE
		LIBRARY_OUTPUT_NAME
		LIBRARY_OUTPUT_NAME_DEBUG
		LIBRARY_OUTPUT_NAME_RELEASE
		LINKER_LANGUAGE
		LINK_DEPENDS
		LINK_LIBRARIES
		LINK_FLAGS
		LINK_FLAGS_DEBUG
		LINK_FLAGS_RELEASE
		LINK_INTERFACE_LIBRARIES
		LINK_INTERFACE_LIBRARIES_DEBUG
		LINK_INTERFACE_LIBRARIES_RELEASE
		LINK_INTERFACE_MULTIPLICITY
		LINK_INTERFACE_MULTIPLICITY_DEBUG
		LINK_INTERFACE_MULTIPLICITY_RELEASE
		LINK_SEARCH_END_STATIC
		LINK_SEARCH_START_STATIC
		LOCATION
		LOCATION_DEBUG
		LOCATION_RELEASE
		MACOSX_BUNDLE
		MACOSX_BUNDLE_INFO_PLIST
		MACOSX_FRAMEWORK_INFO_PLIST
		MAP_IMPORTED_CONFIG_DEBUG
		MAP_IMPORTED_CONFIG_RELEASE
		OSX_ARCHITECTURES
		OSX_ARCHITECTURES_DEBUG
		OSX_ARCHITECTURES_RELEASE
		OUTPUT_NAME
		OUTPUT_NAME_DEBUG
		OUTPUT_NAME_RELEASE
		POST_INSTALL_SCRIPT
		PREFIX
		PRE_INSTALL_SCRIPT
		PRIVATE_HEADER
		PROJECT_LABEL
		PUBLIC_HEADER
		RESOURCE
		RULE_LAUNCH_COMPILE
		RULE_LAUNCH_CUSTOM
		RULE_LAUNCH_LINK
		RUNTIME_OUTPUT_DIRECTORY
		RUNTIME_OUTPUT_DIRECTORY_DEBUG
		RUNTIME_OUTPUT_DIRECTORY_RELEASE
		RUNTIME_OUTPUT_NAME
		RUNTIME_OUTPUT_NAME_DEBUG
		RUNTIME_OUTPUT_NAME_RELEASE
		SKIP_BUILD_RPATH
		SOURCES
		SOVERSION
		STATIC_LIBRARY_FLAGS
		STATIC_LIBRARY_FLAGS_DEBUG
		STATIC_LIBRARY_FLAGS_RELEASE
		SUFFIX
		TYPE
		VERSION
		VS_DOTNET_REFERENCES
		VS_GLOBAL_KEYWORD
		VS_GLOBAL_PROJECT_TYPES
		VS_KEYWORD
		VS_SCC_AUXPATH
		VS_SCC_LOCALPATH
		VS_SCC_PROJECTNAME
		VS_SCC_PROVIDER
		VS_WINRT_EXTENSIONS
		VS_WINRT_REFERENCES
		WIN32_EXECUTABLE
	)

	message("======================== ${tgt} ========================")
	foreach(p ${props})
		echo_target_property("${tgt}" "${p}")
	endforeach()
	message("")

endfunction()

function(echo_targets)
	set(tgts ${ARGV})
	foreach(t ${tgts})
		echo_target("${t}")
	endforeach()
endfunction()