wheeler

FindCppUnit.cmake

Oct 26th, 2014
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 0.97 KB | None | 0 0
  1. # http://www.cmake.org/pipermail/cmake/2006-October/011446.html
  2. #
  3. # Find the CppUnit includes and library
  4. #
  5. # This module defines
  6. # CPPUNIT_INCLUDE_DIRS, where to find tiff.h, etc.
  7. # CPPUNIT_LIBRARIES, the libraries to link against to use CppUnit.
  8. # CPPUNIT_FOUND, If false, do not try to use CppUnit.
  9.  
  10. INCLUDE(FindPkgConfig)
  11. PKG_CHECK_MODULES(CPPUNIT "cppunit")
  12. IF(NOT CPPUNIT_FOUND)
  13.  
  14. FIND_PATH(CPPUNIT_INCLUDE_DIRS cppunit/TestCase.h
  15.   /usr/local/include
  16.   /usr/include
  17. )
  18.  
  19. FIND_LIBRARY(CPPUNIT_LIBRARIES cppunit
  20.            ${CPPUNIT_INCLUDE_DIRS}/../lib
  21.            /usr/local/lib
  22.            /usr/lib)
  23.  
  24. IF(CPPUNIT_INCLUDE_DIRS)
  25.   IF(CPPUNIT_LIBRARIES)
  26.     SET(CPPUNIT_FOUND "YES")
  27.     SET(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARIES} ${CMAKE_DL_LIBS})
  28.   ENDIF(CPPUNIT_LIBRARIES)
  29. ENDIF(CPPUNIT_INCLUDE_DIRS)
  30.  
  31. INCLUDE(FindPackageHandleStandardArgs)
  32. FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS)
  33. ENDIF(NOT CPPUNIT_FOUND)
Advertisement
Add Comment
Please, Sign In to add comment