trentforkert / cmake

Experimental CMake with D support
Other
16 stars 2 forks source link

Unable to launch visuald project #17

Closed birsoyo closed 10 years ago

birsoyo commented 10 years ago

VisualD gives the following error when starting the debugger after creating an executable cmake project , similar to the example project in Usage. image

It looks like VisualD just merges "Output Path" field with the "Output File" field. This might as well a VisualD bug, but after investigating both how Visual C++ project are generated in cmake and how VisualD generates its default projects, I think it is better to do the following changes to the VisualD generator.

  1. Don't generate item. Let VisualD set it to default (i.e. currently, it defaults to "$(OutDir)\$(ProjectName).exe"). This has the added benefit of not making exceptions in the visuald project generator for libraries and executables.
  2. item should be generated with something like `Target->GetDirectory()+"/$(ConfigurationName)"`.

I can create a pull request with the above changes.

trentforkert commented 10 years ago

Don't generate item. Let VisualD set it to default (i.e. currently, it defaults to "$(OutDir)\$(ProjectName).exe"). This has the added benefit of not making exceptions in the visuald project generator for libraries and executables.

Problem is that a user may set a target's OUTPUT_NAME property, and CMake needs to respect that in generating project files. Letting VisualD use the default for a variable means CMake isn't in control of that variable.

item should be generated with something like Target->GetDirectory()+"/$(ConfigurationName)"

I think what will need to be done is to use this->Target->GetLocation() as I currently do, but split the name between <exename> and <outdir> (it is possible that Target->GetDirectory() and Target->??? could get that information pre-split). I seem to remember needing to do it the way I have it currently to get the executable (or library) where CMake expects it to go. Perhaps VisualD has fixed that bug, but in the process broke my workaround.

If you want to get it working and submit a pull request, it would be appreciated. The relevant code is in the method cmVisualStudio10TargetGenerator::WriteDProject.