I am trying to set up cmake based build for a drmemtrace analyzer and I am following the directions from the "Creating New Analysis Tools" page
https://dynamorio.org/sec_drcachesim_newtool.htmlThis is my CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(analyzer_example)
find_package(DynamoRIO)
if (NOT DynamoRIO_FOUND)
message(FATAL_ERROR "DynamoRIO package required to build")
endif(NOT DynamoRIO_FOUND)
set (target analyzer_example)
add_executable (${target} ${target}.cpp)
# The target OS:
if (APPLE)
set(MACOS 1)
elseif (UNIX)
set(LINUX 1)
endif (APPLE)
if (WIN32)
set(WINDOWS 1)
endif (WIN32)
if (LINUX)
target_compile_definitions(${target} PRIVATE -DLINUX -DUNIX)
elseif (WINDOWS)
target_compile_definitions(${target} PRIVATE WINDOWS)
endif (LINUX)
target_compile_definitions(${target} PRIVATE X86_64 X64)
configure_DynamoRIO_main_headers()
use_DynamoRIO_drmemtrace(${target})
This is my analyzer_example.cpp
#include "analysis_tool.h"
#include <string>
int main()
{
return 0;
}
On compiling, I get this error
fatal error: analysis_tool.h: No such file or directory
1 | #include "analysis_tool.h"
I also tried adding configure_DynamoRIO_main_headers() in CMakeLists.txt but it did not help.
I am able to compile if I change the include to this
#include "drmemtrace/analysis_tool.h"
Is my CMakeLists.txt set up incorrectly?