FindBox2D.cmake 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. # source: http://breathe.git.sourceforge.net
  2. #
  3. # Locate Box2D library
  4. # This module defines
  5. # BOX2D_LIBRARY, the name of the library to link against
  6. # BOX2D_FOUND, if false, do not try to link to Box2D
  7. # BOX2D_INCLUDE_DIR, where to find Box2D headers
  8. #
  9. # Created by Sven-Hendrik Haase. Based on the FindZLIB.cmake module.
  10. IF(BOX2D_INCLUDE_DIR)
  11. # Already in cache, be silent
  12. SET(BOX2D_FIND_QUIETLY TRUE)
  13. ENDIF(BOX2D_INCLUDE_DIR)
  14. FIND_PATH(BOX2D_INCLUDE_DIR Box2D/Box2D.h)
  15. SET(BOX2D_NAMES box2d Box2d BOX2D Box2D)
  16. FIND_LIBRARY(BOX2D_LIBRARY NAMES ${BOX2D_NAMES})
  17. MARK_AS_ADVANCED(BOX2D_LIBRARY BOX2D_INCLUDE_DIR)
  18. # Per-recommendation
  19. SET(BOX2D_INCLUDE_DIR "/usr/local/include/")
  20. SET(BOX2D_LIBRARIE "/usr/local/lib/")
  21. SET(BOX2D_INCLUDE_DIRS "${BOX2D_INCLUDE_DIR}")
  22. SET(BOX2D_LIBRARIES "${BOX2D_LIBRARY}")
  23. # handle the QUIETLY and REQUIRED arguments and set BOX2D_FOUND to TRUE if
  24. # all listed variables are TRUE
  25. INCLUDE(FindPackageHandleStandardArgs)
  26. FIND_PACKAGE_HANDLE_STANDARD_ARGS(Box2D DEFAULT_MSG BOX2D_LIBRARY BOX2D_INCLUDE_DIR)