CMakeLists.txt 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. #
  2. # setup
  3. #
  4. get_property( CAN_BUILD_SHARED_LIBS GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS )
  5. if( NOT CAN_BUILD_SHARED_LIBS )
  6. return()
  7. endif()
  8. #
  9. # console
  10. #
  11. option( BUILD_PLUGIN_console "build console plugin" OFF )
  12. if( BUILD_PLUGIN_console )
  13. message( STATUS "Creating target console" )
  14. set( CONSOLE_SOURCES
  15. "${CMAKE_CURRENT_SOURCE_DIR}/console.c"
  16. "${CMAKE_CURRENT_SOURCE_DIR}/console.def"
  17. )
  18. set( LIBRARIES ${GLOBAL_LIBRARIES} )
  19. set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
  20. set( DEFINITIONS ${GLOBAL_DEFINITIONS} )
  21. set( SOURCE_FILES ${CONSOLE_SOURCES} )
  22. source_group( console FILES ${CONSOLE_SOURCES} )
  23. include_directories( ${INCLUDE_DIRS} )
  24. add_library( console SHARED ${SOURCE_FILES} )
  25. target_link_libraries( console ${LIBRARIES} )
  26. set_target_properties( console PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" )
  27. set_target_properties( console PROPERTIES PREFIX "" )
  28. if( INSTALL_COMPONENT_RUNTIME )
  29. cpack_add_component( Runtime_console DESCRIPTION "console plugin" DISPLAY_NAME "console" GROUP Runtime )
  30. install( TARGETS console
  31. DESTINATION "plugins"
  32. COMPONENT Runtime_console )
  33. endif( INSTALL_COMPONENT_RUNTIME )
  34. set( TARGET_LIST ${TARGET_LIST} console CACHE INTERNAL "" )
  35. message( STATUS "Creating target console - done" )
  36. endif( BUILD_PLUGIN_console )
  37. #
  38. # dbghelpplug
  39. #
  40. if( WIN32 )
  41. find_path( HAVE_DBGHELP_H dbghelp.h )
  42. mark_as_advanced( HAVE_DBGHELP_H )
  43. if( HAVE_DBGHELP_H )
  44. option( BUILD_PLUGIN_dbghelpplug "build dbghelpplug plugin" OFF )
  45. endif()
  46. endif()
  47. if( NOT DEFINED BUILD_PLUGIN_dbghelpplug )
  48. message( STATUS "Disabled dbghelpplug plugin target (requires WIN32 and HAVE_DBGHELP_H)" )
  49. endif()
  50. if( BUILD_PLUGIN_dbghelpplug )
  51. message( STATUS "Creating target dbghelpplug" )
  52. set( DBGHELPPLUG_SOURCES
  53. "${CMAKE_CURRENT_SOURCE_DIR}/dbghelpplug.c"
  54. "${CMAKE_CURRENT_SOURCE_DIR}/dbghelpplug.rc"
  55. )
  56. set( LIBRARIES ${GLOBAL_LIBRARIES} )
  57. set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
  58. set( DEFINITIONS ${GLOBAL_DEFINITIONS} )
  59. set( SOURCE_FILES ${DBGHELPPLUG_SOURCES} )
  60. source_group( dbghelpplug FILES ${DBGHELPPLUG_SOURCES} )
  61. include_directories( ${INCLUDE_DIRS} )
  62. add_library( dbghelpplug SHARED ${SOURCE_FILES} )
  63. target_link_libraries( dbghelpplug ${LIBRARIES} )
  64. set_target_properties( dbghelpplug PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" )
  65. set_target_properties( dbghelpplug PROPERTIES PREFIX "" )
  66. if( INSTALL_COMPONENT_RUNTIME )
  67. cpack_add_component( Runtime_dbghelpplug DESCRIPTION "dbghelpplug plugin" DISPLAY_NAME "dbghelpplug" GROUP Runtime )
  68. install( TARGETS dbghelpplug
  69. DESTINATION "plugins"
  70. COMPONENT Runtime_dbghelpplug )
  71. endif( INSTALL_COMPONENT_RUNTIME )
  72. set( TARGET_LIST ${TARGET_LIST} dbghelpplug CACHE INTERNAL "" )
  73. message( STATUS "Creating target dbghelpplug - done" )
  74. endif( BUILD_PLUGIN_dbghelpplug )
  75. #
  76. # pid
  77. #
  78. if( WIN32 OR HAVE_GETPID )
  79. option( BUILD_PLUGIN_pid "build pid plugin" OFF )
  80. else()
  81. message( STATUS "Disabled pid plugin target (requires WIN32 or HAVE_GETPID)" )
  82. endif()
  83. if( BUILD_PLUGIN_pid )
  84. message( STATUS "Creating target pid" )
  85. set( PID_SOURCES
  86. "${CMAKE_CURRENT_SOURCE_DIR}/pid.c"
  87. "${CMAKE_CURRENT_SOURCE_DIR}/pid.def"
  88. )
  89. set( LIBRARIES ${GLOBAL_LIBRARIES} )
  90. set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
  91. set( DEFINITIONS ${GLOBAL_DEFINITIONS} )
  92. set( SOURCE_FILES ${PID_SOURCES} )
  93. source_group( pid FILES ${PID_SOURCES} )
  94. include_directories( ${INCLUDE_DIRS} )
  95. add_library( pid SHARED ${SOURCE_FILES} )
  96. target_link_libraries( pid ${LIBRARIES} )
  97. set_target_properties( pid PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" )
  98. set_target_properties( pid PROPERTIES PREFIX "" )
  99. if( INSTALL_COMPONENT_RUNTIME )
  100. cpack_add_component( Runtime_pid DESCRIPTION "pid plugin" DISPLAY_NAME "pid" GROUP Runtime )
  101. install( TARGETS pid
  102. DESTINATION "plugins"
  103. COMPONENT Runtime_pid )
  104. endif( INSTALL_COMPONENT_RUNTIME )
  105. set( TARGET_LIST ${TARGET_LIST} pid CACHE INTERNAL "" )
  106. message( STATUS "Creating target pid - done" )
  107. endif( BUILD_PLUGIN_pid )
  108. #
  109. # sample
  110. #
  111. option( BUILD_PLUGIN_sample "build sample plugin" OFF )
  112. if( BUILD_PLUGIN_sample )
  113. message( STATUS "Creating target sample" )
  114. set( SAMPLE_SOURCES
  115. "${CMAKE_CURRENT_SOURCE_DIR}/sample.c"
  116. "${CMAKE_CURRENT_SOURCE_DIR}/sample.def"
  117. )
  118. set( LIBRARIES ${GLOBAL_LIBRARIES} )
  119. set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
  120. set( DEFINITIONS ${GLOBAL_DEFINITIONS} )
  121. set( SOURCE_FILES ${SAMPLE_SOURCES} )
  122. source_group( sample FILES ${SAMPLE_SOURCES} )
  123. include_directories( ${INCLUDE_DIRS} )
  124. add_library( sample SHARED ${SOURCE_FILES} )
  125. target_link_libraries( sample ${LIBRARIES} )
  126. set_target_properties( sample PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" )
  127. set_target_properties( sample PROPERTIES PREFIX "" )
  128. if( INSTALL_COMPONENT_RUNTIME )
  129. cpack_add_component( Runtime_sample DESCRIPTION "sample plugin" DISPLAY_NAME "sample" GROUP Runtime )
  130. install( TARGETS sample
  131. DESTINATION "plugins"
  132. COMPONENT Runtime_sample )
  133. endif( INSTALL_COMPONENT_RUNTIME )
  134. set( TARGET_LIST ${TARGET_LIST} sample CACHE INTERNAL "" )
  135. message( STATUS "Creating target sample - done" )
  136. endif( BUILD_PLUGIN_sample )
  137. #
  138. # sig
  139. #
  140. option( BUILD_PLUGIN_sig "build sig plugin" OFF )
  141. if( BUILD_PLUGIN_sig )
  142. message( STATUS "Creating target sig" )
  143. set( SIG_SOURCES
  144. "${CMAKE_CURRENT_SOURCE_DIR}/sig.c"
  145. )
  146. set( LIBRARIES ${GLOBAL_LIBRARIES} )
  147. set( INCLUDE_DIRS ${GLOBAL_INCLUDE_DIRS} )
  148. set( DEFINITIONS "${GLOBAL_DEFINITIONS} -DNO_MEMMGR" )
  149. set( SOURCE_FILES ${SIG_SOURCES} )
  150. source_group( sig FILES ${SIG_SOURCES} )
  151. include_directories( ${INCLUDE_DIRS} )
  152. add_library( sig SHARED ${SOURCE_FILES} )
  153. target_link_libraries( sig ${LIBRARIES} )
  154. set_target_properties( sig PROPERTIES COMPILE_FLAGS "${DEFINITIONS}" )
  155. set_target_properties( sig PROPERTIES PREFIX "" )
  156. if( INSTALL_COMPONENT_RUNTIME )
  157. cpack_add_component( Runtime_sig DESCRIPTION "sig plugin" DISPLAY_NAME "sig" GROUP Runtime )
  158. install( TARGETS sig
  159. DESTINATION "plugins"
  160. COMPONENT Runtime_sig )
  161. endif( INSTALL_COMPONENT_RUNTIME )
  162. set( TARGET_LIST ${TARGET_LIST} sig CACHE INTERNAL "" )
  163. message( STATUS "Creating target sig - done" )
  164. endif( BUILD_PLUGIN_sig )