AW: [Cmake] CMake 1.8.2: Visual Studio 6 library postfix
Andy Cedilnik
andy.cedilnik at kitware.com
Mon, 02 Feb 2004 10:44:58 -0500
Hi,
A while ago I modified Ken's debug postfix for Visual Studio 7 and add
support to 6. It works like this. In your project add the following:
SET(CMAKE_DEBUG_POSTFIX "d" CACHE INTERNAL "" FORCE)
After that all targets will have d when building debug mode.
This should work in CMake 1.8.3 (latest release).
Andy
On Mon, 2004-02-02 at 10:22, Stefan Kowski wrote:
> Hi,
>
> > > I posted a question for library naming with VS6 last week, but I assume
> > > there is no solution for my problem. Therefore a suggestion: is
> > it possible
> > > to extend the ADD_LIBRARY() command to accept different names for the
> > > target?
> > >
> > > Example: ADD_LIBRARY(debug TestLibd optimized TestLib SHARED <...>)
> > >
> > > This different names can then be used to generate the .dsp files.
> >
> > A what about definition special variable called for example "DEBUG_FLAG"
> >
> > SET(DEBUG_FLAG "d") ... define only in the case of debug version
> >
> > ADD_LIBRARY(TestLib${DEBUG_FLAG} SHARED <...>)
>
> I already do this for the NMake generator, e.g.
>
> IF(WIN32)
> IF(CMAKE_BUILD_TYPE MATCHES "Debug")
> SET(PPVM_LIB_SUFFIX "sd")
> SET(PPVM_DLL_SUFFIX "d")
> ELSE(CMAKE_BUILD_TYPE MATCHES "Debug")
> SET(PPVM_LIB_SUFFIX "s")
> SET(PPVM_DLL_SUFFIX "")
> ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug")
> ELSE(WIN32)
> SET(PPVM_LIB_SUFFIX "")
> SET(PPVM_DLL_SUFFIX "")
> ENDIF(WIN32)
>
> SET(TARGET_TESTLIB TestLib${PPVM_LIB_SUFFIX})
> ADD_LIBRARY(${TARGET_TESTLIB} source/TestLib.cpp)
>
> but unfortunately I cannot do this if I generate Visual Studio .dsp files.
> The .dsp generator does not have the build type available so the names of
> the Debug, Release, RelWithDebug etc. targets are always the same.
>
> Greetings,
> Stefan
>
> _______________________________________________
> Cmake mailing list
> Cmake at www.cmake.org
> http://www.cmake.org/mailman/listinfo/cmake