This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/cmake/FindGecode.cmake
Vitor Santos Costa ca92d8631b configuration
2018-02-21 13:17:35 +00:00

58 lines
2.9 KiB
CMake

#source from http://code.google.com/p/cpfloat-gecode/source/browse/trunk/cmake-support/FindGecode.cmake?r=9
#
#Works under the assumption than when gecode is installed at least the kernel component exists
# Look for the header file
find_path(GECODE_INCLUDE_DIR NAMES gecode/kernel.hh PATHS ${GECODE_ROOT_DIR}/include ${CMAKE_INSTALL_PREFIX}/include /usr/local/include /opt/local/include /usr}/include)
find_file(GECODE_CONFIG gecode/support/config.hpp PATHS ${GECODE_ROOT_DIR}/include ${CMAKE_INSTALL_PREFIX}/include /usr/local/include /opt/local/include /usr}/include)
# Look for the library
find_library(GECODE_LIBRARY NAMES gecodekernel PATHS ${GECODE_ROOT_DIR}/lib ${CMAKE_INSTALL_PREFIX}/lib /usr/local/lib /opt/local/lib /usr}/lib)
find_library(GECODE_SUPPORT_LIBRARY NAMES gecodesupport PATHS ${GECODE_ROOT_DIR}/lib ${CMAKE_INSTALL_PREFIX}/lib /usr/local/lib /opt/local/lib /usr}/include)
if(GECODE_INCLUDE_DIR AND GECODE_LIBRARY AND GECODE_SUPPORT_LIBRARY)
set(GECODE_FOUND Yes)
if( GECODE_CONFIG AND GECODE_INCLUDE_DIR AND GECODE_LIBRARY)
file(STRINGS ${GECODE_CONFIG} GECODE_LINE_VERSION REGEX "^#define GECODE_VERSION .*")
string(REGEX MATCH "[0-9].[0-9].[0-9]" GECODE_VERSION ${GECODE_LINE_VERSION})
endif()
set(GECODE_LIBRARIES ${GECODE_LIBRARY} ${GECODE_SUPPORT_LIBRARY})
set(GECODE_INCLUDE_DIRS ${GECODE_INCLUDE_DIR})
find_library(GECODE_DRIVER_LIBRARY gecodedriver PATHS ${CMAKE_INSTALL_PREFIX}/lib)
if(GECODE_FZ_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_FZ_LIBRARY})
endif()
find_library(GECODE_GIST_LIBRARY gecodegist PATHS ${CMAKE_INSTALL_PREFIX}/lib)
if(GECODE_GIST_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_GIST_LIBRARY})
endif()
find_library(GECODE_GRAPH_LIBRARY gecodegraph PATHS ${CMAKE_INSTALL_PREFIX}/lib)
if(GECODE_GRAPH_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_GRAPH_LIBRARY})
endif()
find_library(GECODE_INT_LIBRARY gecodeint PATHS ${CMAKE_INSTALL_PREFIX}/lib)
if(GECODE_INT_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_INT_LIBRARY})
endif()
find_library(GECODE_FLOAT_LIBRARY gecodefloat PATHS ${CMAKE_INSTALL_PREFIX}/lib)
if(GECODE_FLOAT_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_FLOAT_LIBRARY})
endif()
find_library(GECODE_MM_LIBRARY gecodeminimodel PATHS ${CMAKE_INSTALL_PREFIX}/lib)
if(GECODE_MM_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_MM_LIBRARY})
endif()
find_library(GECODE_SCHEDULING_LIBRARY gecodescheduling PATHS ${CMAKE_INSTALL_PREFIX}/lib)
if(GECODE_SCHEDULING_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_SCHEDULING_LIBRARY})
endif()
find_library(GECODE_SEARCH_LIBRARY gecodesearch PATHS ${CMAKE_INSTALL_PREFIX}/lib)
if(GECODE_SEARCH_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_SEARCH_LIBRARY})
endif()
find_library(GECODE_SET_LIBRARY gecodeset PATHS ${CMAKE_INSTALL_PREFIX}/lib)
if(GECODE_SET_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_SET_LIBRARY})
endif()
endif()