Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [ptp-user] eclipse PTP + cmake ( + synchronized projects)

  1. Hi Christoph,

> offered the choice of Makefile Project, GNU Autotools, ...
> ...
> Which should I choose ? None of the choices appears to be a 100% fit.

I'm not that familiar with CMake, but I can give you some general guidelines.  A "makefile project" doesn't necessarily have to call make; it just means that some external tool will be used to build the project.  So, you can swap out the "make" command for a different build command like this.
  1. In the wizard to convert to a C/C++ project, choose Makefile Project for the project type.
  2. Then, open the project properties.
  3. In the C/C++ Build category (under the Builder Settings tab), uncheck "Use default build command" and change the build command from "make" to "cmake" (or "cmake src" or whatever it should be).  
  4. Still in the C/C++ Build category, switch to the "Behavior" tab.  The "Make build targets" here will be appended to the build command depending on the type of build.  So, right now it would execute "cmake all" and "cmake clean" for incremental and clean builds, respectively.  Presumably that's not what you want, so change "all" and "clean" to whatever's appropriate. You can leave those text boxes blank, in fact, but make sure that the check boxes next to them remain checked.

Of course, now "make" isn't getting run anymore -- just cmake.  And (as far as I know) only one build command is supported, so there's no way to trick CDT into executing something like "cmake && gmake".  To do that, you would probably want to write a shell script/Windows batch file.  Then, you could change your build command to "bash my_build_script.sh" or "my_build_script.bat" using the same procedure.

HTH

Jeff

Back to the top