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

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
# $%BEGINLICENSE%$
# $%ENDLICENSE%$

## print a few properties of a target
MACRO(PRINT_TARGET_PROPERTIES target)
	MESSAGE(STATUS "properties of target ${target}")
	FOREACH(prop "COMPILE_FLAGS" "IMPORT_PREFIX" "IMPORT_SUFFIX" "TYPE" "LOCATION")
		GET_TARGET_PROPERTY(value ${target} ${prop})
		MESSAGE(STATUS "  ${prop} = ${value}")
	ENDFOREACH()

ENDMACRO(PRINT_TARGET_PROPERTIES target)

## install a shared-lib or executable target incl. .pdb files on win32
##
## works around a bug in cmake that doesn't include TARGETS in cpack
MACRO(CHASSIS_INSTALL_TARGET target)
	IF(WIN32)
		GET_TARGET_PROPERTY(built_location ${target} LOCATION)
		GET_TARGET_PROPERTY(type ${target} TYPE)
		STRING(REPLACE "$(OutDir)" "${CMAKE_BUILD_TYPE}" built_location ${built_location})
		IF(type MATCHES "SHARED_LIBRARY")
			STRING(REPLACE ".dll" ".lib" lib_location ${built_location})
			INSTALL(FILES
				${built_location}
				DESTINATION bin
			)
			INSTALL(FILES
				${lib_location}
				DESTINATION lib
			)
			IF(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")
				STRING(REPLACE ".dll" ".pdb" pdb_location ${built_location})
				INSTALL(FILES
					${pdb_location}
					DESTINATION bin
				)
			ENDIF()
		ENDIF()
		IF(type MATCHES "EXECUTABLE")
			INSTALL(FILES
				${built_location}
				DESTINATION bin
			)
			IF(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")
				STRING(REPLACE ".exe" ".pdb" pdb_location ${built_location})
				INSTALL(FILES
					${pdb_location}
					DESTINATION bin
				)
			ENDIF()
		ENDIF()
	ELSE(WIN32)
		INSTALL(TARGETS ${target}
			RUNTIME DESTINATION bin
			ARCHIVE DESTINATION lib
			LIBRARY DESTINATION lib
		)
	ENDIF(WIN32)
ENDMACRO(CHASSIS_INSTALL_TARGET target)