I have a idl-file. During the build a header gets generated in the intermediate directory. How can I include this header in my source?
Currently I am including the header with the path to the intermediate directory. This is suboptimal and fails if another build directory is chosen. I am looking for a way to avoid listing the build/intermediate directory in the include.
My minimal version looks like this:
// CMakeList.txt
cmake_minimum_required (VERSION 3.1.2)
project (IDL-TestCase)
add_executable (idl-testcase main.cpp foo.idl)
// main.cpp
#include "../out/idl-testcase.dir/Debug/foo.h" // How to avoid the build directory?
int main() { /* code using IFoo */ }
// foo.idl
import "oaidl.idl";
[
object,
uuid(889992c7-3eb5-43d0-a5cf-e733511b87aa),
version(1.0)
]
interface IFoo
{
HRESULT foo();
}
Thank you for your consideration.