cmake_modules/FindSparkle.cmake
changeset 8657 3a957233f459
parent 7933 223b3a195474
child 8667 f93cc19d8b98
equal deleted inserted replaced
8655:9fa380a18a65 8657:3a957233f459
     1 ### Hedgewars
     1 # Find Sparkle.framework
     2 
     2 #
     3 # - Try to find the Sparkle framework
       
     4 # Once done this will define
     3 # Once done this will define
     5 #
       
     6 #  SPARKLE_FOUND - system has Sparkle
     4 #  SPARKLE_FOUND - system has Sparkle
     7 #  SPARKLE_INCLUDE_DIR - the Sparkle include directory
     5 #  SPARKLE_INCLUDE_DIR - the Sparkle include directory
     8 #  SPARKLE_LIBRARY - The library needed to use Sparkle
     6 #  SPARKLE_LIBRARY - The library needed to use Sparkle
     9 # Copyright (c) 2009, Vittorio Giovara, <vittorio.giovara@gmail.com>
     7 # Copyright (c) 2009, Vittorio Giovara, <vittorio.giovara@gmail.com>
    10 #
     8 #
    11 # Redistribution and use is allowed according to the terms of a Creative Commons license.
     9 # Distributed under the OSI-approved BSD License (the "License");
    12 # For details see http://creativecommons.org/licenses/by-sa/3.0/
    10 # see accompanying file Copyright.txt for details.
    13 # original version of this module was derived from Richard Laerkaeng, <richard@goteborg.utfors.se>
    11 #
       
    12 # This software is distributed WITHOUT ANY WARRANTY; without even the
       
    13 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
       
    14 # See the License for more information.
    14 
    15 
       
    16 include(FindPackageHandleStandardArgs)
    15 
    17 
    16 include (CheckLibraryExists)
       
    17 find_path(SPARKLE_INCLUDE_DIR Sparkle.h)
    18 find_path(SPARKLE_INCLUDE_DIR Sparkle.h)
    18 find_library(SPARKLE_LIBRARY NAMES Sparkle)
    19 find_library(SPARKLE_LIBRARY NAMES Sparkle)
    19 
    20 
    20 if (SPARKLE_INCLUDE_DIR AND SPARKLE_LIBRARY)
    21 find_package_handle_standard_args(Sparkle DEFAULT_MSG SPARKLE_INCLUDE_DIR SPARKLE_LIBRARY)
    21    set(SPARKLE_FOUND TRUE)
    22 mark_as_advanced(SPARKLE_INCLUDE_DIR SPARKLE_LIBRARY)
    22 else ()
       
    23    set(SPARKLE_FOUND FALSE)
       
    24 endif ()
       
    25 
    23 
    26 if (SPARKLE_FOUND)
       
    27    if (NOT SPARKLE_FIND_QUIETLY)
       
    28       message(STATUS "Found Sparkle: ${SPARKLE_LIBRARY}")
       
    29    endif ()
       
    30 else ()
       
    31    if (SPARKLE_FIND_REQUIRED)
       
    32       message(FATAL_ERROR "Could NOT find Sparkle framework")
       
    33    else ()
       
    34       if (NOT SPARKLE_FIND_QUIETLY)
       
    35          message(STATUS "Could NOT find Sparkle framework, autoupdate feature will be disabled")
       
    36       endif()
       
    37    endif ()
       
    38 endif ()
       
    39