1 ##############################################################################     2 # @file  FindGMock.cmake     3 # @brief Find Google Mock package.     5 # @par Input variables:     8 #     @tp @b GMock_DIR @endtp     9 #     <td>The Google Mock package files are searched under the specified    10 #         root directory. If they are not found there, the default search    11 #         paths are considered. This variable can also be set as environment    15 #     @tp @b GMOCK_DIR @endtp    16 #     <td>Alternative environment variable for @p GMock_DIR.</td>    19 #     @tp @b GMock_SHARED_LIBRARIES @endtp    20 #     <td>Forces this module to search for shared libraries.    21 #         Otherwise, static libraries are preferred.</td>    25 # @par Output variables:    28 #     @tp @b GMock_FOUND @endtp    29 #     <td>Whether the package was found and the following CMake variables are valid.</td>    32 #     @tp @b GMock_INCLUDE_DIR @endtp    33 #     <td>Package include directories.</td>    36 #     @tp @b GMock_INCLUDES @endtp    37 #     <td>Include directories including prerequisite libraries.</td>    40 #     @tp @b GMock_LIBRARY @endtp    41 #     <td>Package libraries.</td>    44 #     @tp @b GMock_LIBRARIES @endtp    45 #     <td>Package ibraries and prerequisite libraries.</td>    49 # @ingroup CMakeFindModules    50 ##############################################################################    52 #=============================================================================    53 # Copyright 2011-2012 University of Pennsylvania    54 # Copyright 2013-2016 Andreas Schuh <andreas.schuh.84@gmail.com>    56 # Distributed under the OSI-approved BSD License (the "License");    57 # see accompanying file Copyright.txt for details.    59 # This software is distributed WITHOUT ANY WARRANTY; without even the    60 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.    61 # See the License for more information.    62 #=============================================================================    63 # (To distribute this file outside of CMake, substitute the full    64 #  License text for the above reference.)    66 # ----------------------------------------------------------------------------    70     set (GMock_DIR 
"$ENV{GMOCK_DIR}" CACHE PATH 
"Installation prefix for Google Mock.")
    72     set (GMock_DIR 
"$ENV{GMock_DIR}" CACHE PATH 
"Installation prefix for Google Mock.")
    78 if (GMock_SHARED_LIBRARIES)
    92 # ----------------------------------------------------------------------------   100       PATH_SUFFIXES 
"include/gmock"   101       DOC           
"Include directory for Google Mock."   110       DOC           
"Link library for Google Mock (gmock)."   119       HINTS ENV C_INCLUDE_PATH ENV CXX_INCLUDE_PATH
   120       DOC   
"Include directory for Google Mock."   126       HINTS ENV LD_LIBRARY_PATH
   127       DOC   
"Link library for Google Mock (gmock)."   132 mark_as_advanced (GMock_INCLUDE_DIR)
   133 mark_as_advanced (GMock_LIBRARY)
   135 # ----------------------------------------------------------------------------   136 # prerequisite libraries   140 # ----------------------------------------------------------------------------   141 # reset CMake variables   144 # ----------------------------------------------------------------------------
   145 # aliases / backwards compatibility
   148 # ----------------------------------------------------------------------------   149 # handle the QUIETLY and REQUIRED arguments and set *_FOUND to TRUE   150 # if all listed variables are found or TRUE   151 include (FindPackageHandleStandardArgs)
   153 find_package_handle_standard_args (
   162 # ----------------------------------------------------------------------------   164 if (NOT GMock_DIR AND GMock_FOUND)   165   string (REGEX REPLACE "include(/gmock)?/?
" "" GMock_PREFIX "${GMock_INCLUDE_DIR}
")   166   set (GMock_DIR "${GMock_PREFIX}
" CACHE PATH "Installation prefix 
for GMock.
" FORCE) cmake CMAKE_FIND_LIBRARY_SUFFIXES
cmake GMock_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES