Add GLPK_ROOT_DIR variable to FindGLPK (#277)
authorAkos Ladanyi <ladanyi@tmit.bme.hu>
Mon, 27 Apr 2009 18:05:04 +0100
changeset 6324faa0c763906
parent 631 6dc44006c1a8
child 633 57e6f560fb13
Add GLPK_ROOT_DIR variable to FindGLPK (#277)
cmake/FindGLPK.cmake
     1.1 --- a/cmake/FindGLPK.cmake	Tue Apr 28 11:55:43 2009 +0100
     1.2 +++ b/cmake/FindGLPK.cmake	Mon Apr 27 18:05:04 2009 +0100
     1.3 @@ -1,13 +1,18 @@
     1.4 +SET(GLPK_ROOT_DIR "" CACHE PATH "GLPK root directory")
     1.5 +
     1.6  SET(GLPK_REGKEY "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Glpk;InstallPath]")
     1.7  GET_FILENAME_COMPONENT(GLPK_ROOT_PATH ${GLPK_REGKEY} ABSOLUTE)
     1.8  
     1.9  FIND_PATH(GLPK_INCLUDE_DIR
    1.10    glpk.h
    1.11 -  PATHS ${GLPK_REGKEY}/include)
    1.12 -
    1.13 +  PATHS ${GLPK_REGKEY}/include
    1.14 +  HINTS ${GLPK_ROOT_DIR}/include
    1.15 +)
    1.16  FIND_LIBRARY(GLPK_LIBRARY
    1.17 -  NAMES glpk
    1.18 -  PATHS ${GLPK_REGKEY}/lib)
    1.19 +  glpk
    1.20 +  PATHS ${GLPK_REGKEY}/lib
    1.21 +  HINTS ${GLPK_ROOT_DIR}/lib
    1.22 +)
    1.23  
    1.24  INCLUDE(FindPackageHandleStandardArgs)
    1.25  FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLPK DEFAULT_MSG GLPK_LIBRARY GLPK_INCLUDE_DIR)