daily pastebin goal
6%
SHARE
TWEET

FindSFML.cmake

a guest Mar 11th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # This script locates the SFML library
  2. # ------------------------------------
  3. #
  4. # Usage
  5. # -----
  6. #
  7. # When you try to locate the SFML libraries, you must specify which modules you want to use (system, window, graphics, network, audio, main).
  8. # If none is given, the SFML_LIBRARIES variable will be empty and you'll end up linking to nothing.
  9. # example:
  10. #   find_package(SFML COMPONENTS graphics window system) // find the graphics, window and system modules
  11. #
  12. # You can enforce a specific version, either MAJOR.MINOR or only MAJOR.
  13. # If nothing is specified, the version won't be checked (i.e. any version will be accepted).
  14. # example:
  15. #   find_package(SFML COMPONENTS ...)     // no specific version required
  16. #   find_package(SFML 2 COMPONENTS ...)   // any 2.x version
  17. #   find_package(SFML 2.4 COMPONENTS ...) // version 2.4 or greater
  18. #
  19. # By default, the dynamic libraries of SFML will be found. To find the static ones instead,
  20. # you must set the SFML_STATIC_LIBRARIES variable to TRUE before calling find_package(SFML ...).
  21. # Since you have to link yourself all the SFML dependencies when you link it statically, the following
  22. # additional variables are defined: SFML_XXX_DEPENDENCIES and SFML_DEPENDENCIES (see their detailed
  23. # description below).
  24. # In case of static linking, the SFML_STATIC macro will also be defined by this script.
  25. # example:
  26. #   set(SFML_STATIC_LIBRARIES TRUE)
  27. #   find_package(SFML 2 COMPONENTS network system)
  28. #
  29. # On Mac OS X if SFML_STATIC_LIBRARIES is not set to TRUE then by default CMake will search for frameworks unless
  30. # CMAKE_FIND_FRAMEWORK is set to "NEVER" for example. Please refer to CMake documentation for more details.
  31. # Moreover, keep in mind that SFML frameworks are only available as release libraries unlike dylibs which
  32. # are available for both release and debug modes.
  33. #
  34. # If SFML is not installed in a standard path, you can use the SFML_ROOT CMake (or environment) variable
  35. # to tell CMake where SFML is.
  36. #
  37. # Output
  38. # ------
  39. #
  40. # This script defines the following variables:
  41. # - For each specified module XXX (system, window, graphics, network, audio, main):
  42. #   - SFML_XXX_LIBRARY_DEBUG:   the name of the debug library of the xxx module (set to SFML_XXX_LIBRARY_RELEASE is no debug version is found)
  43. #   - SFML_XXX_LIBRARY_RELEASE: the name of the release library of the xxx module (set to SFML_XXX_LIBRARY_DEBUG is no release version is found)
  44. #   - SFML_XXX_LIBRARY:         the name of the library to link to for the xxx module (includes both debug and optimized names if necessary)
  45. #   - SFML_XXX_FOUND:           true if either the debug or release library of the xxx module is found
  46. #   - SFML_XXX_DEPENDENCIES:    the list of libraries the module depends on, in case of static linking
  47. # - SFML_LIBRARIES:    the list of all libraries corresponding to the required modules
  48. # - SFML_FOUND:        true if all the required modules are found
  49. # - SFML_INCLUDE_DIR:  the path where SFML headers are located (the directory containing the SFML/Config.hpp file)
  50. # - SFML_DEPENDENCIES: the list of libraries SFML depends on, in case of static linking
  51. #
  52. # example:
  53. #   find_package(SFML 2 COMPONENTS system window graphics audio REQUIRED)
  54. #   include_directories(${SFML_INCLUDE_DIR})
  55. #   add_executable(myapp ...)
  56. #   target_link_libraries(myapp ${SFML_LIBRARIES})
  57.  
  58. # define the SFML_STATIC macro if static build was chosen
  59. if(SFML_STATIC_LIBRARIES)
  60.     add_definitions(-DSFML_STATIC)
  61. endif()
  62.  
  63. # define the list of search paths for headers and libraries
  64. set(FIND_SFML_PATHS
  65.         ${SFML_ROOT}
  66.         $ENV{SFML_ROOT}
  67.         ~/Library/Frameworks
  68.         /Library/Frameworks
  69.         /usr/local
  70.         /usr
  71.         /sw
  72.         /opt/local
  73.         /opt/csw
  74.         /opt)
  75.  
  76. # find the SFML include directory
  77. find_path(SFML_INCLUDE_DIR SFML/Config.hpp
  78.         PATH_SUFFIXES include
  79.         PATHS ${FIND_SFML_PATHS})
  80.  
  81. # check the version number
  82. set(SFML_VERSION_OK TRUE)
  83. if(SFML_FIND_VERSION AND SFML_INCLUDE_DIR)
  84.     # extract the major and minor version numbers from SFML/Config.hpp
  85.     # we have to handle framework a little bit differently:
  86.     if("${SFML_INCLUDE_DIR}" MATCHES "SFML.framework")
  87.         set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/Headers/Config.hpp")
  88.     else()
  89.         set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/SFML/Config.hpp")
  90.     endif()
  91.     FILE(READ "${SFML_CONFIG_HPP_INPUT}" SFML_CONFIG_HPP_CONTENTS)
  92.     STRING(REGEX REPLACE ".*#define SFML_VERSION_MAJOR ([0-9]+).*" "\\1" SFML_VERSION_MAJOR "${SFML_CONFIG_HPP_CONTENTS}")
  93.     STRING(REGEX REPLACE ".*#define SFML_VERSION_MINOR ([0-9]+).*" "\\1" SFML_VERSION_MINOR "${SFML_CONFIG_HPP_CONTENTS}")
  94.     STRING(REGEX REPLACE ".*#define SFML_VERSION_PATCH ([0-9]+).*" "\\1" SFML_VERSION_PATCH "${SFML_CONFIG_HPP_CONTENTS}")
  95.     if (NOT "${SFML_VERSION_PATCH}" MATCHES "^[0-9]+$")
  96.         set(SFML_VERSION_PATCH 0)
  97.     endif()
  98.     math(EXPR SFML_REQUESTED_VERSION "${SFML_FIND_VERSION_MAJOR} * 10000 + ${SFML_FIND_VERSION_MINOR} * 100 + ${SFML_FIND_VERSION_PATCH}")
  99.  
  100.     # if we could extract them, compare with the requested version number
  101.     if (SFML_VERSION_MAJOR)
  102.         # transform version numbers to an integer
  103.         math(EXPR SFML_VERSION "${SFML_VERSION_MAJOR} * 10000 + ${SFML_VERSION_MINOR} * 100 + ${SFML_VERSION_PATCH}")
  104.  
  105.         # compare them
  106.         if(SFML_VERSION LESS SFML_REQUESTED_VERSION)
  107.             set(SFML_VERSION_OK FALSE)
  108.         endif()
  109.     else()
  110.         # SFML version is < 2.0
  111.         if (SFML_REQUESTED_VERSION GREATER 10900)
  112.             set(SFML_VERSION_OK FALSE)
  113.             set(SFML_VERSION_MAJOR 1)
  114.             set(SFML_VERSION_MINOR x)
  115.             set(SFML_VERSION_PATCH x)
  116.         endif()
  117.     endif()
  118. endif()
  119.  
  120. # find the requested modules
  121. set(SFML_FOUND TRUE) # will be set to false if one of the required modules is not found
  122. foreach(FIND_SFML_COMPONENT ${SFML_FIND_COMPONENTS})
  123.     string(TOLOWER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_LOWER)
  124.     string(TOUPPER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_UPPER)
  125.     set(FIND_SFML_COMPONENT_NAME sfml-${FIND_SFML_COMPONENT_LOWER})
  126.  
  127.     # no suffix for sfml-main, it is always a static library
  128.     if(FIND_SFML_COMPONENT_LOWER STREQUAL "main")
  129.         # release library
  130.         find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE
  131.                 NAMES ${FIND_SFML_COMPONENT_NAME}
  132.                 PATH_SUFFIXES lib64 lib
  133.                 PATHS ${FIND_SFML_PATHS})
  134.  
  135.         # debug library
  136.         find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG
  137.                 NAMES ${FIND_SFML_COMPONENT_NAME}-d
  138.                 PATH_SUFFIXES lib64 lib
  139.                 PATHS ${FIND_SFML_PATHS})
  140.     else()
  141.         # static release library
  142.         find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE
  143.                 NAMES ${FIND_SFML_COMPONENT_NAME}-s
  144.                 PATH_SUFFIXES lib64 lib
  145.                 PATHS ${FIND_SFML_PATHS})
  146.  
  147.         # static debug library
  148.         find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG
  149.                 NAMES ${FIND_SFML_COMPONENT_NAME}-s-d
  150.                 PATH_SUFFIXES lib64 lib
  151.                 PATHS ${FIND_SFML_PATHS})
  152.  
  153.         # dynamic release library
  154.         find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE
  155.                 NAMES ${FIND_SFML_COMPONENT_NAME}
  156.                 PATH_SUFFIXES lib64 lib
  157.                 PATHS ${FIND_SFML_PATHS})
  158.  
  159.         # dynamic debug library
  160.         find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG
  161.                 NAMES ${FIND_SFML_COMPONENT_NAME}-d
  162.                 PATH_SUFFIXES lib64 lib
  163.                 PATHS ${FIND_SFML_PATHS})
  164.  
  165.         # choose the entries that fit the requested link type
  166.         if(SFML_STATIC_LIBRARIES)
  167.             if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE)
  168.                 set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE})
  169.             endif()
  170.             if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG)
  171.                 set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG})
  172.             endif()
  173.         else()
  174.             if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE)
  175.                 set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE})
  176.             endif()
  177.             if(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG)
  178.                 set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG})
  179.             endif()
  180.         endif()
  181.     endif()
  182.  
  183.     if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG OR SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
  184.         # library found
  185.         set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND TRUE)
  186.  
  187.         # if both are found, set SFML_XXX_LIBRARY to contain both
  188.         if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
  189.             set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY debug     ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG}
  190.                     optimized ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
  191.         endif()
  192.  
  193.         # if only one debug/release variant is found, set the other to be equal to the found one
  194.         if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
  195.             # debug and not release
  196.             set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG})
  197.             set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY         ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG})
  198.         endif()
  199.         if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG)
  200.             # release and not debug
  201.             set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
  202.             set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY       ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
  203.         endif()
  204.     else()
  205.         # library not found
  206.         set(SFML_FOUND FALSE)
  207.         set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND FALSE)
  208.         set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY "")
  209.         set(FIND_SFML_MISSING "${FIND_SFML_MISSING} SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY")
  210.     endif()
  211.  
  212.     # mark as advanced
  213.     MARK_AS_ADVANCED(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY
  214.             SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE
  215.             SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG
  216.             SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_RELEASE
  217.             SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_STATIC_DEBUG
  218.             SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_RELEASE
  219.             SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DYNAMIC_DEBUG)
  220.  
  221.     # add to the global list of libraries
  222.     set(SFML_LIBRARIES ${SFML_LIBRARIES} "${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY}")
  223. endforeach()
  224.  
  225. # in case of static linking, we must also define the list of all the dependencies of SFML libraries
  226. if(SFML_STATIC_LIBRARIES)
  227.  
  228.     # detect the OS
  229.     if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
  230.         set(FIND_SFML_OS_WINDOWS 1)
  231.     elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
  232.         set(FIND_SFML_OS_LINUX 1)
  233.     elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
  234.         set(FIND_SFML_OS_FREEBSD 1)
  235.     elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
  236.         set(FIND_SFML_OS_MACOSX 1)
  237.     endif()
  238.  
  239.     # start with an empty list
  240.     set(SFML_DEPENDENCIES)
  241.     set(FIND_SFML_DEPENDENCIES_NOTFOUND)
  242.  
  243.     # macro that searches for a 3rd-party library
  244.     macro(find_sfml_dependency output friendlyname)
  245.         # No lookup in environment variables (PATH on Windows), as they may contain wrong library versions
  246.         find_library(${output} NAMES ${ARGN} PATHS ${FIND_SFML_PATHS} PATH_SUFFIXES lib NO_SYSTEM_ENVIRONMENT_PATH)
  247.         if(${${output}} STREQUAL "${output}-NOTFOUND")
  248.             unset(output)
  249.             set(FIND_SFML_DEPENDENCIES_NOTFOUND "${FIND_SFML_DEPENDENCIES_NOTFOUND} ${friendlyname}")
  250.         endif()
  251.     endmacro()
  252.  
  253.     # sfml-system
  254.     list(FIND SFML_FIND_COMPONENTS "system" FIND_SFML_SYSTEM_COMPONENT)
  255.     if(NOT ${FIND_SFML_SYSTEM_COMPONENT} EQUAL -1)
  256.  
  257.         # update the list -- these are only system libraries, no need to find them
  258.         if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD OR FIND_SFML_OS_MACOSX)
  259.             set(SFML_SYSTEM_DEPENDENCIES "pthread")
  260.         endif()
  261.         if(FIND_SFML_OS_LINUX)
  262.             set(SFML_SYSTEM_DEPENDENCIES ${SFML_SYSTEM_DEPENDENCIES} "rt")
  263.         endif()
  264.         if(FIND_SFML_OS_WINDOWS)
  265.             set(SFML_SYSTEM_DEPENDENCIES "winmm")
  266.         endif()
  267.         set(SFML_DEPENDENCIES ${SFML_SYSTEM_DEPENDENCIES} ${SFML_DEPENDENCIES})
  268.     endif()
  269.  
  270.     # sfml-network
  271.     list(FIND SFML_FIND_COMPONENTS "network" FIND_SFML_NETWORK_COMPONENT)
  272.     if(NOT ${FIND_SFML_NETWORK_COMPONENT} EQUAL -1)
  273.  
  274.         # update the list -- these are only system libraries, no need to find them
  275.         if(FIND_SFML_OS_WINDOWS)
  276.             set(SFML_NETWORK_DEPENDENCIES "ws2_32")
  277.         endif()
  278.         set(SFML_DEPENDENCIES ${SFML_NETWORK_DEPENDENCIES} ${SFML_DEPENDENCIES})
  279.     endif()
  280.  
  281.     # sfml-window
  282.     list(FIND SFML_FIND_COMPONENTS "window" FIND_SFML_WINDOW_COMPONENT)
  283.     if(NOT ${FIND_SFML_WINDOW_COMPONENT} EQUAL -1)
  284.  
  285.         # find libraries
  286.         if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD)
  287.             find_sfml_dependency(X11_LIBRARY "X11" X11)
  288.             find_sfml_dependency(LIBXCB_LIBRARIES "XCB" xcb libxcb)
  289.             find_sfml_dependency(X11_XCB_LIBRARY "X11-xcb" X11-xcb libX11-xcb)
  290.             find_sfml_dependency(XCB_RANDR_LIBRARY "xcb-randr" xcb-randr libxcb-randr)
  291.             find_sfml_dependency(XCB_IMAGE_LIBRARY "xcb-image" xcb-image libxcb-image)
  292.         endif()
  293.  
  294.         if(FIND_SFML_OS_LINUX)
  295.             find_sfml_dependency(UDEV_LIBRARIES "UDev" udev libudev)
  296.         endif()
  297.  
  298.         # update the list
  299.         if(FIND_SFML_OS_WINDOWS)
  300.             set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "opengl32" "winmm" "gdi32")
  301.         elseif(FIND_SFML_OS_LINUX)
  302.             set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "GL" ${X11_LIBRARY} ${LIBXCB_LIBRARIES} ${X11_XCB_LIBRARY} ${XCB_RANDR_LIBRARY} ${XCB_IMAGE_LIBRARY} ${UDEV_LIBRARIES})
  303.         elseif(FIND_SFML_OS_FREEBSD)
  304.             set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "GL" ${X11_LIBRARY} ${LIBXCB_LIBRARIES} ${X11_XCB_LIBRARY} ${XCB_RANDR_LIBRARY} ${XCB_IMAGE_LIBRARY} "usbhid")
  305.         elseif(FIND_SFML_OS_MACOSX)
  306.             set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "-framework OpenGL -framework Foundation -framework AppKit -framework IOKit -framework Carbon")
  307.         endif()
  308.         set(SFML_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} ${SFML_DEPENDENCIES})
  309.     endif()
  310.  
  311.     # sfml-graphics
  312.     list(FIND SFML_FIND_COMPONENTS "graphics" FIND_SFML_GRAPHICS_COMPONENT)
  313.     if(NOT ${FIND_SFML_GRAPHICS_COMPONENT} EQUAL -1)
  314.  
  315.         # find libraries
  316.         find_sfml_dependency(FREETYPE_LIBRARY "FreeType" freetype)
  317.         find_sfml_dependency(JPEG_LIBRARY "libjpeg" jpeg)
  318.  
  319.         # update the list
  320.         set(SFML_GRAPHICS_DEPENDENCIES ${FREETYPE_LIBRARY} ${JPEG_LIBRARY})
  321.         set(SFML_DEPENDENCIES ${SFML_GRAPHICS_DEPENDENCIES} ${SFML_DEPENDENCIES})
  322.     endif()
  323.  
  324.     # sfml-audio
  325.     list(FIND SFML_FIND_COMPONENTS "audio" FIND_SFML_AUDIO_COMPONENT)
  326.     if(NOT ${FIND_SFML_AUDIO_COMPONENT} EQUAL -1)
  327.  
  328.         # find libraries
  329.         find_sfml_dependency(OPENAL_LIBRARY "OpenAL" openal openal32)
  330.         find_sfml_dependency(OGG_LIBRARY "Ogg" ogg)
  331.         find_sfml_dependency(VORBIS_LIBRARY "Vorbis" vorbis)
  332.         find_sfml_dependency(VORBISFILE_LIBRARY "VorbisFile" vorbisfile)
  333.         find_sfml_dependency(VORBISENC_LIBRARY "VorbisEnc" vorbisenc)
  334.         find_sfml_dependency(FLAC_LIBRARY "FLAC" FLAC)
  335.  
  336.         # update the list
  337.         set(SFML_AUDIO_DEPENDENCIES ${OPENAL_LIBRARY} ${FLAC_LIBRARY} ${VORBISENC_LIBRARY} ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} ${OGG_LIBRARY})
  338.         set(SFML_DEPENDENCIES ${SFML_DEPENDENCIES} ${SFML_AUDIO_DEPENDENCIES})
  339.     endif()
  340.  
  341. endif()
  342.  
  343. # handle errors
  344. if(NOT SFML_VERSION_OK)
  345.     # SFML version not ok
  346.     set(FIND_SFML_ERROR "SFML found but version too low (requested: ${SFML_FIND_VERSION}, found: ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR}.${SFML_VERSION_PATCH})")
  347.     set(SFML_FOUND FALSE)
  348. elseif(SFML_STATIC_LIBRARIES AND FIND_SFML_DEPENDENCIES_NOTFOUND)
  349.     set(FIND_SFML_ERROR "SFML found but some of its dependencies are missing (${FIND_SFML_DEPENDENCIES_NOTFOUND})")
  350.     set(SFML_FOUND FALSE)
  351. elseif(NOT SFML_FOUND)
  352.     # include directory or library not found
  353.     set(FIND_SFML_ERROR "Could NOT find SFML (missing: ${FIND_SFML_MISSING})")
  354. endif()
  355. if (NOT SFML_FOUND)
  356.     if(SFML_FIND_REQUIRED)
  357.         # fatal error
  358.         message(FATAL_ERROR ${FIND_SFML_ERROR})
  359.     elseif(NOT SFML_FIND_QUIETLY)
  360.         # error but continue
  361.         message("${FIND_SFML_ERROR}")
  362.     endif()
  363. endif()
  364.  
  365. # handle success
  366. if(SFML_FOUND AND NOT SFML_FIND_QUIETLY)
  367.     message(STATUS "Found SFML ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR}.${SFML_VERSION_PATCH} in ${SFML_INCLUDE_DIR}")
  368. endif()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top