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