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

60 lines
2.9 KiB
CMake
Raw Normal View History

#source from http://code.google.com/p/cpfloat-gecode/source/browse/trunk/cmake-support/FindGecode.cmake?r=9
2016-12-10 07:02:46 +00:00
#
#Works under the assumption than when gecode is installed at least the kernel component exists
# Look for the header file
2016-12-10 07:02:46 +00:00
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
2016-12-10 07:02:46 +00:00
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_CONFIG)
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()
if(GECODE_INCLUDE_DIR AND GECODE_LIBRARY AND GECODE_SUPPORT_LIBRARY)
set(GECODE_FOUND Yes)
endif()
if(GECODE_FOUND)
set(GECODE_LIBRARIES ${GECODE_LIBRARY} ${GECODE_SUPPORT_LIBRARY})
set(GECODE_INCLUDE_DIRS ${GECODE_INCLUDE_DIR})
2016-12-10 09:11:28 +00:00
find_library(GECODE_DRIVER_LIBRARY gecodedriver PATHS ${CMAKE_INSTALL_PREFIX}/lib)
if(GECODE_FZ_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_FZ_LIBRARY})
endif()
2016-12-10 09:11:28 +00:00
find_library(GECODE_GIST_LIBRARY gecodegist PATHS ${CMAKE_INSTALL_PREFIX}/lib)
if(GECODE_GIST_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_GIST_LIBRARY})
endif()
2016-12-10 09:11:28 +00:00
find_library(GECODE_GRAPH_LIBRARY gecodegraph PATHS ${CMAKE_INSTALL_PREFIX}/lib)
if(GECODE_GRAPH_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_GRAPH_LIBRARY})
endif()
2016-12-10 09:11:28 +00:00
find_library(GECODE_INT_LIBRARY gecodeint PATHS ${CMAKE_INSTALL_PREFIX}/lib)
if(GECODE_INT_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_INT_LIBRARY})
endif()
2016-12-10 09:11:28 +00:00
find_library(GECODE_FLOAT_LIBRARY gecodefloat PATHS ${CMAKE_INSTALL_PREFIX}/lib)
2014-12-14 12:05:43 +00:00
if(GECODE_FLOAT_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_FLOAT_LIBRARY})
endif()
2016-12-10 09:11:28 +00:00
find_library(GECODE_MM_LIBRARY gecodeminimodel PATHS ${CMAKE_INSTALL_PREFIX}/lib)
if(GECODE_MM_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_MM_LIBRARY})
endif()
2016-12-10 09:11:28 +00:00
find_library(GECODE_SCHEDULING_LIBRARY gecodescheduling PATHS ${CMAKE_INSTALL_PREFIX}/lib)
if(GECODE_SCHEDULING_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_SCHEDULING_LIBRARY})
endif()
2016-12-10 09:11:28 +00:00
find_library(GECODE_SEARCH_LIBRARY gecodesearch PATHS ${CMAKE_INSTALL_PREFIX}/lib)
if(GECODE_SEARCH_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_SEARCH_LIBRARY})
endif()
2016-12-10 09:11:28 +00:00
find_library(GECODE_SET_LIBRARY gecodeset PATHS ${CMAKE_INSTALL_PREFIX}/lib)
if(GECODE_SET_LIBRARY)
list(APPEND GECODE_LIBRARIES ${GECODE_SET_LIBRARY})
endif()
endif()