Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete initial implementation for treating internal packages as external found with find_package() (#63) #560

Merged
merged 49 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
ccb222a
Add printing of <Package>_PACAKGE_BUILD_STATUS (#63)
bartlettroscoe Dec 22, 2022
afcea28
Add documentation for <Package>_SUBPACKAGES varaible (#63)
bartlettroscoe Jan 12, 2023
ee5f2ce
Small doc update (#63)
bartlettroscoe Jan 13, 2023
0fc3973
Change tribits_print_prefix_string_and_list() to pass in list name (#63)
bartlettroscoe Jan 17, 2023
f3f9356
WIP: Add basic logic for setting <Package>_PACKAGE_BUILD_STATUS=EXTER…
bartlettroscoe Jan 24, 2023
09e61e5
WIP: rename some local vars away from UPPPER-CASE (#63)
bartlettroscoe Jan 18, 2023
5648cf7
WIP: Replace bool arg includeEmpty with enum arg enableEmptyStatus (#63)
bartlettroscoe Jan 18, 2023
abd846a
WIP: Small doc and format changes (#63)
bartlettroscoe Jan 18, 2023
cc8d5b7
WIP: Add internalOrExternal arg to tribits_print_packages_list_enable…
bartlettroscoe Jan 19, 2023
f85cc17
WIP: Change name from TribitsGetEnabledSublists.cmake to TribitsPacka…
bartlettroscoe Jan 19, 2023
e30b5bf
WIP: Change printing of package set lists based in INTERNAL/EXTERNAL …
bartlettroscoe Jan 20, 2023
e14b0d2
WIP: Add printing of Final set of [non-]enabled top-level external pa…
bartlettroscoe Jan 20, 2023
864ad9f
Factor out tribits_filter_package_list_from_var() (#63)
bartlettroscoe Jan 20, 2023
7ab3809
MockTrilinos: Set <Project>_TRACE_DEPENDENCY_HANDLING_ONLY=ON (#63)
bartlettroscoe Jan 21, 2023
aaec210
WIP: Adjust processing of internal and external packages (#63)
bartlettroscoe Jan 21, 2023
b9b4567
Finish basic implentation for building against external packages (#63)
bartlettroscoe Jan 24, 2023
33902f7
Process TPLs at base project level, pass info through <Package>Config…
bartlettroscoe Jan 27, 2023
a2790c8
Make WrapExernal work with external TribitsExProj packages (#63)
bartlettroscoe Jan 25, 2023
3065298
Add option <Project>_SKIP_INSTALL_PROJECT_CMAKE_CONFIG_FILES (#63)
bartlettroscoe Jan 25, 2023
aa843a4
WIP: Rename TribitsProcessEnabledTpl.cmake to TribitsProcessEnabledTp…
bartlettroscoe Jan 27, 2023
8e112e0
Add basic special handling for fully TriBITS-compliant external packa…
bartlettroscoe Jan 26, 2023
56b0845
WIP: Add initial failing test case for stagged package installs (#63)
bartlettroscoe Jan 27, 2023
cddd9f1
Initial implementation of pre-building/pre-installing stages of packa…
bartlettroscoe Jan 27, 2023
0c959bb
Revise how internal and external <Package>Config.cmake files are link…
bartlettroscoe Jan 28, 2023
2075dd6
WIP: Improve names of functions and variables (#63)
bartlettroscoe Feb 6, 2023
3b63fbd
WIP: Improve documentation (#63)
bartlettroscoe Feb 6, 2023
3389ceb
WIP: Move functions writing <tplName>Config.cmake files to TribitsExt…
bartlettroscoe Feb 6, 2023
28d1beb
WIP: Rename TribitsExternalPackageFindTplHelpers to TribitsExternalPa…
bartlettroscoe Feb 6, 2023
9a1eba1
WIP: Rename TribitsWriteClientExportFiles.cmake to TribitsInternalPac…
bartlettroscoe Feb 7, 2023
d8d60ae
WIP: Factor out TribitsProjectWriteConfigFile.cmake, reorder funcs (#63)
bartlettroscoe Feb 7, 2023
f14bba2
WIP: Rename func, remove unused funcs (#63)
bartlettroscoe Feb 7, 2023
bdd12c9
WIP: Remove 'Fully' from 'Fully TriBITS-Compliant' (and variations) (…
bartlettroscoe Feb 7, 2023
a2a5b99
Move 'CMake Language Overview and Gotchas' to appendix
bartlettroscoe Feb 9, 2023
61eaf6a
Remove debug print statement that got commited by accident
bartlettroscoe Feb 9, 2023
ba9de28
Adjust logic and printing for setting INTTERNAL packages as EXTERNAL …
bartlettroscoe Feb 18, 2023
80bd994
Update some outputing for TriBITS-compliant external packages (#63)
bartlettroscoe Feb 19, 2023
31de1fe
Add definitions of TriBITS-compliant packages (#63)
bartlettroscoe Feb 20, 2023
652d189
Add links to TriBITS-compliant external package in requirements for F…
bartlettroscoe Feb 20, 2023
8fc1e25
Add build ref item for treating internal packages as external (#634)
bartlettroscoe Feb 21, 2023
2bcc17f
Add CHANGLOG.md entry for -D<Project>_ENABLE_<TplName>=ON (#63, #546)
bartlettroscoe Feb 21, 2023
68c83ef
Add documentation for TriBITS-compliant external packages TRIBITS_PKG…
bartlettroscoe Feb 21, 2023
f8c1ea5
Add CHANGLOG.md entry for supporting pre-installed packages (#63)
bartlettroscoe Feb 21, 2023
f75343e
Merge remote-tracking branch 'github/master' into 63-combined-package…
bartlettroscoe Feb 25, 2023
2de8ca1
Merge branch 'master' into 63-combined-package-data-structures-6
bartlettroscoe Feb 25, 2023
f58975f
Merge remote-tracking branch 'github/master' into 63-combined-package…
bartlettroscoe Feb 28, 2023
90b96ee
Fix some documentation and add new functions to generated docs (#63, …
bartlettroscoe Mar 29, 2023
16b1817
Fix spelling of TribitsCMakeLanguageOverviewAndGotchas.rst (#63, #560)
bartlettroscoe Mar 29, 2023
014a153
Remove unused legacy RELATIVE_PATH code (#63, #560)
bartlettroscoe Mar 29, 2023
ee67e05
Merge remote-tracking branch 'github/master' into 63-combined-package…
bartlettroscoe Mar 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions test/core/ExamplesUnitTests/TribitsExampleProject_Tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3236,7 +3236,7 @@ tribits_add_advanced_test( TribitsExampleProject_External_SimpleCxx
-DTribitsExProj_ENABLE_SECONDARY_TESTED_CODE=ON
-DTribitsExProj_ENABLE_SimpleCxx=ON
-DCMAKE_INSTALL_PREFIX=../install/simple_cxx
# ToDo: Add option to stop install of TribitsExProjConfig.cmake ...
-DTribitsExProj_SKIP_INSTALL_PROJECT_CMAKE_CONFIG_FILES=TRUE
-DTPL_ENABLE_MPI=OFF
-DTPL_ENABLE_SimpleTpl=ON
-DSimpleTpl_INCLUDE_DIRS=${SimpleTpl_install_STATIC_DIR}/install/include
Expand All @@ -3259,17 +3259,26 @@ tribits_add_advanced_test( TribitsExampleProject_External_SimpleCxx
SKIP_CLEAN_WORKING_DIRECTORY

TEST_4
MESSAGE "Make sure only SimpleCxxConfig.cmake was installed"
CMND ls ARGS install/simple_cxx/lib/cmake
PASS_REGULAR_EXPRESSION_ALL
"SimpleCxx"
FAIL_REGULAR_EXPRESSION
"TribitsExProj"
ALWAYS_FAIL_ON_NONZERO_RETURN

TEST_5
MESSAGE "Remove the build directory for SimpleCxx"
CMND ${CMAKE_COMMAND} ARGS -E rm -R Build_SimpleCxx

TEST_5
TEST_6
MESSAGE "Remove the source directory for SimpleCxx"
CMND ${CMAKE_COMMAND} ARGS -E rm -R
TribitsExampleProject/packages/simple_cxx/CMakeLists.txt
TribitsExampleProject/packages/simple_cxx/src
TribitsExampleProject/packages/simple_cxx/test

TEST_6
TEST_7
MESSAGE "Configure rest of TribitsExampleProject against pre-installed SimpleCxx"
CMND ${CMAKE_COMMAND}
WORKING_DIRECTORY Build
Expand Down Expand Up @@ -3318,13 +3327,13 @@ tribits_add_advanced_test( TribitsExampleProject_External_SimpleCxx
"Configuring done"
ALWAYS_FAIL_ON_NONZERO_RETURN

TEST_7
TEST_8
MESSAGE "Build TribitsExampleProject"
CMND make ARGS ${CTEST_BUILD_FLAGS}
WORKING_DIRECTORY Build
SKIP_CLEAN_WORKING_DIRECTORY

TEST_8
TEST_9
MESSAGE "Run all the tests with ctest"
WORKING_DIRECTORY Build
SKIP_CLEAN_WORKING_DIRECTORY
Expand All @@ -3338,8 +3347,11 @@ tribits_add_advanced_test( TribitsExampleProject_External_SimpleCxx
# NOTE: The above test is a strong check that SimpleCxx is built and installed
# first and then is used in the later build of the rest of
# TribitsExampleProject. If you comment out -DTPL_ENABLE_SimpleCxx=ON, then
# it will not build!

# it will not build! This test also uniquely tests a few other TriBITS features:
#
# * <Project>_SKIP_INSTALL_PROJECT_CMAKE_CONFIG_FILES (ensures the directory
# * install/simple_cxx/lib/cmake/TribitsExProj does not get created and
# * therefore the file TribitsExProjConfig.cmake does not get installed).

if (TribitsExampleProject_External_SimpleCxx_NAME)
set_tests_properties(${TribitsExampleProject_External_SimpleCxx_NAME}
Expand Down
5 changes: 5 additions & 0 deletions tribits/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ ChangeLog for TriBITS

## 2023-10-25:

* **Added:** New option `<Project>_SKIP_INSTALL_PROJECT_CMAKE_CONFIG_FILES`
skips the install of the project-level `<Project>Config.cmake` file. The
default value is ``FALSE`` so as to maintain backward compatibility. (The
project can change the default.)

* **Changed:** External packages/TPLs are now processed at the base project
scope level. This allows simple `set()` statements in package module files
or config files included by `find_package()` to have project-level scope for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ set(tribits_install_src
"${${PROJECT_NAME}_TRIBITS_DIR}/${TRIBITS_CMAKE_INSTALLATION_FILES_DIR}")

if ( ${PROJECT_NAME}_ENABLE_INSTALL_CMAKE_CONFIG_FILES
AND NOT ${PROJECT_NAME}_ENABLE_INSTALLATION_TESTING
AND (NOT ${PROJECT_NAME}_ENABLE_INSTALLATION_TESTING)
AND (NOT ${PROJECT_NAME}_SKIP_INSTALL_PROJECT_CMAKE_CONFIG_FILES)
)

include(TribitsWriteClientExportFiles)
Expand Down
10 changes: 9 additions & 1 deletion tribits/core/package_arch/TribitsGlobalMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -597,13 +597,21 @@ macro(tribits_define_global_options_and_define_extra_repos)
if ("${${PROJECT_NAME}_ENABLE_INSTALL_CMAKE_CONFIG_FILES_DEFAULT}" STREQUAL "")
set(${PROJECT_NAME}_ENABLE_INSTALL_CMAKE_CONFIG_FILES_DEFAULT OFF)
endif()

advanced_set(${PROJECT_NAME}_ENABLE_INSTALL_CMAKE_CONFIG_FILES
${${PROJECT_NAME}_ENABLE_INSTALL_CMAKE_CONFIG_FILES_DEFAULT}
CACHE BOOL
"Determines if ${PROJECT_NAME}Config.cmake and <PACKAGE>Config.cmake files are created or not."
)

if ("${${PROJECT_NAME}_SKIP_INSTALL_PROJECT_CMAKE_CONFIG_FILES_DEFAULT}" STREQUAL "")
set(${PROJECT_NAME}_SKIP_INSTALL_PROJECT_CMAKE_CONFIG_FILES_DEFAULT OFF)
endif()
advanced_set(${PROJECT_NAME}_SKIP_INSTALL_PROJECT_CMAKE_CONFIG_FILES
${${PROJECT_NAME}_SKIP_INSTALL_PROJECT_CMAKE_CONFIG_FILES_DEFAULT}
bartlettroscoe marked this conversation as resolved.
Show resolved Hide resolved
CACHE BOOL
"Skip installing the file ${PROJECT_NAME}Config.cmake."
)

if (NOT ${PROJECT_NAME}_GENERATE_EXPORT_FILE_DEPENDENCIES_DEFAULT)
# We need to generate the dependency logic for export dependency files if
# asked.
Expand Down
13 changes: 13 additions & 0 deletions tribits/doc/build_ref/TribitsBuildReferenceBody.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2816,13 +2816,26 @@ of packages the files are requested for with::

-D <Project>_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES="<pkg0>;<pkg1>"

To only install the package ``<Package>Config.cmake`` files and **not** the
project-level ``<Project>Config.cmake`` file, configure with::

-D <Project>_ENABLE_INSTALL_CMAKE_CONFIG_FILES=ON \
-D <Project>_SKIP_INSTALL_PROJECT_CMAKE_CONFIG_FILES=ON \

NOTES:

* Only enabled packages will have their export files generated.

* One would only want to limit the export files generated for very large
projects where the cost my be high for doing so.

* One would want to skip the installation of the project-level
``<Project>Config.cmake`` file in cases where the TriBITS project's packages
may be built in smaller subsets of packages in different individual CMake
project builds where there is no clear completion to the installation of the
packages for a given TriBITS project containing a larger collection of
packages.


Generating a project repo version file
--------------------------------------
Expand Down
14 changes: 14 additions & 0 deletions tribits/doc/guides/TribitsCoreDetailedReference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ a given TriBITS project are:
* `${PROJECT_NAME}_REQUIRES_PYTHON`_
* `${PROJECT_NAME}_SET_INSTALL_RPATH`_
* `${PROJECT_NAME}_SHOW_TEST_START_END_DATE_TIME`_
* `${PROJECT_NAME}_SKIP_INSTALL_PROJECT_CMAKE_CONFIG_FILES`_
* `${PROJECT_NAME}_TEST_CATEGORIES`_
* `${PROJECT_NAME}_TPL_SYSTEM_INCLUDE_DIRS`_
* `${PROJECT_NAME}_TRACE_ADD_TEST`_
Expand Down Expand Up @@ -671,6 +672,19 @@ These options are described below.
date/time for regular tests added with `tribits_add_test()`_ (which uses a
raw command with ``add_test()``).

.. _${PROJECT_NAME}_SKIP_INSTALL_PROJECT_CMAKE_CONFIG_FILES:

**${PROJECT_NAME}_SKIP_INSTALL_PROJECT_CMAKE_CONFIG_FILES**

To change the default value of the
``${PROJECT_NAME}_SKIP_INSTALL_PROJECT_CMAKE_CONFIG_FILES`` to ``TRUE``, for
example, for a TriBITS project, set::

set(${PROJECT_NAME}_SKIP_INSTALL_PROJECT_CMAKE_CONFIG_FILES_DEFAULT TRUE)

in the project's `<projectDir>/CMakeLists.txt`_ or
`<projectDir>/ProjectName.cmake`_ files.

.. _${PROJECT_NAME}_SKIP_EXTRAREPOS_FILE:

**${PROJECT_NAME}_SKIP_EXTRAREPOS_FILE**
Expand Down