RE: [CMake] FindCppUnit

2006-10-05 Thread Kedzierski, Artur CIV NAVSURFWARCENDIV CORONA
Thank You Anton. Actually, I wrote something similar
this morning. I've used FindBoost.cmake as an example. However,
I'll use your idea of setting CPPUNIT_DEBUG_LIBRARY in addition
to CPPUNIT_LIBRARY.
Thank You.


--
Artur Kedzierski

-Original Message-
From: Anton Deguet [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 05, 2006 8:54
To: Kedzierski, Artur CIV NAVSURFWARCENDIV CORONA
Cc: CMake Mailing List
Subject: Re: [CMake] FindCppUnit

I have the following which works on Unix systems but requires manual
input on Windows:

#
# Find the CppUnit includes and library
#
# This module defines
# CPPUNIT_INCLUDE_DIR, where to find tiff.h, etc.
# CPPUNIT_LIBRARIES, the libraries to link against to use CppUnit.
# CPPUNIT_FOUND, If false, do not try to use CppUnit.

# also defined, but not for general use are
# CPPUNIT_LIBRARY, where to find the CppUnit library.
# CPPUNIT_DEBUG_LIBRARY, where to find the CppUnit library in debug
mode.

FIND_PATH(CPPUNIT_INCLUDE_DIR cppunit/TestCase.h
  /usr/local/include
  /usr/include
)

# With Win32, important to have both
IF(WIN32)
  FIND_LIBRARY(CPPUNIT_LIBRARY cppunit
   ${CPPUNIT_INCLUDE_DIR}/../lib
   /usr/local/lib
   /usr/lib)
  FIND_LIBRARY(CPPUNIT_DEBUG_LIBRARY cppunitd
   ${CPPUNIT_INCLUDE_DIR}/../lib
   /usr/local/lib
   /usr/lib)
ELSE(WIN32)
  # On unix system, debug and release have the same name
  FIND_LIBRARY(CPPUNIT_LIBRARY cppunit
   ${CPPUNIT_INCLUDE_DIR}/../lib
   /usr/local/lib
   /usr/lib)
  FIND_LIBRARY(CPPUNIT_DEBUG_LIBRARY cppunit
   ${CPPUNIT_INCLUDE_DIR}/../lib
   /usr/local/lib
   /usr/lib)
ENDIF(WIN32)

IF(CPPUNIT_INCLUDE_DIR)
  IF(CPPUNIT_LIBRARY)
SET(CPPUNIT_FOUND YES)
SET(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY} ${CMAKE_DL_LIBS})
SET(CPPUNIT_DEBUG_LIBRARIES ${CPPUNIT_DEBUG_LIBRARY}
${CMAKE_DL_LIBS})
  ENDIF(CPPUNIT_LIBRARY)
ENDIF(CPPUNIT_INCLUDE_DIR)





On Wed, 2006-10-04 at 13:28 -0700, Kedzierski, Artur CIV
NAVSURFWARCENDIV CORONA wrote:
   With CppUnit being popular for unit testing, does
 anybody have a FindCppUnit.cmake that would locate it?
 
 --
 Artur Kedzierski
 ___
 CMake mailing list
 CMake@cmake.org
 http://www.cmake.org/mailman/listinfo/cmake
-- 
Anton Deguet [EMAIL PROTECTED]
ERC CISST Johns Hopkins University


smime.p7s
Description: S/MIME cryptographic signature
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] FindCppUnit

2006-10-05 Thread Anton Deguet
I have the following which works on Unix systems but requires manual
input on Windows:

#
# Find the CppUnit includes and library
#
# This module defines
# CPPUNIT_INCLUDE_DIR, where to find tiff.h, etc.
# CPPUNIT_LIBRARIES, the libraries to link against to use CppUnit.
# CPPUNIT_FOUND, If false, do not try to use CppUnit.

# also defined, but not for general use are
# CPPUNIT_LIBRARY, where to find the CppUnit library.
# CPPUNIT_DEBUG_LIBRARY, where to find the CppUnit library in debug
mode.

FIND_PATH(CPPUNIT_INCLUDE_DIR cppunit/TestCase.h
  /usr/local/include
  /usr/include
)

# With Win32, important to have both
IF(WIN32)
  FIND_LIBRARY(CPPUNIT_LIBRARY cppunit
   ${CPPUNIT_INCLUDE_DIR}/../lib
   /usr/local/lib
   /usr/lib)
  FIND_LIBRARY(CPPUNIT_DEBUG_LIBRARY cppunitd
   ${CPPUNIT_INCLUDE_DIR}/../lib
   /usr/local/lib
   /usr/lib)
ELSE(WIN32)
  # On unix system, debug and release have the same name
  FIND_LIBRARY(CPPUNIT_LIBRARY cppunit
   ${CPPUNIT_INCLUDE_DIR}/../lib
   /usr/local/lib
   /usr/lib)
  FIND_LIBRARY(CPPUNIT_DEBUG_LIBRARY cppunit
   ${CPPUNIT_INCLUDE_DIR}/../lib
   /usr/local/lib
   /usr/lib)
ENDIF(WIN32)

IF(CPPUNIT_INCLUDE_DIR)
  IF(CPPUNIT_LIBRARY)
SET(CPPUNIT_FOUND YES)
SET(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY} ${CMAKE_DL_LIBS})
SET(CPPUNIT_DEBUG_LIBRARIES ${CPPUNIT_DEBUG_LIBRARY}
${CMAKE_DL_LIBS})
  ENDIF(CPPUNIT_LIBRARY)
ENDIF(CPPUNIT_INCLUDE_DIR)





On Wed, 2006-10-04 at 13:28 -0700, Kedzierski, Artur CIV
NAVSURFWARCENDIV CORONA wrote:
   With CppUnit being popular for unit testing, does
 anybody have a FindCppUnit.cmake that would locate it?
 
 --
 Artur Kedzierski
 ___
 CMake mailing list
 CMake@cmake.org
 http://www.cmake.org/mailman/listinfo/cmake
-- 
Anton Deguet [EMAIL PROTECTED]
ERC CISST Johns Hopkins University
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[CMake] FindCppUnit

2006-10-04 Thread Kedzierski, Artur CIV NAVSURFWARCENDIV CORONA
With CppUnit being popular for unit testing, does
anybody have a FindCppUnit.cmake that would locate it?

--
Artur Kedzierski


smime.p7s
Description: S/MIME cryptographic signature
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake