summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Dimov <pdimov@pdimov.com>2017-07-05 21:25:43 +0300
committerPeter Dimov <pdimov@pdimov.com>2017-07-05 21:25:43 +0300
commit235076dee6e7890e1a972220c97bd67a30476e28 (patch)
tree1c140b0af0658bf03cd12c6c49b53d5c573bcaf7
parentb81160cfaaa3314c13ef5361e17d3bf10cecb053 (diff)
downloadboost-feature/install-cmake-config-2.tar.gz
Integrate into top-level install and stagefeature/install-cmake-config-2
-rw-r--r--boostcpp.jam74
-rw-r--r--libs/cmake_config/Jamfile16
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 = <install-source-root>$(BOOST_ROOT)/boost ;
+ local install-requirements ;
+
+ local install-source-root = $(BOOST_ROOT)/boost ;
+
+ install-requirements += <install-source-root>$(install-source-root) ;
+
+ local install-header-subdir ;
if $(layout-versioned)
{
- install-requirements +=
- <install-header-subdir>boost-$(BOOST_VERSION_TAG)/boost ;
+ install-header-subdir = boost-$(BOOST_VERSION_TAG)/boost ;
}
else
{
- install-requirements += <install-header-subdir>boost ;
+ install-header-subdir = boost ;
}
+ install-requirements += <install-header-subdir>$(install-header-subdir) ;
+
+ local install-default-prefix ;
+
if [ os.name ] = NT
{
- install-requirements += <install-default-prefix>C:/Boost ;
+ install-default-prefix = C:/Boost ;
}
else
{
- install-requirements += <install-default-prefix>/usr/local ;
+ install-default-prefix = /usr/local ;
}
+ install-requirements += <install-default-prefix>$(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
+ : <location>$(libdir) <install-source-root>$(cmake-config-output-dir) ;
+
+ install stage-cmake
+ : boost_cmake_config
+ : <location>$(stage-locate)/lib <install-source-root>$(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