FindBox2D.cmake 963 B

123456789101112131415161718192021222324252627282930
  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_DIRS "${BOX2D_INCLUDE_DIR}")
  20. SET(BOX2D_LIBRARIES "${BOX2D_LIBRARY}")
  21. # handle the QUIETLY and REQUIRED arguments and set BOX2D_FOUND to TRUE if
  22. # all listed variables are TRUE
  23. INCLUDE(FindPackageHandleStandardArgs)
  24. FIND_PACKAGE_HANDLE_STANDARD_ARGS(Box2D DEFAULT_MSG BOX2D_LIBRARY BOX2D_INCLUDE_DIR)