Findfuzzylite.cmake 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #.rst:
  2. # FindFuzzylite
  3. # --------
  4. #
  5. # Locate FuzzyLite library
  6. #
  7. #=============================================================================
  8. # Copyright 2003-2009 Kitware, Inc.
  9. # Copyright 2012 Benjamin Eikel
  10. # Copyright 2014 Mikhail Paulyshka
  11. #
  12. # Distributed under the OSI-approved BSD License (the "License");
  13. # see accompanying file kitware license.txt for details.
  14. #
  15. # This software is distributed WITHOUT ANY WARRANTY; without even the
  16. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  17. # See the License for more information.
  18. #=============================================================================
  19. # (To distribute this file outside of CMake, substitute the full
  20. # License text for the above reference.)
  21. find_path(fuzzylite_INCLUDE_DIR
  22. fl/fuzzylite.h
  23. fuzzylite/fuzzylite.h
  24. HINTS
  25. ENV FLDIR
  26. PATH_SUFFIXES
  27. fl
  28. include/fl
  29. include/fuzzylite
  30. include
  31. )
  32. if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  33. set(VC_LIB_PATH_SUFFIX lib/x64)
  34. else()
  35. set(VC_LIB_PATH_SUFFIX lib/x86)
  36. endif()
  37. find_library(fuzzylite_LIBRARY
  38. NAMES
  39. fuzzylite
  40. HINTS
  41. ENV FLDIR
  42. PATH_SUFFIXES
  43. dynamic
  44. lib
  45. ${VC_LIB_PATH_SUFFIX}
  46. )
  47. set(fuzzylite_LIBRARIES ${fuzzylite_LIBRARY})
  48. set(fuzzylite_INCLUDE_DIRS ${fuzzylite_INCLUDE_DIR})
  49. include(FindPackageHandleStandardArgs)
  50. FIND_PACKAGE_HANDLE_STANDARD_ARGS(fuzzylite
  51. REQUIRED_VARS fuzzylite_LIBRARIES fuzzylite_INCLUDE_DIRS)
  52. if (NOT TARGET "fuzzylite::fuzzylite" AND fuzzylite_FOUND)
  53. add_library(fuzzylite::fuzzylite UNKNOWN IMPORTED)
  54. set_target_properties(fuzzylite::fuzzylite PROPERTIES
  55. INTERFACE_INCLUDE_DIRECTORIES "${fuzzylite_INCLUDE_DIR}")
  56. set_target_properties(fuzzylite::fuzzylite PROPERTIES
  57. IMPORTED_LOCATION "${fuzzylite_LIBRARY}")
  58. endif()
  59. mark_as_advanced(fuzzylite_LIBRARY fuzzylite_INCLUDE_DIR)