2023-12-23 21:09:41 +01:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
|
|
|
|
|
|
|
include(ImHexPlugin)
|
|
|
|
|
|
|
|
if (NOT USE_SYSTEM_CAPSTONE)
|
|
|
|
set(CAPSTONE_BUILD_STATIC_RUNTIME OFF CACHE BOOL "Disable shared library building")
|
|
|
|
set(CAPSTONE_BUILD_SHARED OFF CACHE BOOL "Disable shared library building")
|
|
|
|
set(CAPSTONE_BUILD_TESTS OFF CACHE BOOL "Disable tests")
|
|
|
|
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/capstone ${CMAKE_CURRENT_BINARY_DIR}/capstone EXCLUDE_FROM_ALL)
|
|
|
|
target_compile_options(capstone PRIVATE -Wno-unused-function)
|
2024-01-26 12:13:22 +01:00
|
|
|
set(CAPSTONE_LIBRARY "capstone")
|
|
|
|
set(CAPSTONE_INCLUDE_DIR ${THIRD_PARTY_LIBS_FOLDER}/capstone/include)
|
2023-12-23 21:09:41 +01:00
|
|
|
else()
|
2024-01-26 12:13:22 +01:00
|
|
|
find_package(Capstone REQUIRED)
|
2023-12-23 21:09:41 +01:00
|
|
|
endif()
|
|
|
|
|
|
|
|
add_imhex_plugin(
|
|
|
|
NAME
|
|
|
|
disassembler
|
|
|
|
SOURCES
|
|
|
|
source/plugin_disassembler.cpp
|
|
|
|
|
|
|
|
source/content/views/view_disassembler.cpp
|
|
|
|
|
|
|
|
source/content/pl_visualizers/disassembler.cpp
|
|
|
|
INCLUDES
|
|
|
|
include
|
2024-01-26 12:13:22 +01:00
|
|
|
${CAPSTONE_INCLUDE_DIR}
|
2023-12-23 21:09:41 +01:00
|
|
|
LIBRARIES
|
|
|
|
ui
|
2024-01-28 22:14:59 +01:00
|
|
|
fonts
|
|
|
|
${CAPSTONE_LIBRARY}
|
2023-12-23 21:09:41 +01:00
|
|
|
)
|