From 236cd9bb1dd022e64d690c9b0080d1a15c5f61c7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 13 Jun 2013 21:57:07 +0200 Subject: Handle --database option directly in automake and VC++ projects --- common/template/Makefile.am | 2 +- common/template/makefile | 5 +++-- common/template/template-vc10.vcxproj | 2 +- common/template/template-vc11.vcxproj | 2 +- common/template/template-vc9.vcproj | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) (limited to 'common/template') diff --git a/common/template/Makefile.am b/common/template/Makefile.am index 3571bc2..50ad1bc 100644 --- a/common/template/Makefile.am +++ b/common/template/Makefile.am @@ -35,6 +35,6 @@ BUILT_SOURCES += __f-odb.hxx CLEANFILES += __f-odb.hxx __f-odb.ixx __f-odb.cxx __f-odb.hxx: __f.hxx - $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) __value__(odb_options) $< + $(ODB) $(AM_CPPFLAGS) $(ODBCPPFLAGS) $(CPPFLAGS) $(ODBFLAGS) --database @database@ __value__(odb_options) $< )) diff --git a/common/template/makefile b/common/template/makefile index 63768df..0d8cf60 100644 --- a/common/template/makefile +++ b/common/template/makefile @@ -34,11 +34,13 @@ gen := $(addprefix $(out_base)/,$(genf)) $(gen): $(odb) $(gen): odb := $(odb) -$(gen) $(dist): export odb_options += --database $(db_id) --generate-schema \ +$(gen) $(dist): export odb_options += --generate-schema \ --table-prefix template_ #@@ CHANGE THIS $(gen): cpp_options := -I$(src_base) $(gen): $(common.l.cpp-options) +$(gen): odb_options += --database $(db_id) + $(call include-dep,$(cxx_od),$(cxx_obj),$(gen)) # Alias for default target. @@ -49,7 +51,6 @@ $(out_base)/: $(driver) # name := $(subst /,-,$(subst $(src_root)/common/,,$(src_base))) -$(dist): db_id := @database@ $(dist): sources := $(cxx_tun) $(dist): headers := $(odb_hdr) $(dist): data_dist := test.std diff --git a/common/template/template-vc10.vcxproj b/common/template/template-vc10.vcxproj index c1229ea..fb21140 100644 --- a/common/template/template-vc10.vcxproj +++ b/common/template/template-vc10.vcxproj @@ -161,7 +161,7 @@ m4_dnl __custom_build_entry__( __f.hxx, odb __f.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) __f.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) __f.hxx, __f-odb.hxx;__f-odb.ixx;__f-odb.cxx) ) ) diff --git a/common/template/template-vc11.vcxproj b/common/template/template-vc11.vcxproj index 048f160..c1f1b0d 100644 --- a/common/template/template-vc11.vcxproj +++ b/common/template/template-vc11.vcxproj @@ -165,7 +165,7 @@ m4_dnl __custom_build_entry__( __f.hxx, odb __f.hxx, -odb.exe --std c++11 __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) __f.hxx, +odb.exe --std c++11 --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1600 -I$(SolutionDir)\..\libcommon)) __f.hxx, __f-odb.hxx;__f-odb.ixx;__f-odb.cxx) ) ) diff --git a/common/template/template-vc9.vcproj b/common/template/template-vc9.vcproj index a09174c..976b870 100644 --- a/common/template/template-vc9.vcproj +++ b/common/template/template-vc9.vcproj @@ -352,7 +352,7 @@ __ifelse__(__value__(odb_options),,, __file_entry_custom_build__( __f.hxx, odb __f.hxx, -odb.exe __xml__(__shell_quotes__(m4_patsubst(__value__(odb_options), @database@, __value__(database)) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) __f.hxx, +odb.exe --database __value__(database) __xml__(__shell_quotes__(__value__(odb_options) -DHAVE_CONFIG_VC_H -DODB_MSC_VER=1500 -I$(SolutionDir)\..\libcommon)) __f.hxx, __f-odb.hxx;__f-odb.ixx;__f-odb.cxx) __file_entry__(__f-odb.hxx) __file_entry__(__f-odb.ixx))) -- cgit v1.1