COIN-OR::LEMON - Graph Library

source: lemon-1.2/cmake/FindGLPK.cmake @ 637:4faa0c763906

Last change on this file since 637:4faa0c763906 was 637:4faa0c763906, checked in by Akos Ladanyi <ladanyi@…>, 11 years ago

Add GLPK_ROOT_DIR variable to FindGLPK (#277)

File size: 849 bytes
Line 
1SET(GLPK_ROOT_DIR "" CACHE PATH "GLPK root directory")
2
3SET(GLPK_REGKEY "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Glpk;InstallPath]")
4GET_FILENAME_COMPONENT(GLPK_ROOT_PATH ${GLPK_REGKEY} ABSOLUTE)
5
6FIND_PATH(GLPK_INCLUDE_DIR
7  glpk.h
8  PATHS ${GLPK_REGKEY}/include
9  HINTS ${GLPK_ROOT_DIR}/include
10)
11FIND_LIBRARY(GLPK_LIBRARY
12  glpk
13  PATHS ${GLPK_REGKEY}/lib
14  HINTS ${GLPK_ROOT_DIR}/lib
15)
16
17INCLUDE(FindPackageHandleStandardArgs)
18FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLPK DEFAULT_MSG GLPK_LIBRARY GLPK_INCLUDE_DIR)
19
20IF(GLPK_FOUND)
21  SET(GLPK_INCLUDE_DIRS ${GLPK_INCLUDE_DIR})
22  SET(GLPK_LIBRARIES ${GLPK_LIBRARY})
23  SET(GLPK_BIN_DIR ${GLPK_ROOT_PATH}/bin)
24ENDIF(GLPK_FOUND)
25
26MARK_AS_ADVANCED(GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_BIN_DIR)
27
28IF(GLPK_FOUND)
29  SET(LEMON_HAVE_LP TRUE)
30  SET(LEMON_HAVE_MIP TRUE)
31  SET(LEMON_HAVE_GLPK TRUE)
32ENDIF(GLPK_FOUND)
Note: See TracBrowser for help on using the repository browser.