FindCppUnit.cmake 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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}/../lib
  29. /usr/local/lib
  30. /usr/lib)
  31. FIND_LIBRARY(CPPUNIT_DEBUG_LIBRARY cppunit
  32. ${CPPUNIT_INCLUDE_DIR}/../lib
  33. /usr/local/lib
  34. /usr/lib)
  35. ENDIF(WIN32)
  36. IF(CPPUNIT_INCLUDE_DIR)
  37. IF(CPPUNIT_LIBRARY)
  38. SET(CPPUNIT_FOUND "YES")
  39. SET(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY} ${CMAKE_DL_LIBS})
  40. SET(CPPUNIT_DEBUG_LIBRARIES ${CPPUNIT_DEBUG_LIBRARY}
  41. ${CMAKE_DL_LIBS})
  42. ENDIF(CPPUNIT_LIBRARY)
  43. ENDIF(CPPUNIT_INCLUDE_DIR)