-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finish basic implentation for building against external packages (#63)
This demonstates the basic use case building and installing an internal package and then building the reaming packages against it as an external package. This adds a first test to get TribitsExampleProject to build against external SimpleCxx. Just a few things had to be tweaked to get this to work: * Set <Package>_FINDMOD to "TRIBITS_PKG": There was existing, no-tested logic in TriBITS added a long time ago to treat pre-installed TriBITS packages as TPLs. Therefore, I just needed to set <Package>_FINDMOD to "TRIBITS_PKG" for internal packages being treated as external packages and that was it! * Cleaned up the existing code to call find_package(${TPL_NAME}). (This code will be refactored to clean it up some.) * Aggregated logic for expected output from TribitsExampeProject tests into a single file ExpectedDepsStrings.cmake so that it works even when a package's CMakeLists.txt file is not processed (because it is being treated as external).
- Loading branch information
1 parent
5403385
commit 7ad12ad
Showing
7 changed files
with
158 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
tribits/examples/TribitsExampleProject/cmake/ExpectedDepsStrings.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# This file contains logic for the expected dependencies for each package and | ||
# TPLs used in TribitsExampleProject. This logic is contained here instead of | ||
# in the packages's CMakeLists.txt files in case some of these are pulled in | ||
# as external packages and that package's CMakeLists.txt files are not | ||
# actually processed. | ||
|
||
tribits_get_package_enable_status(SimpleCxx SimpleCxx_enabled "") | ||
print_var(SimpleCxx_enabled) | ||
print_var(SimpleCxx_ENABLE_SimpleTpl) | ||
if (SimpleCxx_enabled) | ||
if (SimpleCxx_ENABLE_SimpleTpl) | ||
set(simpletplText "simpletpl ") | ||
else() | ||
set(simpletplText) | ||
endif() | ||
set(EXPECTED_SIMPLECXX_AND_DEPS | ||
"SimpleCxx ${simpletplText}headeronlytpl") | ||
endif() | ||
print_var(EXPECTED_SIMPLECXX_AND_DEPS) | ||
|
||
tribits_get_package_enable_status(InsertedPkg InsertedPkg_enabled "") | ||
if (InsertedPkg_enabled) | ||
set(EXPECTED_INSERTEDPKG_AND_DEPS "InsertedPkg ${EXPECTED_SIMPLECXX_AND_DEPS}") | ||
set(EXPECTED_INSERTEDPKG_AND_DEPS_STR "${EXPECTED_INSERTEDPKG_AND_DEPS} ") | ||
else() | ||
set(EXPECTED_INSERTEDPKG_DEPS "") | ||
set(EXPECTED_INSERTEDPKG_DEPS_STR "") | ||
endif() | ||
print_var(EXPECTED_INSERTEDPKG_DEPS) | ||
print_var(EXPECTED_INSERTEDPKG_DEPS_STR) | ||
|
||
tribits_get_package_enable_status(WithSubpackagesA WithSubpackagesA_enabled "") | ||
if (WithSubpackagesA_enabled) | ||
set(EXPECTED_A_AND_DEPS "A ${EXPECTED_SIMPLECXX_AND_DEPS}") | ||
set(EXPECTED_A_AND_DEPS_STR "${EXPECTED_A_AND_DEPS} ") | ||
else() | ||
set(EXPECTED_A_AND_DEPS "") | ||
set(EXPECTED_A_AND_DEPS_STR "") | ||
endif() | ||
print_var(EXPECTED_A_AND_DEPS) | ||
print_var(EXPECTED_A_AND_DEPS_STR) | ||
|
||
tribits_get_package_enable_status(WithSubpackagesB WithSubpackagesB_enabled "") | ||
if (WithSubpackagesB_enabled) | ||
set(EXPECTED_B_DEPS | ||
"${EXPECTED_A_AND_DEPS_STR}${EXPECTED_INSERTEDPKG_AND_DEPS_STR}${EXPECTED_SIMPLECXX_AND_DEPS}") | ||
endif() | ||
print_var(EXPECTED_B_DEPS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters