From 235076dee6e7890e1a972220c97bd67a30476e28 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 5 Jul 2017 21:25:43 +0300 Subject: Integrate into top-level install and stage --- boostcpp.jam | 74 ++++++++++++++++++++++++++++++++++++++++++----- libs/cmake_config/Jamfile | 16 +++++----- 2 files changed, 74 insertions(+), 16 deletions(-) diff --git a/boostcpp.jam b/boostcpp.jam index 02ce085c12..d708a93eea 100644 --- a/boostcpp.jam +++ b/boostcpp.jam @@ -237,6 +237,7 @@ rule filtered-target ( name : message + : sources + : requirements * ) rule declare_install_and_stage_proper_targets ( libraries * : headers * ) { local p = [ project.current ] ; + for local l in $(libraries) { if $(l) = locale @@ -263,29 +264,41 @@ rule declare_install_and_stage_proper_targets ( libraries * : headers * ) $(p).mark-target-as-explicit $(l)-for-install ; } } + local library-targets = $(libraries)-for-install ; - install-requirements = $(BOOST_ROOT)/boost ; + local install-requirements ; + + local install-source-root = $(BOOST_ROOT)/boost ; + + install-requirements += $(install-source-root) ; + + local install-header-subdir ; if $(layout-versioned) { - install-requirements += - boost-$(BOOST_VERSION_TAG)/boost ; + install-header-subdir = boost-$(BOOST_VERSION_TAG)/boost ; } else { - install-requirements += boost ; + install-header-subdir = boost ; } + install-requirements += $(install-header-subdir) ; + + local install-default-prefix ; + if [ os.name ] = NT { - install-requirements += C:/Boost ; + install-default-prefix = C:/Boost ; } else { - install-requirements += /usr/local ; + install-default-prefix = /usr/local ; } + install-requirements += $(install-default-prefix) ; + p = [ project.current ] ; # Complete install. @@ -306,6 +319,51 @@ rule declare_install_and_stage_proper_targets ( libraries * : headers * ) ; $(p).mark-target-as-explicit stage-proper ; + # CMake targets + + if [ path.exists $(BOOST_ROOT)/libs/cmake_config/Jamfile ] + { + alias boost_cmake_config : libs/cmake_config//boost_cmake_config ; + $(p).mark-target-as-explicit boost_cmake_config ; + + local cmake-config-output-dir = bin.v2 ; + + # prefix, libdir + + local prefix ; + local libdir ; + + # Duplicate package.install logic + + if [ MATCH --prefix=(.*) : [ modules.peek : ARGV ] ] + { + # --prefix on the command line overrides --libdir + prefix = [ option.get prefix ] ; + libdir = $(prefix)/lib ; + } + else + { + prefix = $(install-default-prefix) ; + libdir = [ option.get libdir : $(prefix)/lib ] ; + } + + install install-cmake + : boost_cmake_config + : $(libdir) $(cmake-config-output-dir) ; + + install stage-cmake + : boost_cmake_config + : $(stage-locate)/lib $(cmake-config-output-dir) ; + } + else + { + alias install-cmake ; + alias stage-cmake ; + } + + $(p).mark-target-as-explicit install-cmake ; + $(p).mark-target-as-explicit stage-cmake ; + # Commented out as it does not seem to work. Whoever wrote this originally, # left some typos in the code, but when that got corrected and the code got # enabled - it started reporting ambiguous/duplicate target Boost Build @@ -459,11 +517,11 @@ rule declare_top_level_targets ( libraries * : headers * ) targets.create-metatarget top-level-target : [ project.current ] : install - : install-proper install-unversioned + : install-proper install-unversioned install-cmake ; targets.create-metatarget top-level-target : [ project.current ] : stage - : stage-proper stage-unversioned + : stage-proper stage-unversioned stage-cmake ; p = [ project.current ] ; diff --git a/libs/cmake_config/Jamfile b/libs/cmake_config/Jamfile index d30030a3e7..3f3f22db2e 100644 --- a/libs/cmake_config/Jamfile +++ b/libs/cmake_config/Jamfile @@ -397,18 +397,18 @@ actions boostdep-cmake # output-dir -local project = [ project.current ] ; +#local project = [ project.current ] ; -local build-dir = [ path.root [ $(project).get build-dir ] [ path.pwd ] ] ; -.info build-dir is $(build-dir) ; +#local build-dir = [ path.root [ $(project).get build-dir ] [ path.pwd ] ] ; +#.info build-dir is $(build-dir) ; -path-constant HERE : . ; -.info HERE is $(HERE) ; +#path-constant HERE : . ; +#.info HERE is $(HERE) ; -local current-dir = [ path.make $(HERE) ] ; -.info current-dir is $(current-dir) ; +#local current-dir = [ path.make $(HERE) ] ; +#.info current-dir is $(current-dir) ; -local output-dir = [ path.relative-to $(current-dir) $(build-dir) ] ; +output-dir = ../../bin.v2 ; # [ path.relative-to $(current-dir) $(build-dir) ] ; .info output-dir is $(output-dir) ; # create library config targets -- cgit v1.2.1