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

Expand TribitsExampleProject2 packages and TPLs (#299) #469

Merged
merged 15 commits into from
Mar 29, 2022

Conversation

bartlettroscoe
Copy link
Member

@bartlettroscoe bartlettroscoe commented Mar 20, 2022

This is driving #299

I need a deeper set of TPL dependencies to be able to test the next refactoring in TriBITS towards modern CMake targets (#299).

There are also a few related TriBITS changes part of this

  • Add support for <tplName>_ALLOW_PACKAGE_PREFIND (commit 627917c)
  • tribits_tpl_find_include_dirs_and_libraries(): <tplName>_LIBRARY_NAMES cache var triggers lib finds (commit 3764e8b)

NOTE: This PR looks intimidating with 47 changed files and over 900 lines changed but most of that is testing code and very simple code for the TPLs, TribitsExampleProject2, and TribitsExampleApp2.

This updated TribitsExampleProject2 is not quite done yet. I need to update support for optional upstream dependencies correctly to drive varied tests but this PR is a good start.

This is so that when I add new Tpls to this, they will each have their own
install dir to improve testing (but not ease of usage).
Just installs for now.
Just installs for now.
Added Package2 and tests to TribitsExampleProject2.
…S cache var triggers lib finds (#299)

It seems reasonable that if the user needs to define libraries for a TPL with
what otherwise is defined as a TPL with only header files (specified by the
FindTPL<tplName>.cmake file by setting 'REQUIRED_HEADERS' but not
'REQUIRED_LIBS_NAMES') then setting the cache var TPL_<tplName>_LIBRARY_NAMES
should trigger the find for specified libraries.

I will add a real test for this next.
Also:

* I had to add FindTPLTpl2.cmake now that it is being used.

* I made a minor change to Tpl3.cpp to improve code formatting.
Now future refactorings will ensure that the libraries are all listed and in
the right order

As part of this:

* Move NINJA_EXE and rulesNinjaFilePath to CommonArgumentsCMakeProjects.cmake
  so all tests can use it.

* Added -GNinja and -v to build so we can see the link lines
…les (#299)

With this, you only need to set up <tplName>_LIBRARY_DIRS and
<tplName>_INCLUDE_DIRS for the libraries and header files for just those TPLs.
TriBITS takes care of putting the include dirs and library dirs in the right
order after that.

This is what you want you configure lines to work with.

After we add TPL dependencies, then we can remove the "ToDo:" lines added in
the package cmake/Dependencies.cmake files as we don't need to list all of the
(indirect) dependent upstream TPLs.

NOTE: The strong tests that check that the right TPL libraries are present and
in the right order still pass.  That shows that old-school TriBITS is doing
its job.
…_tpl_vars tests (#299)

This shows that setting explict TPL libraries and include dirs also works as
it should and avoids the need for any find operations.
This is needed to force off the prefind for TPLs that are set up to use
find_package().

I needed to add this for the updated TribitsExampleProject2_find_tpl_parts
tests that only set CMAKE_PREFIX_PATH but still wanted to run the individual
find_file() and find_library() functions.
* The library tpl2a depends on tpl1::tpl1 but not the library tpl2b according
  to the Tpl2::b_deps()

* Package3 depends on Package2, Package1, Tpl4, and Tpl2 and **not** Tpl3

* I adjusted formatting of deps() functions to make dependencies more clear
@bartlettroscoe bartlettroscoe force-pushed the 299-expanded-example2 branch from 69c8e6f to 61958f1 Compare March 26, 2022 14:19
I had to modify the test for the TribitsExampleProject2_find_package case
because TribitsExampleProject2 has not been updated for the internal
find_package() case yet.
@bartlettroscoe bartlettroscoe force-pushed the 299-expanded-example2 branch from 61958f1 to 8c5e182 Compare March 28, 2022 15:13
@bartlettroscoe bartlettroscoe force-pushed the 299-expanded-example2 branch from 8c5e182 to 425b044 Compare March 29, 2022 01:43
@bartlettroscoe bartlettroscoe changed the title WIP: Expand TribitsExampleProject2 packages and TPLs (#299) Expand TribitsExampleProject2 packages and TPLs (#299) Mar 29, 2022
@bartlettroscoe bartlettroscoe requested review from keitat and removed request for keitat March 29, 2022 01:50
@bartlettroscoe
Copy link
Member Author

Since no one is going to review this anytime soon, I will go ahead and merge. One can always do a post-merge review if needed.

@bartlettroscoe bartlettroscoe requested review from rabartlett1972 and removed request for rabartlett1972 March 29, 2022 14:37
rabartlett1972
rabartlett1972 previously approved these changes Mar 29, 2022
Copy link
Collaborator

@rabartlett1972 rabartlett1972 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (I am the same person who wrote it so I can't do a better job of reviewing this than myself).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: core component: documentation component: testing Dealing with automated testing not specific to any other component
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants