[Cmake] Adding suffixes to debug/release builds (Bug?)

Reinhold Füreder R.Fureder at exeter.ac.uk
Wed Apr 2 11:41:10 EST 2003


Hi Bill et al,

According to your e-mail
(http://www.cmake.org/pipermail/cmake/2003-January/001162.html; see
below) I tried to distinguish the libs between debug and release builds.
But for my MSVC 6.0, CMake 1.6.5 combination this does not work as
expected.

...
IF(WIN32)
  TARGET_LINK_LIBRARIES(SampleCPPTest debug
    SampleVTKPolyData
    ${CPPUNIT_DEBUG_LIBRARIES}
  )

  TARGET_LINK_LIBRARIES(SampleCPPTest optimized
    SampleVTKPolyData
    ${CPPUNIT_LIBRARIES}
  )
ELSE(WIN32)
  TARGET_LINK_LIBRARIES(SampleCPPTest
    SampleVTKPolyData
    ${CPPUNIT_LIBRARIES}
  )
ENDIF(WIN32)
...

The above always adds both versions to the libraries of my target!

Thanks,
	Reinhold

P.S.: Could you please post answers to my e-mail address as well since I
am not a subscriber of the mailing list? r.fureder at exeter.ac.uk

>>>> Original Mail
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
That you can do like this:
IF(WIN32)
  TARGET_LINK_LIBRARIES(foo debug barD)
  TARGET_LINK_LIBRARIES(foo optimized bar)
ELSE(WIN32)
  TARGET_LINK_LIBRARIES(foo  bar)
ENDIF(WIN32)
-Bill
At 06:21 PM 1/29/2003 +0100, NTR wrote:
>Hi again,
>
>how about when one wants to link the four different libraries generated
by
>CMake to Debug or Release libraries accordingly e.g. "foo" has the four
>libraries something like:
>foo - Win32 MinSizeRel" (based on "Win32 (x86) Static Library")
-
>links to bar.lib
>foo - Win32 Release" (based on "Win32 (x86) Static Library")
-
>links to bar.lib
>foo - Win32 RelWithDebInfo" (based on "Win32 (x86) Static Library")  -
links
>to barD.lib
>foo - Win32 Debug" (based on "Win32 (x86) Static Library")
-
>links to barD.lib
>
>Regards,
>Niels
>

------------------------
Reinhold Füreder
School of Engineering and Computer Science
University of Exeter, UK




More information about the CMake mailing list