~jan-kneschke/mysql-proxy/packet-tracking-assertions

1035 by Kay Roepke
add missing license tags
1
# $%BEGINLICENSE%$
2
# $%ENDLICENSE%$
3
908 by jan at mysql
work around a problem in cpack that doesn't install .exe nor .dll's as TARGETS
4
## print a few properties of a target
5
MACRO(PRINT_TARGET_PROPERTIES target)
6
	MESSAGE(STATUS "properties of target ${target}")
7
	FOREACH(prop "COMPILE_FLAGS" "IMPORT_PREFIX" "IMPORT_SUFFIX" "TYPE" "LOCATION")
8
		GET_TARGET_PROPERTY(value ${target} ${prop})
9
		MESSAGE(STATUS "  ${prop} = ${value}")
10
	ENDFOREACH()
11
12
ENDMACRO(PRINT_TARGET_PROPERTIES target)
13
14
## install a shared-lib or executable target incl. .pdb files on win32
15
##
16
## works around a bug in cmake that doesn't include TARGETS in cpack
17
MACRO(CHASSIS_INSTALL_TARGET target)
18
	IF(WIN32)
19
		GET_TARGET_PROPERTY(built_location ${target} LOCATION)
20
		GET_TARGET_PROPERTY(type ${target} TYPE)
21
		STRING(REPLACE "$(OutDir)" "${CMAKE_BUILD_TYPE}" built_location ${built_location})
22
		IF(type MATCHES "SHARED_LIBRARY")
909 by jan at mysql
install the .lib files into lib/ for the .dll's we build
23
			STRING(REPLACE ".dll" ".lib" lib_location ${built_location})
908 by jan at mysql
work around a problem in cpack that doesn't install .exe nor .dll's as TARGETS
24
			INSTALL(FILES
25
				${built_location}
26
				DESTINATION bin
27
			)
909 by jan at mysql
install the .lib files into lib/ for the .dll's we build
28
			INSTALL(FILES
29
				${lib_location}
30
				DESTINATION lib
31
			)
908 by jan at mysql
work around a problem in cpack that doesn't install .exe nor .dll's as TARGETS
32
			IF(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")
33
				STRING(REPLACE ".dll" ".pdb" pdb_location ${built_location})
34
				INSTALL(FILES
35
					${pdb_location}
36
					DESTINATION bin
37
				)
38
			ENDIF()
39
		ENDIF()
40
		IF(type MATCHES "EXECUTABLE")
41
			INSTALL(FILES
42
				${built_location}
43
				DESTINATION bin
44
			)
45
			IF(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")
46
				STRING(REPLACE ".exe" ".pdb" pdb_location ${built_location})
47
				INSTALL(FILES
48
					${pdb_location}
49
					DESTINATION bin
50
				)
51
			ENDIF()
52
		ENDIF()
53
	ELSE(WIN32)
54
		INSTALL(TARGETS ${target}
55
			RUNTIME DESTINATION bin
56
			ARCHIVE DESTINATION lib
57
			LIBRARY DESTINATION lib
58
		)
59
	ENDIF(WIN32)
60
ENDMACRO(CHASSIS_INSTALL_TARGET target)
61
62