[CMake] Setting MIDL Include path via cmake

David Cole david.cole at kitware.com
Fri Aug 5 10:54:37 EDT 2011


Hmmmm... I have some old code where I built an ActiveX control that
included an idl file that does this:

  include_directories("${CMAKE_CURRENT_BINARY_DIR}/\$(IntDir)")
  include_directories("${CMAKE_CURRENT_BINARY_DIR}/\$(OutDir)")

I know it used to work, but I haven't built that project in about 4
years... (I don't think I can simply trivially build it, as some of
the things that it depends on are no longer actively developed and
building with today's CMake and Visual Studio versions...)

I do not know whether the include directories showed up in the VS
Properties dialog, or if the flags were simply added to the midl
command line, but I did have it working at one point.

Either it's gotten broken by something in the interim, or it still
works even though the VS GUI doesn't reflect reality... Does your
project fail to build when using two include_directories commands as
above?

Is the build error simply a midl or a C++ "cannot find include file
xxxxx.h"? Or something else?

Is your project available for me to try? Or can you make a smalll
simple stand-alone reproduce case?

If we can't get it working with VS and it's built-in midl handling, we
can always resort to running midl as a custom command....


HTH,
David


On Fri, Aug 5, 2011 at 8:10 AM, Paul Whelan <pwhelan at aer.com> wrote:
> No, that just sets the compiler's include path. If you look at visual
> studio's property dialog for a COM dll, the MIDL properties General tab
> contains an "Additional include directories" entry much like the C++ general
> tab. However, it isn't getting populated by cmake as best I can tell.
>
> On 8/4/2011 5:27 PM, David Cole wrote:
>>
>> Does calling
>>
>>   include_directories(${CMAKE_CURRENT_BINARY_DIR})
>>
>> before calling add_library work?
>>
>>
>> On Thu, Aug 4, 2011 at 4:14 PM, Paul Whelan<pwhelan at aer.com>  wrote:
>>>
>>> Hi guys,
>>>
>>> I'm new to the mailing list and fairly new to cmake itself, so I hope
>>> this
>>> isn't to basic a question to be posting here. Please refer me to the
>>> appropriate url/forum, etc if it is.
>>>
>>> I have a windows COM project that I'm trying to convert to a cmake build.
>>> The IDL file in that project has includes of header files in it, so I
>>> need a
>>> way to set the MIDL compiler's include path from cmake. I don't see an
>>> obvious variable to set in cmake and the visual studio (2008) project
>>> that
>>> it generates comes up with a blank MIDL include path. Any suggestions on
>>> how
>>> to set that and maybe also where I should be looking for that type of
>>> info
>>> if it is readily available?
>>>
>>> Thanks,
>>> Paul
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the CMake FAQ at:
>>> http://www.cmake.org/Wiki/CMake_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.cmake.org/mailman/listinfo/cmake
>>>
>


More information about the CMake mailing list