File: FindGLPK.cmake

package info (click to toggle)
gnudatalanguage 1.1.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 80,368 kB
  • sloc: cpp: 189,797; ansic: 46,721; sh: 677; python: 474; makefile: 146; xml: 69; f90: 28
file content (40 lines) | stat: -rw-r--r-- 1,141 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Find GLPK header and library.
#

# This module defines the following uncached variables:
#  GLPK_FOUND, if false, do not try to use GLPK.
#  GLPK_INCLUDE_DIRS, where to find glpk.h.
#  GLPK_LIBRARIES, the libraries to link against to use the GLPK library
#  GLPK_LIBRARY_DIRS, the directory where the GLPK library is found.

find_path(
  GLPK_INCLUDE_DIR
  glpk.h
)

if( GLPK_INCLUDE_DIR )
  find_library(
    GLPK_LIBRARY
    NAMES glpk
  )
  if( GLPK_LIBRARY )
    set(GLPK_LIBRARY_DIR "")
    get_filename_component(GLPK_LIBRARY_DIRS ${GLPK_LIBRARY} PATH)
    # Set uncached variables as per standard.
    set(GLPK_FOUND ON)
    set(GLPK_INCLUDE_DIRS ${GLPK_INCLUDE_DIR})
    set(GLPK_LIBRARIES ${GLPK_LIBRARY})
  endif(GLPK_LIBRARY)
else(GLPK_INCLUDE_DIR)
  message(STATUS "FindGLPK: Could not find glpk.h")
endif(GLPK_INCLUDE_DIR)
	    
if(GLPK_FOUND)
  if(NOT GLPK_FIND_QUIETLY)
    message(STATUS "FindGLPK: Found both glpk.h and libglpk.a")
  endif(NOT GLPK_FIND_QUIETLY)
else(GLPK_FOUND)
  if(GLPK_FIND_REQUIRED)
    message(STATUS "FindGLPK: Could not find glpk.h and/or libglpk.a")
  endif(GLPK_FIND_REQUIRED)
endif(GLPK_FOUND)