Change the default unsat cores (#6571)
[cvc5.git] / cmake / FindGLPK.cmake
1 ###############################################################################
2 # Top contributors (to current version):
3 # Mathias Preiner
4 #
5 # This file is part of the cvc5 project.
6 #
7 # Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
8 # in the top-level source directory and their institutional affiliations.
9 # All rights reserved. See the file COPYING in the top-level source
10 # directory for licensing information.
11 # #############################################################################
12 #
13 # Find GLPK-cut-log
14 # GLPK_FOUND - system has GLPK lib
15 # GLPK_INCLUDE_DIR - the GLPK include directory
16 # GLPK_LIBRARIES - Libraries needed to use GLPK
17 ##
18
19
20 find_path(GLPK_INCLUDE_DIR NAMES glpk.h)
21 find_library(GLPK_LIBRARIES NAMES glpk)
22
23 # Check if we really have GLPK-cut-log.
24 if(GLPK_INCLUDE_DIR)
25 include(CheckSymbolExists)
26 set(CMAKE_REQUIRED_INCLUDES ${GLPK_INCLUDE_DIR})
27 set(CMAKE_REQUIRED_LIBRARIES ${GLPK_LIBRARIES} m)
28 check_symbol_exists(glp_ios_get_cut "glpk.h" HAVE_GLPK_CUT_LOG)
29 if(NOT HAVE_GLPK_CUT_LOG)
30 message(FATAL_ERROR "Could not link against GLPK-cut-log. "
31 "Did you forget to install GLPK-cut-log?")
32 endif()
33 endif()
34
35 include(FindPackageHandleStandardArgs)
36 find_package_handle_standard_args(GLPK
37 DEFAULT_MSG
38 GLPK_INCLUDE_DIR GLPK_LIBRARIES)
39
40 mark_as_advanced(GLPK_INCLUDE_DIR GLPK_LIBRARIES)
41 if(GLPK_LIBRARIES)
42 message(STATUS "Found GLPK libs: ${GLPK_LIBRARIES}")
43 endif()