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

Allow 100% raw CMake to be used in a TriBITS-compliant package (#582) #591

Merged
merged 31 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
11f57fc
Codespell: Add ignores for sphinx generated documents
bartlettroscoe Jul 28, 2023
139928c
tribits_sort_list_according_to_master_list(): Update doc and var name…
bartlettroscoe Sep 5, 2023
9bc7092
Move TribitsSortListAccordingToMasterList.cmake to tribits/core/utils…
bartlettroscoe Sep 5, 2023
4cf58ea
Minor formatting update (#582)
bartlettroscoe Sep 5, 2023
297f55f
WIP: Add failing test for using raw CMake for Package1 in TriBITS pro…
bartlettroscoe Jul 14, 2023
3fc5a44
Rename function and improve documentation (#582)
bartlettroscoe Jul 18, 2023
11ad538
Make TriBITS package with raw CMake work (#582)
bartlettroscoe Jul 18, 2023
5aa2622
Remove special raw CMake package logic for lib install dir (#582)
bartlettroscoe Aug 3, 2023
0cfa82a
Set TribitsExProj2_USE_GNUINSTALLDIRS=ON only for find_package tests …
bartlettroscoe Aug 4, 2023
509cdb0
WIP: Add failing test for using tribits_add_test() in raw CMake packa…
bartlettroscoe Aug 22, 2023
67a1f79
Make tribits_add_test() work from a raw CMake package in TriBITS proj…
bartlettroscoe Aug 22, 2023
83bc795
Enable tests for raw CMake Package1 stand-alone configuration (#582)
bartlettroscoe Aug 22, 2023
74ad726
Add TribitsSetCacheVarAndDefault.cmake (#582)
bartlettroscoe Sep 1, 2023
b49a5b0
Move <Project>_TRACE_ADD_TEST to TribitsAddTestHelpers.cmake
bartlettroscoe Sep 4, 2023
3f284fd
WIP: Add failing test for using TirBITS tests functions in a raw CMak…
bartlettroscoe Aug 22, 2023
286a275
Get tribits_add_test() to work with raw CMake project (#582)
bartlettroscoe Sep 5, 2023
c4b2745
Break out tribits_add_test() modules to core/test_support/ (#368, #582)
bartlettroscoe Sep 5, 2023
1f69bbb
Rename 'Package_by_Package' to 'PBP' (#582)
bartlettroscoe Sep 5, 2023
7332f9b
Get tribits_add_advanced_test() to work from non-CMake projects (#368…
bartlettroscoe Sep 6, 2023
9a09873
Move TribitsAddAdvancedTest[Helper].cmake to core/test_support/ (#368…
bartlettroscoe Sep 6, 2023
fcd82bb
tribits_add_advanced_test(): Update section on using in non-TriBITS p…
bartlettroscoe Sep 6, 2023
950e528
Break out clean CMakeLists.[raw|tribits].cmake files (#582)
bartlettroscoe Sep 6, 2023
32f8247
Add conditional for generating <Package>Config.cmake for build dir (#…
bartlettroscoe Sep 7, 2023
8f66678
Factor longer parts out of base CMakeLists.raw.cmake to streamline (#…
bartlettroscoe Sep 8, 2023
762db6e
Add NAME and COMMAND to add_test() command in build ref doc (#582)
bartlettroscoe Sep 14, 2023
967b32e
Add HowTos for TriBITS-compliant raw CMake packages (#582)
bartlettroscoe Sep 14, 2023
e7f4a01
Add section 'How to use TriBITS testing support in non-TriBITS projec…
bartlettroscoe Sep 14, 2023
5eae2ca
Fix spelling of package1ConfigRegex (#582)
bartlettroscoe Sep 19, 2023
e507636
Remove unneeded quotes around args (#582)
bartlettroscoe Sep 19, 2023
4d848d8
Remove duplication in tribits_advanced_set_cache_var_and_default() (#…
bartlettroscoe Sep 19, 2023
c941426
Do edits to new howto sections in users guide (#368, #582)
bartlettroscoe Sep 21, 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
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ check-filenames =
check-hidden =
# Disable warnings about binary files
quiet-level = 2
skip = */.git,*/common_tools/cloc,*/TriBITSDoc,*/tribits/doc/guides/rst2latex.tex
skip = */.git,*/common_tools/cloc,*/TriBITSDoc,*/tribits/doc/guides/rst2latex.tex,*/*.js,*/*.svg,*/tribits/doc/sphinx/*/index.html
ignore-words-list = thur,inout,te,nd,lod,aci,nin,nnumber,wile,reall,bu,somewhere
2 changes: 1 addition & 1 deletion test/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ tribits_add_advanced_test( TestingFunctionMacro_UnitTests
-D${PROJECT_NAME}_TRIBITS_DIR=${${PROJECT_NAME}_TRIBITS_DIR}
-P "${CMAKE_CURRENT_SOURCE_DIR}/TestingFunctionMacro_UnitTests.cmake"
PASS_REGULAR_EXPRESSION_ALL
"Final UnitTests Result: num_run = 721"
"Final UnitTests Result: num_run = 720"
"Final UnitTests Result: PASSED"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ set(${PROJECT_NAME}_TRACE_ADD_TEST TRUE)
set(${PROJECT_NAME}_TRIBITS_DIR ${TRIBITS_DIR})
set(PACKAGE_NAME ${PROJECT_NAME})
set(${PACKAGE_NAME}_ENABLE_TESTS TRUE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
${TRIBITS_DIR}/core/utils
${TRIBITS_DIR}/core/package_arch )
list(PREPEND CMAKE_MODULE_PATH ${TRIBITS_DIR}/core/test_support)
include(TribitsAddAdvancedTest)
include(CTest)
enable_testing()
50 changes: 35 additions & 15 deletions test/core/ExamplesUnitTests/TribitsExampleApp2_Tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,40 @@ endif()


function(TribitsExampleApp2 tribitsExProj2TestNameBaseBase
sharedOrStatic fullOrComponents
sharedOrStatic package1TribitsOrRawCMake fullOrComponents
)

if (sharedOrStatic STREQUAL "SHARED")
set(buildSharedLibsArg -DBUILD_SHARED_LIBS=ON)
elseif (sharedOrStatic STREQUAL "STATIC")
set(buildSharedLibsArg -DBUILD_SHARED_LIBS=OFF)
else()
message(FATAL_ERROR "Invalid value of buildSharedLibsArg='${buildSharedLibsArg}'!")
message(FATAL_ERROR "Invalid value of sharedOrStatic='${sharedOrStatic}'!")
endif()
set(tribitsExProj2Suffix "${sharedOrStatic}")

if ( (package1TribitsOrRawCMake STREQUAL "") OR
(package1TribitsOrRawCMake STREQUAL "PACKAGE1_USE_TRIBITS")
)
set(package1UseRawCMakeArgs "")
elseif (package1TribitsOrRawCMake STREQUAL "PACKAGE1_USE_RAW_CMAKE")
set(package1UseRawCMakeArgs "-D Package1_USE_RAW_CMAKE=TRUE")
string(APPEND tribitsExProj2Suffix "_${package1TribitsOrRawCMake}")
else()
message(FATAL_ERROR "package1UseRawCMakeArgs='${package1UseRawCMakeArgs}' Invalid!")
endif()


set(fullDepsRegex "Full Deps: Package3{Package2{Package1{tpl1}, Tpl3{Tpl2a{tpl1}, Tpl2b{no deps}}}, Package1{tpl1}, Tpl4{Tpl3{Tpl2a{tpl1}, Tpl2b{no deps}}, Tpl2a{tpl1}, Tpl2b{no deps}}, Tpl2a{tpl1}, Tpl2b{no deps}}")

if (fullOrComponents STREQUAL "FULL")
set(tribitsExProjUseComponentsArg "")
set(packageListRegex "TribitsExProj2_PACKAGE_LIST = Package3[;]Package2[;]Package1")
elseif (fullOrComponents STREQUAL "COMPONENTS")
set(tribitsExProjUseComponentsArg
-DTribitsExApp2_FIND_INDIVIDUAL_PACKAGES=ON
-DTribitsExApp2_USE_COMPONENTS="Package1,Package2,Package3")
set(packageListRegex "Found Package1;Found Package2;Found Package3")
else()
message(FATAL_ERROR "Invalid value of fullOrComponents='${fullOrComponents}'!")
endif()
Expand All @@ -113,7 +129,7 @@ function(TribitsExampleApp2 tribitsExProj2TestNameBaseBase
set(fullDepsRegex "Full Deps: Package3{Package1{tpl1}, Tpl2a{tpl1}, Tpl2b{no deps}}")
endif()

set(testSuffix ${sharedOrStatic}_${fullOrComponents})
set(testSuffix ${tribitsExProj2Suffix}_${fullOrComponents})
set(testBaseName
${CMAKE_CURRENT_FUNCTION}_${tribitsExProj2TestNameBaseBase}_${testSuffix})
set(testName ${PACKAGE_NAME}_${testBaseName})
Expand All @@ -129,11 +145,11 @@ function(TribitsExampleApp2 tribitsExProj2TestNameBaseBase
MESSAGE "Configure TribitsExampleApp2 locally against already installed TribitsExProject2"
WORKING_DIRECTORY app_build
CMND ${CMAKE_COMMAND} ARGS
-DCMAKE_PREFIX_PATH=${${tribitsExProj2TestNameBaseBase}_${sharedOrStatic}_INSTALL_DIR}
-DCMAKE_PREFIX_PATH=${${tribitsExProj2TestNameBaseBase}_${tribitsExProj2Suffix}_INSTALL_DIR}
${tribitsExProjUseComponentsArg}
${${PROJECT_NAME}_TRIBITS_DIR}/examples/TribitsExampleApp2
PASS_REGULAR_EXPRESSION_ALL
"TribitsExProj2_PACKAGE_LIST = Package3[;]Package2[;]Package1"
"${packageListRegex}"
"-- Configuring done"
"-- Generating done"
"-- Build files have been written to: .*/${testName}/app_build"
Expand Down Expand Up @@ -169,20 +185,24 @@ function(TribitsExampleApp2 tribitsExProj2TestNameBaseBase

if (${testNameBase}_NAME)
set_tests_properties(${${testNameBase}_NAME}
PROPERTIES DEPENDS ${${tribitsExProj2TestNameBaseBase}_${sharedOrStatic}_NAME} )
PROPERTIES DEPENDS ${${tribitsExProj2TestNameBaseBase}_${tribitsExProj2Suffix}_NAME}
)
endif()

endfunction()


TribitsExampleApp2(TribitsExampleProject2_find_tpl_parts STATIC FULL)
TribitsExampleApp2(TribitsExampleProject2_find_tpl_parts STATIC "" FULL)
# NOTE: We don't need to test the permutation SHARED FULL as well. That does
# not really test anything new given that shared is tested with COMPONENTS.
TribitsExampleApp2(TribitsExampleProject2_find_tpl_parts STATIC COMPONENTS)
TribitsExampleApp2(TribitsExampleProject2_find_tpl_parts SHARED COMPONENTS)
TribitsExampleApp2(TribitsExampleProject2_find_tpl_parts_no_optional_packages_tpls STATIC COMPONENTS)
TribitsExampleApp2(TribitsExampleProject2_find_tpl_parts_no_optional_packages_tpls SHARED COMPONENTS)
TribitsExampleApp2(TribitsExampleProject2_explicit_tpl_vars STATIC COMPONENTS)
TribitsExampleApp2(TribitsExampleProject2_explicit_tpl_vars SHARED COMPONENTS)
TribitsExampleApp2(TribitsExampleProject2_find_package SHARED COMPONENTS)
TribitsExampleApp2(TribitsExampleProject2_find_package STATIC COMPONENTS)
TribitsExampleApp2(TribitsExampleProject2_find_tpl_parts STATIC "" COMPONENTS)
TribitsExampleApp2(TribitsExampleProject2_find_tpl_parts SHARED "" COMPONENTS)
TribitsExampleApp2(TribitsExampleProject2_find_tpl_parts_no_optional_packages_tpls STATIC "" COMPONENTS)
TribitsExampleApp2(TribitsExampleProject2_find_tpl_parts_no_optional_packages_tpls SHARED "" COMPONENTS)
TribitsExampleApp2(TribitsExampleProject2_explicit_tpl_vars STATIC "" COMPONENTS)
TribitsExampleApp2(TribitsExampleProject2_explicit_tpl_vars SHARED "" COMPONENTS)
TribitsExampleApp2(TribitsExampleProject2_find_package SHARED "" COMPONENTS)
TribitsExampleApp2(TribitsExampleProject2_find_package STATIC "" COMPONENTS)
TribitsExampleApp2(TribitsExampleProject2_find_package SHARED PACKAGE1_USE_RAW_CMAKE COMPONENTS)
TribitsExampleApp2(TribitsExampleProject2_find_package STATIC PACKAGE1_USE_RAW_CMAKE COMPONENTS)
TribitsExampleApp2(TribitsExampleProject2_find_package STATIC PACKAGE1_USE_RAW_CMAKE FULL)
Loading
Loading