This repository has been archived by the owner on Nov 5, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FindGecode.cmake
63 lines (58 loc) · 2.3 KB
/
FindGecode.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Source: https://code.google.com/p/cpfloat-gecode/source/browse/trunk/cmake-support/FindGecode.cmake?r=13#
#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)
find_file(GECODE_CONFIG gecode/support/config.hpp)
# Look for the library
find_library(GECODE_LIBRARY NAMES gecodekernel)
find_library(GECODE_SUPPORT_LIBRARY NAMES gecodesupport)
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 gecodedriver)
if(GECODE_DRIVER_LIBRARY)
list(APPEND Gecode_LIBRARIES ${GECODE_DRIVER_LIBRARY})
endif()
find_library(GECODE_FZ_LIBRARY gecodeflatzinc)
if(GECODE_FZ_LIBRARY)
list(APPEND Gecode_LIBRARIES ${GECODE_FZ_LIBRARY})
endif()
find_library(GECODE_GIST_LIBRARY gecodegist)
if(GECODE_GIST_LIBRARY)
list(APPEND Gecode_LIBRARIES ${GECODE_GIST_LIBRARY})
endif()
find_library(GECODE_GRAPH_LIBRARY gecodegraph)
if(GECODE_GRAPH_LIBRARY)
list(APPEND Gecode_LIBRARIES ${GECODE_GRAPH_LIBRARY})
endif()
find_library(GECODE_INT_LIBRARY gecodeint)
if(GECODE_INT_LIBRARY)
list(APPEND Gecode_LIBRARIES ${GECODE_INT_LIBRARY})
endif()
find_library(GECODE_MM_LIBRARY gecodeminimodel)
if(GECODE_MM_LIBRARY)
list(APPEND Gecode_LIBRARIES ${GECODE_MM_LIBRARY})
endif()
find_library(GECODE_SCHEDULING_LIBRARY gecodescheduling)
if(GECODE_SCHEDULING_LIBRARY)
list(APPEND Gecode_LIBRARIES ${GECODE_SCHEDULING_LIBRARY})
endif()
find_library(GECODE_SEARCH_LIBRARY gecodesearch)
if(GECODE_SEARCH_LIBRARY)
list(APPEND Gecode_LIBRARIES ${GECODE_SEARCH_LIBRARY})
endif()
find_library(GECODE_SET_LIBRARY gecodeset)
if(GECODE_SET_LIBRARY)
list(APPEND Gecode_LIBRARIES ${GECODE_SET_LIBRARY})
endif()
endif()
if(NOT GECODE_FOUND)
set(GECODE_ERREUR Yes)
endif()