[CMake] Cmake 2.2.2 with Visual Studio 6. Bug?

Daniel Tourde ted at foi.se
Thu Nov 24 08:07:13 EST 2005


Hello Alexander, 


Thank you very much for your answer. It solved indeed the problem but an other 
one appeared:

Everything compiles fine but at one given moment, VS6 complains that the 
linker cannot link to libted.lib (libted being the name of my 'project'). I 
checked what had been built and I found a libted.dll... What do you think 
about that? What am I supposed to do now?

		Daniel

> > We have access to 2 development environments:
> > - Kdevelop 3.2.1 (KDE 3.4.1, Gentoo Linux)
> > - M$ Visual Studio 6
> > We decided to use cmake, considering the flexibility it offers in terms
> > of management of Makefiles and other 'niceties' of this kind.
> > Kdevelop 3.2.1 requires cmake 2.2. To test the concepts, I use the
> > basic C++ library template using cmake present in KDevelop (a basic
> > 'hello world!' library based program). I can send the code if required.
> > Then I transfer the files to Windows, use CMakeSetup 2.2.2 to convert
> > the CMakeList.txt files there and try to open the project under VS6 to
> > compile it. This is where the problems start...
> >
> > Here is what I get:
> > - No problems to open the project
> > - However, when I compile it I get the following:
> >   Command line error D2021: invalid numeric argument '/Wall'
> >   Error executing cl.exe
> > When I remove Wall from the CMakeList.txt file, I get other problems of
> > the same type. It seems that somehow, Unix GCC flags are still present,
> > haunting VS6...
> >
> > So, have I done anything wrong?
> > Is it a Cmake 2.2.2 bug?
> > Isn't VS6 supported anymore?
> > Is it a bug of VS6?
>
> It's a problem of the CMakeLists.txt coming with the kdevelop template
> project. You have to correct the CMakeLists.txt.
> It contains a line like the following:
>
> #add definitions, compiler switches, etc.
> ADD_DEFINITIONS(-Wall -O2)
>
> This has to be made conditionally, e.g. as a simple test:
>
> IF (WIN32)
>    ADD_DEFINITIONS( ...whatever you want... )
> ELSE (WIN32) # not windows, but e.g. linux
>    ADD_DEFINITIONS(-Wall -O2)
> ENDIF (WIN32)
>
> I'll fix the templates in kdevelop, but this won't get release before KDE
> 3.5.1.
>
> Bye
> Alex

-- 
**********************************************************************
Daniel TOURDE                            E-mail : daniel.tourde at foi.se
                                            Tel : +46 (0)8-55 50 32 12
                                            Fax : +46 (0)8-55 50 30 68
                                       Cellular :  +46 (0)70-849 93 40
FOI, Swedish Defence Research Agency; Systemteknik
Dept. of Wind Energy and Aviation Environmental Research
SE-164 90 Stockholm, Sweden
**********************************************************************


More information about the CMake mailing list