[CMake] Masm support for Visual Studio generator

Dmitry Bely dmitry.bely at gmail.com
Fri May 22 12:45:16 EDT 2009


On Sat, May 16, 2009 at 7:37 PM, Alexander Neundorf
<a.neundorf-work at gmx.net> wrote:
> On Friday 15 May 2009, Dmitry Bely wrote:
>> On Thu, May 14, 2009 at 11:16 PM, Alexander Neundorf
>>
>> <a.neundorf-work at gmx.net> wrote:
>> > On Thursday 14 May 2009, Dmitry Bely wrote:
>> >> Is it expected to work in Cmake 2.6.4? There is no problem with nmake
>> >> generator but in Visual Studio all .asm files have an empty custom
>> >> build command line.
>> >
>> > I think nobody has tried this yet.
>>
>> Nobody ever tried any assembler with Visual Studio generator?
>
> Yes, I think so.
> We are just now starting to get some feedback on the assembler support.
>
>> > I guess we need your help, ideally patches for the Visual Studio project
>> > generators.
>> > (I don't have Windows around, so I can't really implement that)
>>
>> So hacking .cmake files is not enough. OK. But I am afraid that
>> digging into CMake .cxx sources is not that easy...
>
> but maybe also not that hard :-)
> I would suggest you create a simple hello-world project consisting of only
> once C file with Visual Studio, and then create an identical project, but
> with one additional assembler file. Then compare the project files Visual
> Studio has generated.
> With that information then go into
> CMake/Source/cmGlobalVisualStudio*Generator.cxx abd
> cmLocalVisualStudio*Generator.cxx

Well, in function

cmLocalVisualStudio7GeneratorFCInfo
::cmLocalVisualStudio7GeneratorFCInfo(cmLocalVisualStudio7Generator* lg,
                                      cmTarget& target,
                                      cmSourceFile const& sf,
                                      std::vector<std::string>* configs,
                                      std::string const& dir_max)
(...)

      if(cmCustomCommand const* command = (*sf)->GetCustomCommand())
        {
        this->WriteCustomRule(fout, source.c_str(), *command, fcinfo);
        }
      else if(!fcinfo.FileConfigMap.empty())

I see in debugger that .asm files have no custom command attached
(FileConfigMap is also empty). So custom rule is not generated.

An alternative to custom rule could be project-level

<DefaultToolFile
	FileName="masm.rules"
/>

and

<Tool
	Name="MASM"
/>

but they are not generated also. Any idea what to check next?

- Dmitry Bely


More information about the CMake mailing list