Warning, /games/kpat/cmake/FindBlackHoleSolver.cmake is written in an unsupported language. File is not indexed.

0001 # SPDX-FileCopyrightText: 2023 Friedrich W. H. Kossebau <kossebau@kde.org>
0002 #
0003 # SPDX-License-Identifier: BSD-2-Clause
0004 
0005 #[=======================================================================[.rst:
0006 FindBlackHoleSolver
0007 -------------------
0008 
0009 Try to find the Black Hole Solitaire Solver library.
0010 
0011 This will define the following variables:
0012 
0013 ``BlackHoleSolver_FOUND``
0014     TRUE if (the requested version of) Black Hole Solitaire Solver is available
0015 ``BlackHoleSolver_VERSION``
0016     The version of Black Hole Solitaire Solver
0017 ``BlackHoleSolver_LIBRARIES``
0018     The libraries of Black Hole Solitaire Solver for use with target_link_libraries()
0019 ``BlackHoleSolver_INCLUDE_DIRS``
0020     The include dirs of Black Hole Solitaire Solver for use with target_include_directories()
0021 
0022 If ``BlackHoleSolver_FOUND`` is TRUE, it will also define the following imported
0023 target:
0024 
0025 ``BlackHoleSolver::BlackHoleSolver``
0026     The Black Hole Solitaire Solver library
0027 #]=======================================================================]
0028 
0029 find_package(PkgConfig QUIET)
0030 pkg_check_modules(PC_BlackHoleSolver libblack-hole-solver QUIET)
0031 
0032 find_library(BlackHoleSolver_LIBRARIES
0033     NAMES black_hole_solver
0034     HINTS ${PC_BlackHoleSolver_LIBRARY_DIRS}
0035 )
0036 
0037 find_path(BlackHoleSolver_INCLUDE_DIRS
0038     NAMES black-hole-solver/black_hole_solver.h
0039     HINTS ${PC_BlackHoleSolver_INCLUDE_DIRS}
0040 )
0041 
0042 set(BlackHoleSolver_VERSION ${PC_BlackHoleSolver_VERSION})
0043 
0044 include(FindPackageHandleStandardArgs)
0045 find_package_handle_standard_args(BlackHoleSolver
0046     REQUIRED_VARS
0047         BlackHoleSolver_LIBRARIES
0048         BlackHoleSolver_INCLUDE_DIRS
0049     VERSION_VAR
0050         BlackHoleSolver_VERSION
0051 )
0052 
0053 if(BlackHoleSolver_FOUND AND NOT TARGET BlackHoleSolver::BlackHoleSolver)
0054     add_library(BlackHoleSolver::BlackHoleSolver UNKNOWN IMPORTED)
0055     set_target_properties(BlackHoleSolver::BlackHoleSolver PROPERTIES
0056         IMPORTED_LOCATION "${BlackHoleSolver_LIBRARIES}"
0057         INTERFACE_COMPILE_OPTIONS "${PC_BlackHoleSolver_CFLAGS}"
0058         INTERFACE_INCLUDE_DIRECTORIES "${BlackHoleSolver_INCLUDE_DIRS}"
0059     )
0060 endif()
0061 
0062 mark_as_advanced(BlackHoleSolver_LIBRARIES BlackHoleSolver_INCLUDE_DIRS BlackHoleSolver_VERSION)
0063 
0064 include(FeatureSummary)
0065 set_package_properties(BlackHoleSolver PROPERTIES
0066     DESCRIPTION "Library for Solving Black Hole and All in a Row Solitaires"
0067     URL "https://www.shlomifish.org/open-source/projects/black-hole-solitaire-solver/"
0068 )