Skip to content

Commit f9efbfa

Browse files
authored
Merge pull request #386 from ValeevGroup/evaleev/fix/globalize-boost-targets-imported-by-ta-only
[cmake] globalize Boost targets imported by TA only
2 parents 2439d0c + b0f98d2 commit f9efbfa

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

INSTALL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Both methods are supported. However, for most users we _strongly_ recommend to b
4040
- Boost.Container: header-only
4141
- Boost.Test: header-only or (optionally) as a compiled library, *only used for unit testing*
4242
- Boost.Range: header-only, *only used for unit testing*
43-
- [BTAS](http://github.com/ValeevGroup/BTAS), tag fba66ad9881ab29ea8df49ac6a6006cab3fb3ce5 . If usable BTAS installation is not found, TiledArray will download and compile
43+
- [BTAS](http://github.com/ValeevGroup/BTAS), tag 2917aa21465a93ae6f399874f247b5fe31d6b693 . If usable BTAS installation is not found, TiledArray will download and compile
4444
BTAS from source. *This is the recommended way to compile BTAS for all users*.
4545
- [MADNESS](https://github.com/m-a-d-n-e-s-s/madness), tag 0b44ef319643cb9721fbe17d294987c146e6460e .
4646
Only the MADworld runtime and BLAS/LAPACK C API component of MADNESS is used by TiledArray.

cmake/modules/FindOrFetchBoost.cmake

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ endif()
55

66
# try find_package
77
if (NOT TARGET Boost::boost)
8+
9+
# detect which Boost targets I already have
10+
foreach(tgt boost;headers;${Boost_BTAS_DEPS_LIBRARIES})
11+
if (TARGET Boost::${tgt})
12+
set(ta_imported_boost_${tgt} 0)
13+
else()
14+
set(ta_imported_boost_${tgt} 1)
15+
endif()
16+
endforeach()
17+
818
include(FindPackageRegimport)
919
find_package_regimport(Boost ${TA_TRACKED_BOOST_VERSION} QUIET)
1020
if (TARGET Boost::boost)
@@ -14,7 +24,7 @@ if (NOT TARGET Boost::boost)
1424
# Boost::* targets by default are not GLOBAL, so to allow users of TA to safely use them we need to make them global
1525
# more discussion here: https://gitlab.kitware.com/cmake/cmake/-/issues/17256
1626
foreach(tgt boost;headers;${Boost_BTAS_DEPS_LIBRARIES})
17-
if (TARGET Boost::${tgt})
27+
if (TARGET Boost::${tgt} AND ta_imported_boost_${tgt})
1828
get_target_property(_boost_tgt_${tgt}_is_imported_global Boost::${tgt} IMPORTED_GLOBAL)
1929
if (NOT _boost_tgt_${tgt}_is_imported_global)
2030
set_target_properties(Boost::${tgt} PROPERTIES IMPORTED_GLOBAL TRUE)

external/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

external/versions.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ set(TA_TRACKED_MADNESS_PREVIOUS_TAG 29a2bf3d3c2670c608b7bfdf2299d76fbc20e041)
2424
set(TA_TRACKED_MADNESS_VERSION 0.10.1)
2525
set(TA_TRACKED_MADNESS_PREVIOUS_VERSION 0.10.1)
2626

27-
set(TA_TRACKED_BTAS_TAG fba66ad9881ab29ea8df49ac6a6006cab3fb3ce5)
28-
set(TA_TRACKED_BTAS_PREVIOUS_TAG f7c9385348ea87202a887504e2be8bc477efdc3f)
27+
set(TA_TRACKED_BTAS_TAG 2917aa21465a93ae6f399874f247b5fe31d6b693)
28+
set(TA_TRACKED_BTAS_PREVIOUS_TAG fba66ad9881ab29ea8df49ac6a6006cab3fb3ce5)
2929

3030
set(TA_TRACKED_LIBRETT_TAG 68abe31a9ec6fd2fd9ffbcd874daa80457f947da)
3131
set(TA_TRACKED_LIBRETT_PREVIOUS_TAG 7e27ac766a9038df6aa05613784a54a036c4b796)

0 commit comments

Comments
 (0)