- include config.h instead of manually adding -DHAVE_{CPLEX,GLPK} to CXXFLAGS
authorladanyi
Mon, 25 Apr 2005 08:19:38 +0000
changeset 138737d1b20cd9ef
parent 1386 324c291a8daf
child 1388 50fc3487af8b
- include config.h instead of manually adding -DHAVE_{CPLEX,GLPK} to CXXFLAGS
- removed the checking of LpSkeleton from lp_test.cc, because it is an
abstract base class now
- removed unnecessary LDFLAGS when linking with libemon.la
src/demo/Makefile.am
src/demo/lp_demo.cc
src/demo/lp_maxflow_demo.cc
src/test/Makefile.am
src/test/lp_test.cc
     1.1 --- a/src/demo/Makefile.am	Sun Apr 24 22:30:54 2005 +0000
     1.2 +++ b/src/demo/Makefile.am	Mon Apr 25 08:19:38 2005 +0000
     1.3 @@ -1,17 +1,6 @@
     1.4  AM_CPPFLAGS = -I$(top_srcdir)/src
     1.5  LDADD = $(top_builddir)/src/lemon/libemon.la
     1.6  
     1.7 -if HAVE_GLPK
     1.8 -LP_CFLAGS = $(GLPK_CFLAGS) -DHAVE_GLPK
     1.9 -LP_LIBS = $(GLPK_LIBS)
    1.10 -else !HAVE_GLPK
    1.11 -if HAVE_CPLEX
    1.12 -LP_CFLAGS = $(CPLEX_CFLAGS) -DHAVE_CPLEX
    1.13 -LP_LIBS = $(CPLEX_LIBS)
    1.14 -endif HAVE_CPLEX
    1.15 -endif !HAVE_GLPK
    1.16 -
    1.17 -
    1.18  EXTRA_DIST = sub_graph_wrapper_demo.dim
    1.19  
    1.20  noinst_PROGRAMS = \
    1.21 @@ -43,9 +32,7 @@
    1.22  	tight_edge_filter_map.h
    1.23  
    1.24  lp_demo_SOURCES = lp_demo.cc
    1.25 -lp_demo_CXXFLAGS = $(LP_CFLAGS)
    1.26 -lp_demo_LDFLAGS = $(LP_LIBS)
    1.27 +lp_demo_CXXFLAGS = $(GLPK_CFLAGS) $(CPLEX_CFLAGS)
    1.28  
    1.29  lp_maxflow_demo_SOURCES = lp_maxflow_demo.cc
    1.30 -lp_maxflow_demo_CXXFLAGS = $(LP_CFLAGS)
    1.31 -lp_maxflow_demo_LDFLAGS = $(LP_LIBS)
    1.32 +lp_maxflow_demo_CXXFLAGS = $(GLPK_CFLAGS) $(CPLEX_CFLAGS)
     2.1 --- a/src/demo/lp_demo.cc	Sun Apr 24 22:30:54 2005 +0000
     2.2 +++ b/src/demo/lp_demo.cc	Mon Apr 25 08:19:38 2005 +0000
     2.3 @@ -1,3 +1,7 @@
     2.4 +#ifdef HAVE_CONFIG_H
     2.5 +#include <config.h>
     2.6 +#endif
     2.7 +
     2.8  #include <iostream>
     2.9  
    2.10  
     3.1 --- a/src/demo/lp_maxflow_demo.cc	Sun Apr 24 22:30:54 2005 +0000
     3.2 +++ b/src/demo/lp_maxflow_demo.cc	Mon Apr 25 08:19:38 2005 +0000
     3.3 @@ -1,3 +1,7 @@
     3.4 +#ifdef HAVE_CONFIG_H
     3.5 +#include <config.h>
     3.6 +#endif
     3.7 +
     3.8  #include<lemon/graph_reader.h>
     3.9  #include<lemon/list_graph.h>
    3.10  
     4.1 --- a/src/test/Makefile.am	Sun Apr 24 22:30:54 2005 +0000
     4.2 +++ b/src/test/Makefile.am	Mon Apr 25 08:19:38 2005 +0000
     4.3 @@ -35,7 +35,11 @@
     4.4  
     4.5  if HAVE_GLPK
     4.6  check_PROGRAMS += lp_test
     4.7 -endif
     4.8 +else !HAVE_GLPK
     4.9 +if HAVE_CPLEX
    4.10 +check_PROGRAMS += lp_test
    4.11 +endif HAVE_CPLEX
    4.12 +endif !HAVE_GLPK
    4.13  
    4.14  TESTS = $(check_PROGRAMS)
    4.15  XFAIL_TESTS = test_tools_fail$(EXEEXT)
    4.16 @@ -62,5 +66,4 @@
    4.17  heap_test_SOURCES = heap_test.cc
    4.18  
    4.19  lp_test_SOURCES = lp_test.cc
    4.20 -lp_test_CXXFLAGS = $(GLPK_CFLAGS)
    4.21 -lp_test_LDFLAGS = $(GLPK_LIBS)
    4.22 +lp_test_CXXFLAGS = $(GLPK_CFLAGS) $(CPLEX_CFLAGS)
     5.1 --- a/src/test/lp_test.cc	Sun Apr 24 22:30:54 2005 +0000
     5.2 +++ b/src/test/lp_test.cc	Mon Apr 25 08:19:38 2005 +0000
     5.3 @@ -1,8 +1,21 @@
     5.4 -#include<lemon/lp_skeleton.h>
     5.5 -#include<lemon/lp_glpk.h>
     5.6 +#ifdef HAVE_CONFIG_H
     5.7 +#include <config.h>
     5.8 +#endif
     5.9 +
    5.10 +#ifdef HAVE_GLPK
    5.11 +#include <lemon/lp_glpk.h>
    5.12 +#elif HAVE_CPLEX
    5.13 +#include <lemon/lp_cplex.h>
    5.14 +#endif
    5.15  
    5.16  using namespace lemon;
    5.17  
    5.18 +#ifdef HAVE_GLPK
    5.19 +typedef LpGlpk LpDefault;
    5.20 +#elif HAVE_CPLEX
    5.21 +typedef LpCplex LpDefault;
    5.22 +#endif
    5.23 +
    5.24  void lpTest(LpSolverBase & lp)
    5.25  {
    5.26    typedef LpSolverBase LP;
    5.27 @@ -129,11 +142,9 @@
    5.28  
    5.29  int main() 
    5.30  {
    5.31 -  LpSkeleton lp_skel;
    5.32 -  LpGlpk lp_glpk;
    5.33 +  LpDefault lp;
    5.34  
    5.35 -  lpTest(lp_skel);
    5.36 -  lpTest(lp_glpk);
    5.37 +  lpTest(lp);
    5.38  
    5.39    return 0;
    5.40  }