Ticket #2154 (closed defect: fixed)

Opened 8 months ago

Last modified 2 months ago

Bad Build-Commands in makegdal80.sln

Reported by: Geoheber Assigned to: warmerdam
Priority: low Milestone: 1.5.1
Component: ConfigBuild Version: unspecified
Severity: normal Keywords: Visual Studio
Cc: ilucena, mloskot

Description

Visual Studio throws error if building makegdal80.sln. The reason seems to be the following bad-formed commands where the newline-characters are lost and the different commands are positioned after another in one line: Choose Properties - Configuration Properties - NMake. The commands for "Build Command Line","Rebuild All Command Line" and "Clean Command Line" have the issue described above (One must click on "..." to see it)

Change History

01/14/08 12:15:22 changed by warmerdam

  • cc set to ilucena, mloskot.
  • component changed from default to ConfigBuild.

01/14/08 12:41:08 changed by ilucena

We have problem with newline-characters before due to unix-dos CRLF stuff on SVN. This particular section of the XML file uses one non-standard newline character. Two solutions: recreate the file using makegdal_gen.bat or change the newlines to "&&" so you can have all commands in one line, e.g.:

nmake makefile.vc clean && nmake makefile.vc install

01/15/08 10:37:40 changed by warmerdam

Ivan,

Are the problems with text convensions all fixed in trunk and 1.5 branch? I want to ensure that the .sln files shipped in 1.5.1 do not have this problem.

01/16/08 09:56:44 changed by ilucena

  • status changed from new to closed.
  • resolution set to fixed.

I change makegdal_gen.bat to create the project files build options in just one line:

cd $(ProjectDir?) && nmake -f makefile.vc && nmake -f makefile.vc install

I believe that it will prevent newline conversion problem in the future.

I recreate the VC2003 and VC2005 projects files as in:

C:\Dev\gdal>makegdal_gen Usage: makegdal_gen "MS Visual C++ version" > makegdalNN.vcproj Examples:

makegdal_gen 7.10 > makegdal71.vcproj makegdal_gen 8.00 > makegdal80.vcproj

I committed those three files (makegdal_gen.bat, makegdal71.vcproj, makegdal80.vcproj) to the trunk; I got the two .vcproj from SVN to another computer; I tested each one on their respective versions of Visual Studio and everything works fine.

Finally one note of advise: I suggest we should remove the .sln files from the trunk. They are not generated by the batch script; They are automatically generated by Visual Studio when you load the .vcproj; Users that are developing in C++, C#, VB.Net can also add the GDAL .vcproj to their existent projects without the .sln files.

Ivan

07/12/08 08:00:03 changed by mloskot

Ivan,

Debug configuration of VC++ project files actually executed non-debug build because of lack of DEBUG=1 flag in commands. So, I applied a tiny fix to makegdal_gen.bat (r14896) and manually fixed makegdal80.vcproj file (r14897). AFAIU, the latter should be made by project file generation using patched makegdal_gen.bat, but I wasn't sure.

Could you please confirm if my fix is correct and I can safely regenerate VC++ project files?

-- Mateusz

07/12/08 08:21:20 changed by mloskot

One more fix, support for MSVC_VER flag set according to requested VC++ version (r14898). Now, nmake commands are generated this way:

  • Debug
    nmake -f makefile.vc MSVC_VER=XXXX DEBUG=1
    
  • Release
    nmake -f makefile.vc MSVC_VER=XXXX
    

where possible XXXX values are 1200, 1300, 1310, 1400, 1500.

Ivan, I hope it's OK.

07/13/08 20:29:58 changed by ilucena

I personally like to add those two options direct to nmake.opt but I think that your approach differentiating "Release" from "Debug" options is great for the consistency of the Visual Studio way of doing things. I will take a look.