MantisBT - CMake
View Issue Details
0016003CMakeCMakepublic2016-03-02 14:062016-06-10 14:31
Dmitry Sokolov 
Kitware Robot 
normalblockhave not tried
closedmoved 
amd64Windows10.0.10586.29
CMake 3.4.1 
 
0016003: "Visual Studio" generators produces wrong settings for .idl files (regression).
CMakeLists.txt:

add_executable(app main.cpp file.idl)
set_source_files_properties(file.idl PROPERTIES COMPILE_FLAGS "/nologo /char signed /env win32 /tlb \"file.tlb\" /I \"../include\" /out \"${PROJECT_BINARY_DIR}/include\" /h \"file.h\" /dlldata \"dlldata.c\" /iid \"file_i.c\" ")


Files main.cpp, file.idl are empty.

Generating:

cmake.exe -G "Visual Studio 12 2013" path\to\CMakeLists.txt

CMake v3.4.x, v3.5.x will produce a .vcxproj:

  <ItemGroup>
    <Midl Include="path\to\file.idl" />
    <ClCompile Include="path\to\main.cpp" />
  </ItemGroup>

while CMake v3.2.1 will produce

  <ItemGroup>
    <Midl Include="path\to\file.idl">
      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <DefaultCharType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Signed</DefaultCharType>
      <DllDataFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">dlldata.c</DllDataFileName>
      <HeaderFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">file.h</HeaderFileName>
      <InterfaceIdentifierFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">file_i.c</InterfaceIdentifierFileName>
      <OutputDirectory Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">include</OutputDirectory>
      <SuppressStartupBanner Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</SuppressStartupBanner>
      <TargetEnvironment Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Win32</TargetEnvironment>
      <TypeLibraryName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">file.tlb</TypeLibraryName>
...
    </Midl>
    <ClCompile Include="path\to\main.cpp" />
  </ItemGroup>
No tags attached.
Issue History
2016-03-02 14:06Dmitry SokolovNew Issue
2016-03-07 11:32Brad KingNote Added: 0040639
2016-06-10 14:29Kitware RobotNote Added: 0042955
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0040639)
Brad King   
2016-03-07 11:32   
Please 'git bisect' history to see when this was regressed.

Any fix to this should also include an update to Tests/VSMidl to cover it with a test.
(0042955)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.