Author Topic: associating new build tool with file extension or specific project file  (Read 2052 times)

jcbikeski

  • New Community Member
  • Posts: 2
  • Hero Points: 0
I've added a new build tool for Cython to translate .pyx files to .cpp files.   I have a project that is mainly a C++ project but want to have the build system automatically call the Cython tool on the .pyx file then compile the resulting .cpp file.   I can't find a way to associate .pyx files in general with this new tool nor associate a specific project source file with the new tool.

Thanks for any tips
John

Dennis

  • Senior Community Member
  • Posts: 3965
  • Hero Points: 517
We have support for build rules, however the GUI doesn't let you create them (that is a long-standing TODO).  You can manually add a build rule to your project file (Place it just before the </Project> or the <CompatibleVersions> at the bottom of the file.

Here is an example, except that I don't have any idea what the command line should be for your tool.  You will need to have the ".pyx" files in your project file list.

Code: [Select]
    <Rules Name="Compile">
        <Rule
            InputExts="*.pyx"
            OutputExts="*.cpp"
            LinkObject="0">
            <Exec CmdLine='"cython" -o "%bd" "%f"'/>
        </Rule>
    </Rules>

jcbikeski

  • New Community Member
  • Posts: 2
  • Hero Points: 0
Thanks! That got me going.