FindCppUnit.cmake 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #
  2. # Find the CppUnit includes and library
  3. #
  4. # This module defines
  5. # CPPUNIT_INCLUDE_DIR, where to find tiff.h, etc.
  6. # CPPUNIT_LIBRARIES, the libraries to link against to use CppUnit.
  7. # CPPUNIT_FOUND, If false, do not try to use CppUnit.
  8. # also defined, but not for general use are
  9. # CPPUNIT_LIBRARY, where to find the CppUnit library.
  10. # CPPUNIT_DEBUG_LIBRARY, where to find the CppUnit library in debug mode.
  11. FIND_PATH(CPPUNIT_INCLUDE_DIR cppunit/TestCase.h
  12. /usr/local/include
  13. /usr/include
  14. )
  15. # With Win32, important to have both
  16. IF(WIN32)
  17. FIND_LIBRARY(CPPUNIT_LIBRARY cppunit
  18. ${CPPUNIT_INCLUDE_DIR}/../lib
  19. /usr/local/lib
  20. /usr/lib)
  21. FIND_LIBRARY(CPPUNIT_DEBUG_LIBRARY cppunitd
  22. ${CPPUNIT_INCLUDE_DIR}/../lib
  23. /usr/local/lib
  24. /usr/lib)
  25. ELSE(WIN32)
  26. # On unix system, debug and release have the same name
  27. FIND_LIBRARY(CPPUNIT_LIBRARY cppunit
  28. ${CPPUNIT_INCLUDE_DIR}/../lib64
  29. ${CPPUNIT_INCLUDE_DIR}/../lib
  30. /usr/local/lib
  31. /usr/lib)
  32. FIND_LIBRARY(CPPUNIT_DEBUG_LIBRARY cppunit
  33. ${CPPUNIT_INCLUDE_DIR}/../lib
  34. ${CPPUNIT_INCLUDE_DIR}/../lib64
  35. /usr/local/lib
  36. /usr/lib)
  37. ENDIF(WIN32)
  38. IF(CPPUNIT_INCLUDE_DIR)
  39. IF(CPPUNIT_LIBRARY)
  40. SET(CPPUNIT_FOUND "YES")
  41. SET(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY} ${CMAKE_DL_LIBS})
  42. SET(CPPUNIT_DEBUG_LIBRARIES ${CPPUNIT_DEBUG_LIBRARY}
  43. ${CMAKE_DL_LIBS})
  44. ENDIF(CPPUNIT_LIBRARY)
  45. ENDIF(CPPUNIT_INCLUDE_DIR)