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
|
cmake_minimum_required (VERSION 3.5)
include("GNUInstallDirs")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(PluginName "DebuggerCore")
find_package(Qt5 5.0.0 REQUIRED Widgets)
set(DebuggerCore_SRCS
DebuggerCoreBase.cpp
DebuggerCoreBase.h
)
if(TARGET_PLATFORM_LINUX)
set(PLUGIN_INCLUDES
${PLUGIN_INCLUDES}
unix/linux
unix
)
set(DebuggerCore_SRCS
${DebuggerCore_SRCS}
unix/linux/DebuggerCore.cpp
unix/linux/DebuggerCore.h
unix/linux/DialogMemoryAccess.cpp
unix/linux/DialogMemoryAccess.h
unix/linux/DialogMemoryAccess.ui
unix/linux/FeatureDetect.cpp
unix/linux/FeatureDetect.h
unix/linux/PlatformCommon.cpp
unix/linux/PlatformCommon.h
unix/linux/PlatformEvent.cpp
unix/linux/PlatformEvent.h
unix/linux/PlatformProcess.cpp
unix/linux/PlatformProcess.h
unix/linux/PlatformRegion.cpp
unix/linux/PlatformRegion.h
unix/linux/PlatformThread.cpp
unix/linux/PlatformThread.h
unix/linux/PrStatus.h
unix/Posix.cpp
unix/Posix.h
unix/Unix.cpp
unix/Unix.h
)
elseif(TARGET_PLATFORM_WINDOWS)
set(PLUGIN_INCLUDES
${PLUGIN_INCLUDES}
win32
)
set(DebuggerCore_SRCS
${DebuggerCore_SRCS}
win32/DebuggerCore.cpp
win32/DebuggerCore.h
win32/PlatformEvent.cpp
win32/PlatformEvent.h
win32/PlatformProcess.cpp
win32/PlatformProcess.h
win32/PlatformRegion.cpp
win32/PlatformRegion.h
win32/PlatformState.cpp
win32/PlatformState.h
win32/PlatformThread.cpp
win32/PlatformThread.h
)
elseif(TARGET_PLATFORM_FREEBSD)
set(PLUGIN_INCLUDES
${PLUGIN_INCLUDES}
unix/freebsd
unix
)
set(DebuggerCore_SRCS
${DebuggerCore_SRCS}
unix/freebsd/DebuggerCore.cpp
unix/freebsd/DebuggerCore.h
unix/freebsd/PlatformCommon.cpp
unix/freebsd/PlatformCommon.h
unix/freebsd/PlatformEvent.cpp
unix/freebsd/PlatformEvent.h
unix/freebsd/PlatformProcess.cpp
unix/freebsd/PlatformProcess.h
unix/freebsd/PlatformRegion.cpp
unix/freebsd/PlatformRegion.h
unix/freebsd/PlatformThread.cpp
unix/freebsd/PlatformThread.h
)
endif()
if(TARGET_ARCH_FAMILY_X86)
set(PLUGIN_INCLUDES
${PLUGIN_INCLUDES}
arch/x86-generic
)
set(DebuggerCore_SRCS
${DebuggerCore_SRCS}
arch/x86-generic/Breakpoint.cpp
arch/x86-generic/Breakpoint.h
)
if(TARGET_PLATFORM_LINUX)
set(PLUGIN_INCLUDES
${PLUGIN_INCLUDES}
unix/linux/arch/x86-generic
)
set(DebuggerCore_SRCS
${DebuggerCore_SRCS}
unix/linux/arch/x86-generic/PlatformState.cpp
unix/linux/arch/x86-generic/PlatformState.h
unix/linux/arch/x86-generic/PlatformThread.cpp
)
endif()
endif()
if(TARGET_ARCH_FAMILY_ARM)
set(PLUGIN_INCLUDES
${PLUGIN_INCLUDES}
arch/arm-generic
)
set(DebuggerCore_SRCS
${DebuggerCore_SRCS}
arch/arm-generic/Breakpoint.cpp
arch/arm-generic/Breakpoint.h
)
if(TARGET_PLATFORM_LINUX)
set(PLUGIN_INCLUDES
${PLUGIN_INCLUDES}
unix/linux/arch/arm-generic
)
set(DebuggerCore_SRCS
${DebuggerCore_SRCS}
unix/linux/arch/arm-generic/PlatformState.cpp
unix/linux/arch/arm-generic/PlatformState.h
unix/linux/arch/arm-generic/PlatformThread.cpp
)
endif()
endif()
add_library(${PluginName} SHARED ${DebuggerCore_SRCS} )
target_include_directories(${PluginName} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
${PLUGIN_INCLUDES}
)
target_link_libraries(${PluginName} Qt5::Widgets PE ELF edb)
install (TARGETS ${PluginName} DESTINATION ${CMAKE_INSTALL_LIBDIR}/edb)
set_property(TARGET ${PluginName} PROPERTY CXX_EXTENSIONS OFF)
set_property(TARGET ${PluginName} PROPERTY CXX_STANDARD 14)
set_property(TARGET ${PluginName} PROPERTY CXX_STANDARD_REQUIRED ON)
set_property(TARGET ${PluginName} PROPERTY LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set_property(TARGET ${PluginName} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
|