60 lines
2.6 KiB
CMake
60 lines
2.6 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 ${CMAKE_INSTALL_PREFIX}/include)
|
|
find_file(GECODE_CONFIG gecode/support/config.hpp PATHS ${CMAKE_INSTALL_PREFIX}/include)
|
|
# Look for the library
|
|
find_library(GECODE_LIBRARY NAMES gecodekernel PATHS ${CMAKE_INSTALL_PREFIX}/lib)
|
|
find_library(GECODE_SUPPORT_LIBRARY NAMES gecodesupportl PATHS ${CMAKE_INSTALL_PREFIX}/lib)
|
|
|
|
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})
|
|
find_library(GECODE_DRIVER_LIBRARY gecodedriverl PATHS ${CMAKE_INSTALL_PREFIX}/lib)
|
|
if(GECODE_FZ_LIBRARY)
|
|
list(APPEND GECODE_LIBRARIES ${GECODE_FZ_LIBRARY})
|
|
endif()
|
|
find_library(GECODE_GIST_LIBRARY gecodegistl PATHS ${CMAKE_INSTALL_PREFIX}/lib)
|
|
if(GECODE_GIST_LIBRARY)
|
|
list(APPEND GECODE_LIBRARIES ${GECODE_GIST_LIBRARY})
|
|
endif()
|
|
find_library(GECODE_GRAPH_LIBRARY gecodegraphl PATHS ${CMAKE_INSTALL_PREFIX}/lib)
|
|
if(GECODE_GRAPH_LIBRARY)
|
|
list(APPEND GECODE_LIBRARIES ${GECODE_GRAPH_LIBRARY})
|
|
endif()
|
|
find_library(GECODE_INT_LIBRARY gecodeintl PATHS ${CMAKE_INSTALL_PREFIX}/lib)
|
|
if(GECODE_INT_LIBRARY)
|
|
list(APPEND GECODE_LIBRARIES ${GECODE_INT_LIBRARY})
|
|
endif()
|
|
find_library(GECODE_FLOAT_LIBRARY gecodefloatl PATHS ${CMAKE_INSTALL_PREFIX}/lib)
|
|
if(GECODE_FLOAT_LIBRARY)
|
|
list(APPEND GECODE_LIBRARIES ${GECODE_FLOAT_LIBRARY})
|
|
endif()
|
|
find_library(GECODE_MM_LIBRARY gecodeminimodell PATHS ${CMAKE_INSTALL_PREFIX}/lib)
|
|
if(GECODE_MM_LIBRARY)
|
|
list(APPEND GECODE_LIBRARIES ${GECODE_MM_LIBRARY})
|
|
endif()
|
|
find_library(GECODE_SCHEDULING_LIBRARY gecodeschedulingl PATHS ${CMAKE_INSTALL_PREFIX}/lib)
|
|
if(GECODE_SCHEDULING_LIBRARY)
|
|
list(APPEND GECODE_LIBRARIES ${GECODE_SCHEDULING_LIBRARY})
|
|
endif()
|
|
find_library(GECODE_SEARCH_LIBRARY gecodesearchl PATHS ${CMAKE_INSTALL_PREFIX}/lib)
|
|
if(GECODE_SEARCH_LIBRARY)
|
|
list(APPEND GECODE_LIBRARIES ${GECODE_SEARCH_LIBRARY})
|
|
endif()
|
|
find_library(GECODE_SET_LIBRARY gecodesetl PATHS ${CMAKE_INSTALL_PREFIX}/lib)
|
|
if(GECODE_SET_LIBRARY)
|
|
list(APPEND GECODE_LIBRARIES ${GECODE_SET_LIBRARY})
|
|
endif()
|
|
endif()
|