CMake build system for developing IDA Pro addons (plugins, loaders, processor modules and standalone idalib apps) using the IDA SDK.
For IDA 9.1 and below, please check the 9.1 branch.
Relationship to the IDA SDK's bundled CMake. Since IDA SDK 9.4, the SDK ships its own CMake layout (under the SDK's
cmake/folder) that is based on ida-cmake — see the SDK'scmake/ACKNOWLEDGMENTS.md, which credits this project. ida-cmake is independent and self-contained: it does not use, require, or depend on the SDK's bundled copy. Install ida-cmake in its own$IDASDK/ida-cmakedirectory and it drives the build entirely on its own.
ida-cmake provides two approaches for building IDA addons:
- Convenience Functions (Recommended) - Simple one-liners like
ida_add_plugin() - Standard CMake - Traditional
add_library()/add_executable()with the provided interface targets
Both approaches are fully supported. Choose based on your preference!
This dual approach follows the same pattern used by major projects like Qt (
qt_add_executable()), LLVM (add_llvm_library()), and CUDA (cuda_add_library()) - providing convenience functions while maintaining full standard CMake compatibility.
- CMake 3.27 or later
- IDA SDK 9.2, 9.3, or 9.4 (set
IDASDKenvironment variable, or pass-DIDASDK=<path>per build) - Visual Studio 2022 (Windows) / GCC/Clang (Linux/macOS)
Selecting an SDK per build:
-DIDASDK=<path>takes precedence over theIDASDKenvironment variable, so you can build against an alternate SDK (e.g. a 9.4 working copy) without changing your global environment:cmake -B build -DIDASDK=/path/to/idasdk94
Windows
# Set environment variable (Windows)
set IDASDK=C:\idasdk92
git clone https://github.com/allthingsida/ida-cmake.git %IDASDK%/ida-cmakeLinux/macOS
# Set environment variable (Linux/macOS)
export IDASDK=/path/to/idasdk92
# Clone ida-cmake into your SDK folder
git clone https://github.com/allthingsida/ida-cmake.git $IDASDK/ida-cmakeAlternative: For advanced users who prefer not to include bootstrap.cmake directly, see
templates/plugin-no-bootstrap/for theCMAKE_PREFIX_PATHapproach that allows ida-cmake to be installed anywhere.
Create a CMakeLists.txt:
cmake_minimum_required(VERSION 3.27)
project(myplugin)
set(CMAKE_CXX_STANDARD 17)
# Include IDA SDK bootstrap
include($ENV{IDASDK}/ida-cmake/bootstrap.cmake)
find_package(idasdk REQUIRED)
# Add plugin with one simple function
ida_add_plugin(myplugin
SOURCES main.cpp
)If you prefer vanilla CMake, use our interface targets directly. See templates/plugin-vanilla/ for a complete example:
# Standard CMake approach
add_library(myplugin SHARED main.cpp)
target_link_libraries(myplugin PRIVATE idasdk::plugin)
# Plus platform-specific settings (see template for details)Build (same for both approaches):
cmake -B build
cmake --build build --config ReleaseYour plugin will be automatically deployed to $IDABIN/plugins/.
Creates an IDA plugin target.
ida_add_plugin(myplugin
SOURCES main.cpp utils.cpp
LIBRARIES Boost::filesystem # Optional: additional libraries
INCLUDES ${CMAKE_SOURCE_DIR}/include # Optional: additional includes
DEFINES MY_DEBUG=1 # Optional: preprocessor definitions
OUTPUT_NAME custom_name # Optional: override output filename
DEBUG_ARGS "-t" # Optional: debugging arguments
)Creates an IDA file loader.
ida_add_loader(myloader
SOURCES loader.cpp
)Creates an IDA processor module.
ida_add_procmod(myproc
SOURCES ana.cpp emu.cpp out.cpp
)Creates a target using IDA as a library. Can build executables, shared libraries, or static libraries. For vanilla CMake approach, see templates/idalib-vanilla/.
# Executable (default)
ida_add_idalib(myapp
SOURCES main.cpp
TYPE EXECUTABLE # Optional, default
)
# Shared library
ida_add_idalib(mylib
SOURCES lib.cpp
TYPE SHARED
)
# Static library
ida_add_idalib(mystatic
SOURCES static.cpp
TYPE STATIC
)Building Qt plugins (qproject, qwindow) requires Qt 6.8.2 with QT_NAMESPACE=QT. ida-cmake provides automated building:
cmake --build build --target build_qt # One-time: ~1-2 hours, ~2GB
cmake -B build # Reconfigure to detect Qt
cmake --build build --config Release # Build with Qt supportQt installs to build/qt-install/ and is auto-detected for future builds. Qt plugins are skipped if Qt is unavailable.
Using Qt in your plugin:
ida_add_plugin(my_qt_plugin
SOURCES main.cpp
LIBRARIES Qt6::Core Qt6::Gui Qt6::Widgets
)External Qt: Set CMAKE_PREFIX_PATH or Qt6_DIR to a Qt 6.8.x installation built with QT_NAMESPACE=QT. Standard Qt installations won't work.
Note: The
build_qttarget requires Ninja. If unavailable, editcmake/QtSupport.cmakeand changeCMAKE_GENERATOR NinjatoCMAKE_GENERATOR "NMake Makefiles".
IDA Pro 9.0+ supports organizing plugins in subfolders with ida-plugin.json metadata files. This feature is optional and opt-in.
To deploy a plugin with metadata:
1. Create an ida-plugin.json file in your project:
{
"IDAMetadataDescriptorVersion": 1,
"plugin": {
"name": "My Plugin",
"entryPoint": "myplugin",
"categories": ["collaboration-and-productivity"],
"logoPath": "logo.png",
"idaVersions": ">=9.0",
"description": "Brief description of your plugin's functionality",
"version": "1.0.0"
}
}Required fields: IDAMetadataDescriptorVersion, name, entryPoint, categories, description, version
Optional fields: logoPath, idaVersions
Available categories:
disassembly-and-processor-modulesfile-parsers-and-loadersdecompilationdebugging-and-tracingdeobfuscationcollaboration-and-productivityintegration-with-third-parties-interoperabilityapi-scripting-and-automationui-ux-and-visualizationmalware-analysisvulnerability-research-and-exploit-developmentother
2. Specify the metadata file in your CMakeLists.txt:
ida_add_plugin(myplugin
SOURCES main.cpp
METADATA_JSON ida-plugin.json
)3. Build normally. Your plugin will deploy to $IDABIN/plugins/myplugin/ with metadata.
Note: If the specified JSON file doesn't exist, ida-cmake will automatically generate a template for you to customize.
Without metadata (traditional - default):
$IDABIN/plugins/myplugin.dll
With metadata (IDA 9.x - opt-in):
$IDABIN/plugins/myplugin/
├── myplugin.dll
└── ida-plugin.json
Each plugin gets its own subfolder to avoid conflicts:
ida_add_plugin(plugin1
SOURCES plugin1.cpp
METADATA_JSON plugin1-metadata.json
)
ida_add_plugin(plugin2
SOURCES plugin2.cpp
METADATA_JSON plugin2-metadata.json
)Deploys to:
$IDABIN/plugins/
├── plugin1/
│ ├── plugin1.dll
│ └── ida-plugin.json
└── plugin2/
├── plugin2.dll
└── ida-plugin.json
See Hex-Rays documentation for the complete metadata format specification.
If you prefer standard CMake commands, ida-cmake provides interface targets:
idasdk::plugin- For IDA pluginsidasdk::loader- For file loadersidasdk::procmod- For processor modulesidasdk::idalib- For standalone idalib applications
These targets automatically handle all SDK configuration (includes, defines, libraries, platform settings) through CMake's transitive properties. See templates/plugin-vanilla/ for a complete working example.
ida-cmake provides several CMake options to customize the build:
Enable debugger module support targets (disabled by default).
cmake -B build -DIDACMAKE_ENABLE_DEBUGGER=ONWhen enabled, provides these additional targets for building custom debugger plugins:
idasdk::dbg- Base debugger module supportidasdk::dbg::pc- PC architecture debugger supportidasdk::dbg::arm- ARM architecture debugger support
Most users don't need these targets unless developing custom debugger plugins.
Ready-to-use templates are available in $IDASDK/ida-cmake/templates/:
plugin/- Basic plugin template (convenience functions)plugin-pch/- Plugin with precompiled header support (faster builds)plugin-vanilla/- Plugin using standard CMake commandsplugin-no-bootstrap/- Plugin using CMAKE_PREFIX_PATH approach (no bootstrap include)loader/- File loader templateprocmod/- Processor module templateidalib/- IDA as library template (convenience functions)idalib-vanilla/- IDALib using standard CMake commands
Copy a template to start your project:
cp -r $IDASDK/ida-cmake/templates/plugin/* my-plugin/
cd my-plugin
cmake -B build
cmake --build buildida-cmake includes built-in support for AI-assisted development with Claude. When starting a new project from a template or adding to an existing project:
# After configuring your project
cmake -B build
# Install the ida-cmake agent and CLAUDE.md to your project
cmake --build build --target install_idacmake_agentThis will:
- Install
.claude/agents/ida-cmake.md- Specialized agent for IDA SDK builds - Create
CLAUDE.md- Project context file with your addon name - Enable AI assistance for build configuration, troubleshooting, and SDK usage
The agent provides expertise in:
- CMake configuration for IDA addons
- Platform-specific build issues
- IDA SDK API usage and examples
- Debugging setup for VS Code and Visual Studio
- GitHub Actions CI/CD workflow setup
- Multi-platform release pipelines
ida-plugin.jsonmetadata file generation
macOS universal binaries (combining arm64 and x86_64) are fully supported via automatic library merging with lipo.
How it works: When you set CMAKE_OSX_ARCHITECTURES to multiple architectures, ida-cmake automatically:
- Detects architecture-specific IDA SDK libraries
- Merges them into universal libraries using
lipoat configure time - Links your addon against the merged universal libraries
Usage:
# Build universal binary (single command!)
cmake -B build -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
cmake --build build --config Release
# Verify the output is universal
lipo -info build/myplugin.dylib
# Should show: Architectures in the fat file: myplugin.dylib are: x86_64 arm64Single-architecture builds: Either omit CMAKE_OSX_ARCHITECTURES (auto-detects host) or specify one architecture:
cmake -B build -DCMAKE_OSX_ARCHITECTURES=arm64 # or x86_64Technical details: The IDA SDK provides architecture-specific libraries (lib/arm64_mac_clang_64/libida.dylib and lib/x64_mac_clang_64/libida.dylib). ida-cmake uses lipo to merge these into universal libraries stored in build/ida-universal-libs/, which are then linked to your addon.
Windows ARM64 addons are supported and require IDA SDK 9.4 or later (earlier SDKs
do not ship Windows ARM64 import libraries, lib/arm64_win_64/).
Cross-compiling on an x64 host (Visual Studio's ARM64 toolchain, installable via the VS Installer):
cmake -B build-arm64 -A ARM64 -DIDASDK=/path/to/idasdk94
cmake --build build-arm64 --config Releaseida-cmake detects the ARM64 target from -A ARM64 (or a native ARM64 host) and links
against the SDK's arm64_win_64 libraries automatically.
Deployment when cross-compiling: to avoid installing an ARM64 binary into an x64 IDA
(where it could not load), cross-built addons are not auto-deployed — they are written
to <build>/ida-addons/<arch>/ instead. Force deployment (e.g. when IDABIN points at a
matching ARM64 IDA) with -DIDA_FORCE_DEPLOY=ON. Native builds deploy as usual.
cmake_minimum_required(VERSION 3.27)
project(MyPlugins)
include($ENV{IDASDK}/ida-cmake/bootstrap.cmake)
find_package(idasdk REQUIRED)
ida_add_plugin(plugin1 SOURCES plugin1.cpp)
ida_add_plugin(plugin2 SOURCES plugin2.cpp)For the standard CMake approach, see templates/plugin-vanilla/.
find_package(idasdk REQUIRED)
find_package(Boost REQUIRED COMPONENTS filesystem)
ida_add_plugin(advanced_plugin
SOURCES main.cpp
LIBRARIES
Boost::filesystem
${Z3_LIBRARIES}
INCLUDES
${Boost_INCLUDE_DIRS}
${Z3_INCLUDE_DIRS}
)