summaryrefslogtreecommitdiff
path: root/src/plugins/CMakeLists.txt
blob: 220f70f6b5b32e9ce465e3b36af69d50213a7690 (plain) (blame)
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
#
# setup
#
get_property( CAN_BUILD_SHARED_LIBS  GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS )
if( NOT CAN_BUILD_SHARED_LIBS )
	return()
endif()

#
# console
#
option( BUILD_PLUGIN_console "build console plugin" OFF )
if( BUILD_PLUGIN_console )
message( STATUS "Creating target console" )
set( CONSOLE_SOURCES
	"${CMAKE_CURRENT_SOURCE_DIR}/console.c"
	"${CMAKE_CURRENT_SOURCE_DIR}/console.def"
	)
set( LIBRARIES ${GLOBAL_LIBRARIES} )
set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
set( DEFINITIONS ${GLOBAL_DEFINITIONS} )
set( SOURCE_FILES ${CONSOLE_SOURCES} )
source_group( console FILES ${CONSOLE_SOURCES} )
include_directories( ${INCLUDE_DIRS} )
add_library( console SHARED ${SOURCE_FILES} )
target_link_libraries( console ${LIBRARIES} )
set_target_properties( console PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" )
set_target_properties( console PROPERTIES PREFIX "" )
if( INSTALL_COMPONENT_RUNTIME )
	cpack_add_component( Runtime_console DESCRIPTION "console plugin" DISPLAY_NAME "console" GROUP Runtime )
	install( TARGETS console
		DESTINATION "plugins"
		COMPONENT Runtime_console )
endif( INSTALL_COMPONENT_RUNTIME )
set( TARGET_LIST ${TARGET_LIST} console  CACHE INTERNAL "" )
message( STATUS "Creating target console - done" )
endif( BUILD_PLUGIN_console )


#
# dbghelpplug
#
if( WIN32 )
	find_path( HAVE_DBGHELP_H dbghelp.h )
	mark_as_advanced( HAVE_DBGHELP_H )
	if( HAVE_DBGHELP_H )
		option( BUILD_PLUGIN_dbghelpplug "build dbghelpplug plugin" OFF )
	endif()
endif()
if( BUILD_PLUGIN_dbghelpplug )
message( STATUS "Creating target dbghelpplug" )
set( DBGHELPPLUG_SOURCES
	"${CMAKE_CURRENT_SOURCE_DIR}/dbghelpplug.c"
	"${CMAKE_CURRENT_SOURCE_DIR}/dbghelpplug.rc"
	)
set( LIBRARIES ${GLOBAL_LIBRARIES} )
set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
set( DEFINITIONS ${GLOBAL_DEFINITIONS} )
set( SOURCE_FILES ${DBGHELPPLUG_SOURCES} )
source_group( dbghelpplug FILES ${DBGHELPPLUG_SOURCES} )
include_directories( ${INCLUDE_DIRS} )
add_library( dbghelpplug SHARED ${SOURCE_FILES} )
target_link_libraries( dbghelpplug ${LIBRARIES} )
set_target_properties( dbghelpplug PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" )
set_target_properties( dbghelpplug PROPERTIES PREFIX "" )
if( INSTALL_COMPONENT_RUNTIME )
	cpack_add_component( Runtime_dbghelpplug DESCRIPTION "dbghelpplug plugin" DISPLAY_NAME "dbghelpplug" GROUP Runtime )
	install( TARGETS dbghelpplug
		DESTINATION "plugins"
		COMPONENT Runtime_dbghelpplug )
endif( INSTALL_COMPONENT_RUNTIME )
set( TARGET_LIST ${TARGET_LIST} dbghelpplug  CACHE INTERNAL "" )
message( STATUS "Creating target dbghelpplug - done" )
endif( BUILD_PLUGIN_dbghelpplug )


#
# pid
#
if( WIN32 OR HAVE_GETPID )
	option( BUILD_PLUGIN_pid "build pid plugin" OFF )
endif()
if( BUILD_PLUGIN_pid )
message( STATUS "Creating target pid" )
set( PID_SOURCES
	"${CMAKE_CURRENT_SOURCE_DIR}/pid.c"
	"${CMAKE_CURRENT_SOURCE_DIR}/pid.def"
	)
set( LIBRARIES ${GLOBAL_LIBRARIES} )
set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
set( DEFINITIONS ${GLOBAL_DEFINITIONS} )
set( SOURCE_FILES ${PID_SOURCES} )
source_group( pid FILES ${PID_SOURCES} )
include_directories( ${INCLUDE_DIRS} )
add_library( pid SHARED ${SOURCE_FILES} )
target_link_libraries( pid ${LIBRARIES} )
set_target_properties( pid PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" )
set_target_properties( pid PROPERTIES PREFIX "" )
if( INSTALL_COMPONENT_RUNTIME )
	cpack_add_component( Runtime_pid DESCRIPTION "pid plugin" DISPLAY_NAME "pid" GROUP Runtime )
	install( TARGETS pid
		DESTINATION "plugins"
		COMPONENT Runtime_pid )
endif( INSTALL_COMPONENT_RUNTIME )
set( TARGET_LIST ${TARGET_LIST} pid  CACHE INTERNAL "" )
message( STATUS "Creating target pid - done" )
endif( BUILD_PLUGIN_pid )


#
# sample
#
option( BUILD_PLUGIN_sample "build sample plugin" OFF )
if( BUILD_PLUGIN_sample )
message( STATUS "Creating target sample" )
set( SAMPLE_SOURCES
	"${CMAKE_CURRENT_SOURCE_DIR}/sample.c"
	"${CMAKE_CURRENT_SOURCE_DIR}/sample.def"
	)
set( LIBRARIES ${GLOBAL_LIBRARIES} )
set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
set( DEFINITIONS ${GLOBAL_DEFINITIONS} )
set( SOURCE_FILES ${SAMPLE_SOURCES} )
source_group( sample FILES ${SAMPLE_SOURCES} )
include_directories( ${INCLUDE_DIRS} )
add_library( sample SHARED ${SOURCE_FILES} )
target_link_libraries( sample ${LIBRARIES} )
set_target_properties( sample PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" )
set_target_properties( sample PROPERTIES PREFIX "" )
if( INSTALL_COMPONENT_RUNTIME )
	cpack_add_component( Runtime_sample DESCRIPTION "sample plugin" DISPLAY_NAME "sample" GROUP Runtime )
	install( TARGETS sample
		DESTINATION "plugins"
		COMPONENT Runtime_sample )
endif( INSTALL_COMPONENT_RUNTIME )
set( TARGET_LIST ${TARGET_LIST} sample  CACHE INTERNAL "" )
message( STATUS "Creating target sample - done" )
endif( BUILD_PLUGIN_sample )


#
# sig
#
option( BUILD_PLUGIN_sig "build sig plugin" OFF )
if( BUILD_PLUGIN_sig )
message( STATUS "Creating target sig" )
set( SIG_SOURCES
	"${COMMON_SOURCE_DIR}/malloc.c"
	"${COMMON_SOURCE_DIR}/malloc.h"
	"${COMMON_SOURCE_DIR}/showmsg.c"
	"${COMMON_SOURCE_DIR}/showmsg.h"
	"${COMMON_SOURCE_DIR}/strlib.c"
	"${COMMON_SOURCE_DIR}/strlib.h"
	"${CMAKE_CURRENT_SOURCE_DIR}/sig.c"
	)
set( LIBRARIES ${GLOBAL_LIBRARIES} )
set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
set( DEFINITIONS "${GLOBAL_DEFINITIONS} ${COMMON_MINI_DEFINITIONS} -DNO_MEMMGR" )
set( SOURCE_FILES ${SIG_SOURCES} )
source_group( sig FILES ${SIG_SOURCES} )
include_directories( ${INCLUDE_DIRS} )
add_library( sig SHARED ${SOURCE_FILES} )
target_link_libraries( sig ${LIBRARIES} )
set_target_properties( sig PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" )
set_target_properties( sig PROPERTIES PREFIX "" )
if( INSTALL_COMPONENT_RUNTIME )
	cpack_add_component( Runtime_sig DESCRIPTION "sig plugin" DISPLAY_NAME "sig" GROUP Runtime )
	install( TARGETS sig
		DESTINATION "plugins"
		COMPONENT Runtime_sig )
endif( INSTALL_COMPONENT_RUNTIME )
set( TARGET_LIST ${TARGET_LIST} sig  CACHE INTERNAL "" )
message( STATUS "Creating target sig - done" )
endif( BUILD_PLUGIN_sig )