diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,12 +26,6 @@ # C4996: 'function': was declared deprecated ENDIF(MSVC) -IF(GLPK_FOUND) - SET(HAVE_LP TRUE) - SET(HAVE_MIP TRUE) - SET(HAVE_GLPK TRUE) -ENDIF(GLPK_FOUND) - INCLUDE(CheckTypeSize) CHECK_TYPE_SIZE("long long" LONG_LONG) diff --git a/cmake/FindGLPK.cmake b/cmake/FindGLPK.cmake --- a/cmake/FindGLPK.cmake +++ b/cmake/FindGLPK.cmake @@ -13,8 +13,15 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLPK DEFAULT_MSG GLPK_LIBRARY GLPK_INCLUDE_DIR) IF(GLPK_FOUND) + SET(GLPK_INCLUDE_DIRS ${GLPK_INCLUDE_DIR}) SET(GLPK_LIBRARIES ${GLPK_LIBRARY}) SET(GLPK_BIN_DIR ${GLPK_ROOT_PATH}/bin) ENDIF(GLPK_FOUND) MARK_AS_ADVANCED(GLPK_LIBRARY GLPK_INCLUDE_DIR GLPK_BIN_DIR) + +IF(GLPK_FOUND) + SET(HAVE_LP TRUE) + SET(HAVE_MIP TRUE) + SET(HAVE_GLPK TRUE) +ENDIF(GLPK_FOUND) diff --git a/lemon/CMakeLists.txt b/lemon/CMakeLists.txt --- a/lemon/CMakeLists.txt +++ b/lemon/CMakeLists.txt @@ -20,7 +20,7 @@ IF(HAVE_GLPK) SET(LEMON_SOURCES ${LEMON_SOURCES} glpk.cc) - INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIR}) + INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIRS}) IF(WIN32) INSTALL(FILES ${GLPK_BIN_DIR}/glpk.dll DESTINATION bin) INSTALL(FILES ${GLPK_BIN_DIR}/libltdl3.dll DESTINATION bin) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -3,10 +3,6 @@ ${PROJECT_BINARY_DIR} ) -IF(HAVE_GLPK) - INCLUDE_DIRECTORIES(${GLPK_INCLUDE_DIR}) -ENDIF(HAVE_GLPK) - LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon) SET(TESTS