# HG changeset patch # User Akos Ladanyi # Date 2009-04-27 19:05:04 # Node ID 4faa0c7639065675f2d8eae9d5031a4a93468d25 # Parent 6dc44006c1a8e77aa3607b12549fa2154e864783 Add GLPK_ROOT_DIR variable to FindGLPK (#277) diff --git a/cmake/FindGLPK.cmake b/cmake/FindGLPK.cmake --- a/cmake/FindGLPK.cmake +++ b/cmake/FindGLPK.cmake @@ -1,13 +1,18 @@ +SET(GLPK_ROOT_DIR "" CACHE PATH "GLPK root directory") + SET(GLPK_REGKEY "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Glpk;InstallPath]") GET_FILENAME_COMPONENT(GLPK_ROOT_PATH ${GLPK_REGKEY} ABSOLUTE) FIND_PATH(GLPK_INCLUDE_DIR glpk.h - PATHS ${GLPK_REGKEY}/include) - + PATHS ${GLPK_REGKEY}/include + HINTS ${GLPK_ROOT_DIR}/include +) FIND_LIBRARY(GLPK_LIBRARY - NAMES glpk - PATHS ${GLPK_REGKEY}/lib) + glpk + PATHS ${GLPK_REGKEY}/lib + HINTS ${GLPK_ROOT_DIR}/lib +) INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLPK DEFAULT_MSG GLPK_LIBRARY GLPK_INCLUDE_DIR)