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

Bitter, Ingmar (NIH/CC/DRD) IBitter at cc.nih.gov
Wed Apr 2 13:21:31 EST 2003


You need to put the degug/optimized keyword in front of each library.

  TARGET_LINK_LIBRARIES(SampleCPPTest 
    SampleVTKPolyData
    Optimized libfoo libbar debug libbard libfood
  )

there is some sort of foreach loop thing that you can probably use toi
prepend each entry in your ${CPPUNIT_DEBUG_LIBRARIES} with debug and each in

${CPPUNIT_LIBRARIES} with optimized.

-Ingmar

-----Original Message-----
From: Reinhold Füreder [mailto:R.Fureder at exeter.ac.uk] 
Sent: Wednesday, April 02, 2003 11:41 AM
To: cmake at public.kitware.com
Cc: bill.hoffman at kitware.com
Subject: [Cmake] Adding suffixes to debug/release builds (Bug?)

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

_______________________________________________
Cmake mailing list
Cmake at public.kitware.com
http://public.kitware.com/mailman/listinfo/cmake



More information about the CMake mailing list