0
8
0
1 | 1 |
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) |
2 | 2 |
|
3 | 3 |
IF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake) |
4 | 4 |
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/version.cmake) |
5 | 5 |
ELSE(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake) |
6 | 6 |
SET(PROJECT_NAME "LEMON") |
7 | 7 |
SET(PROJECT_VERSION "hg-tip" CACHE STRING "LEMON version string.") |
8 | 8 |
ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/version.cmake) |
9 | 9 |
|
10 | 10 |
PROJECT(${PROJECT_NAME}) |
11 | 11 |
|
12 | 12 |
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) |
13 | 13 |
|
14 | 14 |
INCLUDE(FindDoxygen) |
15 | 15 |
INCLUDE(FindGhostscript) |
16 | 16 |
|
17 | 17 |
ADD_DEFINITIONS(-DHAVE_CONFIG_H) |
18 | 18 |
|
19 | 19 |
INCLUDE(CheckTypeSize) |
20 |
CHECK_TYPE_SIZE("long long" |
|
20 |
CHECK_TYPE_SIZE("long long" LEMON_LONG_LONG) |
|
21 | 21 |
|
22 | 22 |
ENABLE_TESTING() |
23 | 23 |
|
24 | 24 |
ADD_SUBDIRECTORY(lemon) |
25 | 25 |
ADD_SUBDIRECTORY(demo) |
26 | 26 |
ADD_SUBDIRECTORY(doc) |
27 | 27 |
ADD_SUBDIRECTORY(test) |
28 | 28 |
|
29 | 29 |
IF(WIN32) |
30 | 30 |
SET(CPACK_PACKAGE_NAME ${PROJECT_NAME}) |
31 | 31 |
SET(CPACK_PACKAGE_VENDOR "EGRES") |
32 | 32 |
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY |
33 | 33 |
"LEMON - Library of Efficient Models and Optimization in Networks") |
34 | 34 |
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE") |
35 | 35 |
|
36 | 36 |
SET(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) |
37 | 37 |
|
38 | 38 |
SET(CPACK_PACKAGE_INSTALL_DIRECTORY |
39 | 39 |
"${PROJECT_NAME} ${PROJECT_VERSION}") |
40 | 40 |
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY |
41 | 41 |
"${PROJECT_NAME} ${PROJECT_VERSION}") |
42 | 42 |
|
43 | 43 |
SET(CPACK_COMPONENTS_ALL headers library html_documentation) |
44 | 44 |
... | ... |
@@ -6,49 +6,49 @@ |
6 | 6 |
dnl m4_define([lemon_version_number], []) |
7 | 7 |
m4_define([lemon_hg_path], [m4_normalize(esyscmd([./scripts/chg-len.py]))]) |
8 | 8 |
m4_define([lemon_hg_revision], [m4_normalize(esyscmd([hg id -i]))]) |
9 | 9 |
m4_define([lemon_version], [ifelse(lemon_version_number(), |
10 | 10 |
[], |
11 | 11 |
[lemon_hg_path().lemon_hg_revision()], |
12 | 12 |
[lemon_version_number()])]) |
13 | 13 |
|
14 | 14 |
AC_PREREQ([2.59]) |
15 | 15 |
AC_INIT([LEMON], [lemon_version()], [lemon-user@lemon.cs.elte.hu], [lemon]) |
16 | 16 |
AC_CONFIG_AUX_DIR([build-aux]) |
17 | 17 |
AC_CONFIG_MACRO_DIR([m4]) |
18 | 18 |
AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects nostdinc]) |
19 | 19 |
AC_CONFIG_SRCDIR([lemon/list_graph.h]) |
20 | 20 |
AC_CONFIG_HEADERS([config.h lemon/config.h]) |
21 | 21 |
|
22 | 22 |
lx_cmdline_cxxflags_set=${CXXFLAGS+set} |
23 | 23 |
|
24 | 24 |
dnl Do compilation tests using the C++ compiler. |
25 | 25 |
AC_LANG([C++]) |
26 | 26 |
|
27 | 27 |
dnl Check the existence of long long type. |
28 | 28 |
AC_CHECK_TYPE(long long, [long_long_found=yes], [long_long_found=no]) |
29 | 29 |
if test x"$long_long_found" = x"yes"; then |
30 |
AC_DEFINE([ |
|
30 |
AC_DEFINE([LEMON_HAVE_LONG_LONG], [1], [Define to 1 if you have long long.]) |
|
31 | 31 |
fi |
32 | 32 |
|
33 | 33 |
dnl Checks for programs. |
34 | 34 |
AC_PROG_CXX |
35 | 35 |
AC_PROG_CXXCPP |
36 | 36 |
AC_PROG_INSTALL |
37 | 37 |
AC_DISABLE_SHARED |
38 | 38 |
AC_PROG_LIBTOOL |
39 | 39 |
|
40 | 40 |
AC_CHECK_PROG([doxygen_found],[doxygen],[yes],[no]) |
41 | 41 |
AC_CHECK_PROG([gs_found],[gs],[yes],[no]) |
42 | 42 |
|
43 | 43 |
dnl Detect Intel compiler. |
44 | 44 |
AC_MSG_CHECKING([whether we are using the Intel C++ compiler]) |
45 | 45 |
AC_COMPILE_IFELSE([#ifndef __INTEL_COMPILER |
46 | 46 |
choke me |
47 | 47 |
#endif], [ICC=[yes]], [ICC=[no]]) |
48 | 48 |
if test x"$ICC" = x"yes"; then |
49 | 49 |
AC_MSG_RESULT([yes]) |
50 | 50 |
else |
51 | 51 |
AC_MSG_RESULT([no]) |
52 | 52 |
fi |
53 | 53 |
|
54 | 54 |
dnl Set custom compiler flags when using g++. |
... | ... |
@@ -76,49 +76,49 @@ |
76 | 76 |
// short |
77 | 77 |
template <typename _Graph, typename _Item> |
78 | 78 |
struct DefaultMapSelector<_Graph, _Item, signed short> { |
79 | 79 |
typedef VectorMap<_Graph, _Item, signed short> Map; |
80 | 80 |
}; |
81 | 81 |
|
82 | 82 |
template <typename _Graph, typename _Item> |
83 | 83 |
struct DefaultMapSelector<_Graph, _Item, unsigned short> { |
84 | 84 |
typedef VectorMap<_Graph, _Item, unsigned short> Map; |
85 | 85 |
}; |
86 | 86 |
|
87 | 87 |
|
88 | 88 |
// long |
89 | 89 |
template <typename _Graph, typename _Item> |
90 | 90 |
struct DefaultMapSelector<_Graph, _Item, signed long> { |
91 | 91 |
typedef VectorMap<_Graph, _Item, signed long> Map; |
92 | 92 |
}; |
93 | 93 |
|
94 | 94 |
template <typename _Graph, typename _Item> |
95 | 95 |
struct DefaultMapSelector<_Graph, _Item, unsigned long> { |
96 | 96 |
typedef VectorMap<_Graph, _Item, unsigned long> Map; |
97 | 97 |
}; |
98 | 98 |
|
99 | 99 |
|
100 |
#if defined |
|
100 |
#if defined LEMON_HAVE_LONG_LONG |
|
101 | 101 |
|
102 | 102 |
// long long |
103 | 103 |
template <typename _Graph, typename _Item> |
104 | 104 |
struct DefaultMapSelector<_Graph, _Item, signed long long> { |
105 | 105 |
typedef VectorMap<_Graph, _Item, signed long long> Map; |
106 | 106 |
}; |
107 | 107 |
|
108 | 108 |
template <typename _Graph, typename _Item> |
109 | 109 |
struct DefaultMapSelector<_Graph, _Item, unsigned long long> { |
110 | 110 |
typedef VectorMap<_Graph, _Item, unsigned long long> Map; |
111 | 111 |
}; |
112 | 112 |
|
113 | 113 |
#endif |
114 | 114 |
|
115 | 115 |
|
116 | 116 |
// float |
117 | 117 |
template <typename _Graph, typename _Item> |
118 | 118 |
struct DefaultMapSelector<_Graph, _Item, float> { |
119 | 119 |
typedef VectorMap<_Graph, _Item, float> Map; |
120 | 120 |
}; |
121 | 121 |
|
122 | 122 |
|
123 | 123 |
// double |
124 | 124 |
template <typename _Graph, typename _Item> |
... | ... |
@@ -40,38 +40,38 @@ |
40 | 40 |
CXXFLAGS="$CPLEX_CFLAGS" |
41 | 41 |
LDFLAGS="$CPLEX_LDFLAGS" |
42 | 42 |
LIBS="$CPLEX_LIBS" |
43 | 43 |
|
44 | 44 |
lx_cplex_test_prog=' |
45 | 45 |
extern "C" { |
46 | 46 |
#include <ilcplex/cplex.h> |
47 | 47 |
} |
48 | 48 |
|
49 | 49 |
int main(int argc, char** argv) |
50 | 50 |
{ |
51 | 51 |
CPXENVptr env = NULL; |
52 | 52 |
return 0; |
53 | 53 |
}' |
54 | 54 |
|
55 | 55 |
AC_LANG_PUSH(C++) |
56 | 56 |
AC_LINK_IFELSE([$lx_cplex_test_prog], [lx_cplex_found=yes], [lx_cplex_found=no]) |
57 | 57 |
AC_LANG_POP(C++) |
58 | 58 |
|
59 | 59 |
CXXFLAGS="$lx_save_cxxflags" |
60 | 60 |
LDFLAGS="$lx_save_ldflags" |
61 | 61 |
LIBS="$lx_save_libs" |
62 | 62 |
|
63 | 63 |
if test x"$lx_cplex_found" = x"yes"; then |
64 |
AC_DEFINE([ |
|
64 |
AC_DEFINE([LEMON_HAVE_CPLEX], [1], [Define to 1 if you have CPLEX.]) |
|
65 | 65 |
AC_MSG_RESULT([yes]) |
66 | 66 |
else |
67 | 67 |
CPLEX_CFLAGS="" |
68 | 68 |
CPLEX_LDFLAGS="" |
69 | 69 |
CPLEX_LIBS="" |
70 | 70 |
AC_MSG_RESULT([no]) |
71 | 71 |
fi |
72 | 72 |
fi |
73 | 73 |
CPLEX_LIBS="$CPLEX_LDFLAGS $CPLEX_LIBS" |
74 | 74 |
AC_SUBST(CPLEX_CFLAGS) |
75 | 75 |
AC_SUBST(CPLEX_LIBS) |
76 | 76 |
AM_CONDITIONAL([HAVE_CPLEX], [test x"$lx_cplex_found" = x"yes"]) |
77 | 77 |
]) |
... | ... |
@@ -38,38 +38,38 @@ |
38 | 38 |
LIBS="$GLPK_LIBS" |
39 | 39 |
|
40 | 40 |
lx_glpk_test_prog=' |
41 | 41 |
extern "C" { |
42 | 42 |
#include <glpk.h> |
43 | 43 |
} |
44 | 44 |
|
45 | 45 |
int main(int argc, char** argv) |
46 | 46 |
{ |
47 | 47 |
LPX *lp; |
48 | 48 |
lp = lpx_create_prob(); |
49 | 49 |
lpx_delete_prob(lp); |
50 | 50 |
return 0; |
51 | 51 |
}' |
52 | 52 |
|
53 | 53 |
AC_LANG_PUSH(C++) |
54 | 54 |
AC_LINK_IFELSE([$lx_glpk_test_prog], [lx_glpk_found=yes], [lx_glpk_found=no]) |
55 | 55 |
AC_LANG_POP(C++) |
56 | 56 |
|
57 | 57 |
CXXFLAGS="$lx_save_cxxflags" |
58 | 58 |
LDFLAGS="$lx_save_ldflags" |
59 | 59 |
LIBS="$lx_save_libs" |
60 | 60 |
|
61 | 61 |
if test x"$lx_glpk_found" = x"yes"; then |
62 |
AC_DEFINE([ |
|
62 |
AC_DEFINE([LEMON_HAVE_GLPK], [1], [Define to 1 if you have GLPK.]) |
|
63 | 63 |
AC_MSG_RESULT([yes]) |
64 | 64 |
else |
65 | 65 |
GLPK_CFLAGS="" |
66 | 66 |
GLPK_LDFLAGS="" |
67 | 67 |
GLPK_LIBS="" |
68 | 68 |
AC_MSG_RESULT([no]) |
69 | 69 |
fi |
70 | 70 |
fi |
71 | 71 |
GLPK_LIBS="$GLPK_LDFLAGS $GLPK_LIBS" |
72 | 72 |
AC_SUBST(GLPK_CFLAGS) |
73 | 73 |
AC_SUBST(GLPK_LIBS) |
74 | 74 |
AM_CONDITIONAL([HAVE_GLPK], [test x"$lx_glpk_found" = x"yes"]) |
75 | 75 |
]) |
... | ... |
@@ -34,38 +34,38 @@ |
34 | 34 |
lx_save_ldflags="$LDFLAGS" |
35 | 35 |
lx_save_libs="$LIBS" |
36 | 36 |
CXXFLAGS="$SOPLEX_CXXFLAGS" |
37 | 37 |
LDFLAGS="$SOPLEX_LDFLAGS" |
38 | 38 |
LIBS="$SOPLEX_LIBS" |
39 | 39 |
|
40 | 40 |
lx_soplex_test_prog=' |
41 | 41 |
#include <soplex/soplex.h> |
42 | 42 |
|
43 | 43 |
int main(int argc, char** argv) |
44 | 44 |
{ |
45 | 45 |
soplex::SoPlex soplex; |
46 | 46 |
return 0; |
47 | 47 |
}' |
48 | 48 |
|
49 | 49 |
AC_LANG_PUSH(C++) |
50 | 50 |
AC_LINK_IFELSE([$lx_soplex_test_prog], [lx_soplex_found=yes], [lx_soplex_found=no]) |
51 | 51 |
AC_LANG_POP(C++) |
52 | 52 |
|
53 | 53 |
CXXFLAGS="$lx_save_cxxflags" |
54 | 54 |
LDFLAGS="$lx_save_ldflags" |
55 | 55 |
LIBS="$lx_save_libs" |
56 | 56 |
|
57 | 57 |
if test x"$lx_soplex_found" = x"yes"; then |
58 |
AC_DEFINE([ |
|
58 |
AC_DEFINE([LEMON_HAVE_SOPLEX], [1], [Define to 1 if you have SOPLEX.]) |
|
59 | 59 |
AC_MSG_RESULT([yes]) |
60 | 60 |
else |
61 | 61 |
SOPLEX_CXXFLAGS="" |
62 | 62 |
SOPLEX_LDFLAGS="" |
63 | 63 |
SOPLEX_LIBS="" |
64 | 64 |
AC_MSG_RESULT([no]) |
65 | 65 |
fi |
66 | 66 |
fi |
67 | 67 |
SOPLEX_LIBS="$SOPLEX_LDFLAGS $SOPLEX_LIBS" |
68 | 68 |
AC_SUBST(SOPLEX_CXXFLAGS) |
69 | 69 |
AC_SUBST(SOPLEX_LIBS) |
70 | 70 |
AM_CONDITIONAL([HAVE_SOPLEX], [test x"$lx_soplex_found" = x"yes"]) |
71 | 71 |
]) |
0 comments (0 inline)