-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
51 lines (44 loc) · 1.59 KB
/
Copy pathCMakeLists.txt
File metadata and controls
51 lines (44 loc) · 1.59 KB
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
# Copyright (c) 2019-2026 Elias Bachaalany
# SPDX-License-Identifier: LicenseRef-Human-Origin-Source-1.0
#
# This file is licensed under the Human-Origin Source License v1.0.
# See LICENSE.
cmake_minimum_required(VERSION 3.27)
project(qscripts)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Include ida-cmake bootstrap. ida-cmake is installed alongside the SDK at
# $IDASDK/ida-cmake (see the ida-cmake README). We use it directly rather than
# the SDK's own src/cmake, which differs across SDK versions.
include($ENV{IDASDK}/ida-cmake/bootstrap.cmake)
find_package(idasdk REQUIRED)
# Resolve libidacpp: use a local ../libidacpp if present, otherwise fetch it.
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../libidacpp/CMakeLists.txt")
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../libidacpp ${CMAKE_CURRENT_BINARY_DIR}/libidacpp)
else()
include(FetchContent)
FetchContent_Declare(
libidacpp
GIT_REPOSITORY https://github.com/allthingsida/libidacpp.git
GIT_TAG main
)
FetchContent_MakeAvailable(libidacpp)
endif()
# Convert paths to native format
set(SAMPLE_IDB "${IDA_CMAKE_DIR}/samples/wizmo32.exe.i64")
file(TO_NATIVE_PATH "${SAMPLE_IDB}" SAMPLE_IDB)
# Add plugin
ida_add_plugin(qscripts
SOURCES
qscripts.cpp
qscripts_monitor.cpp
script.hpp
qscripts_utils.h
qscripts_expander.h
qscripts_deps.h
qscripts_monitor.h
DEBUG_ARGS
"${SAMPLE_IDB}"
)
target_link_libraries(qscripts PRIVATE libidacpp::libidacpp)