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.
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+ (set
IDASDKenvironment variable) - Visual Studio 2022 (Windows) / GCC/Clang (Linux/macOS)
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 an executable using IDA as a library. For vanilla CMake approach, see templates/idalib-vanilla/.
ida_add_idalib_exe(myapp
SOURCES main.cpp
)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-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
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.
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}
)