Skip to content

Commit

Permalink
Automatic snapshot commit from tribits at fdcb5866
Browse files Browse the repository at this point in the history
Origin repo remote tracking branch: 'github/master'
Origin repo remote repo URL: 'github = [email protected]:TriBITSPub/TriBITS.git'
Git describe: tribits_start-3538-gc26021ea

At commit:

commit fdcb58666db7768994bcbd0a53d7e07cf0119bba
Author:  Roscoe A. Bartlett <[email protected]>
Date:    Fri Feb 21 10:06:46 2025 -0700
Summary: Add INTERFACE_LIBRARY targets to <Package>::all_libs target (#625)

Signed-off-by: Roscoe A. Bartlett <[email protected]>
  • Loading branch information
bartlettroscoe committed Feb 23, 2025
1 parent e127b7b commit 613afcf
Show file tree
Hide file tree
Showing 30 changed files with 189 additions and 91 deletions.
12 changes: 9 additions & 3 deletions cmake/tribits/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
ChangeLog for TriBITS
----------------------------------------

## 2025-02-17:

* **Added:** Added support for header-only libraries with
`tribits_add_library()` with new keyword `HEADERONLY`. See
updated documentation.

## 2024-10-08:

* **Changed:** The TriBITS framework find operation for
Expand All @@ -14,7 +20,7 @@ ChangeLog for TriBITS
when upgrading TriBITS. (This change can be made automatically in all of
the project's CMake files by running the script
`tribits/refactoring/to-python3.sh <dir>`.) However, backward compatibility
is provided for users confiugring TriBITS CMake projects which set `-D
is provided for users configuring TriBITS CMake projects which set `-D
PYTHON_EXECUTABLE=<path>`. In this case, if user sets `-D
PYTHON_EXECUTABLE=<path>` in the cache, TriBITS will set that value `<path>`
to the variable `Python3_EXECUTABLE` and avoid the call to
Expand Down Expand Up @@ -292,7 +298,7 @@ ChangeLog for TriBITS
`<tplName>_LIB_ALL_DEPENDENCIES`. Now `<tplName>_LIB_ENABLED_DEPENDENCIES`
is automatically set from `<tplName>_LIB_ALL_DEPENDENCIES` based on what
TPLs are actually enabled. This avoids the problem described below from
directly setting `<tplName>_LIB_ENABLED_DEPENDENCIES` without reguard to
directly setting `<tplName>_LIB_ENABLED_DEPENDENCIES` without regard to
what TPLs are actually enabled. This maintains backward compatibility for
existing configure scripts where an upstream TPL may not be enabled in some
strange configure scripts (see
Expand Down Expand Up @@ -347,7 +353,7 @@ ChangeLog for TriBITS
(in order to simplify internal TriBITS logic). However, a side-effect of
this change is that CMake code that was ifed out with an `if
(${PACKAGE_NAME}_ENABLE_<depPkg>)` statement (because that variable was not
defined and therefore defaults to `FLASE`) for a required upstream
defined and therefore defaults to `FALSE`) for a required upstream
dependency `<depPkg>` will now be enabled. (This mistake can happen when an
optional dependency `<depPkg>` is changed to a required dependency but the
`if()` statements based on `${PACKAGE_NAME}_ENABLE_<depPkg>` are not
Expand Down
4 changes: 2 additions & 2 deletions cmake/tribits/ci_support/CDashQueryAnalyzeReport.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def assertExpectedNumColsFromCsvFile(csvFileName, dataRow, lineList,
raise Exception(
"Error, for CSV file '"+csvFileName+"' the data row"+\
" "+str(dataRow)+" "+str(lineList)+" has"+\
" "+str(len(lineList))+" entries which does not macth"+\
" "+str(len(lineList))+" entries which does not match"+\
" the number of column headers "+str(len(columnHeadersList))+"!")


Expand Down Expand Up @@ -1068,7 +1068,7 @@ def lookupDictGivenLookupDict(lookupDict, listOfKeys, listOfValues,
# given a list key/value pairs to match
#
# Once created, this object acts like a list of dicts in most cases but also
# contains functions to search for speicfic dicts given a set of key/value
# contains functions to search for specific dicts given a set of key/value
# pairs.
#
# Any modifications to the dicts looked up with this object will edit the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def writeNewIssueTrackerFile(self, issueTrackerText):

def writeNewTestsWithIssueTrackersFile(self, uniqNonpassingTestsLOD):
if self.options.newTestsWithIssueTrackersFile:
print("\nWriting out list of test/biuld pairs for CSV file '"\
print("\nWriting out list of test/build pairs for CSV file '"\
+self.options.newTestsWithIssueTrackersFile+"'")
csvFileStruct = CDQAR.writeTestsListOfDictsToCsvFileStructure(uniqNonpassingTestsLOD,
self.issueTrackerUrlTemplate, self.issueTrackerTemplate )
Expand Down
2 changes: 1 addition & 1 deletion cmake/tribits/ci_support/TribitsDumpDepsXmlScript.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ endif()
# Execute the rest of the script now that everything has been asserted or found
#

# Get the TRIBITS_DIR (we can always find this easy since this scrit is in TriBITS)
# Get the TRIBITS_DIR (we can always find this easy since this script is in TriBITS)
get_filename_component( ${PROJECT_NAME}_TRIBITS_DIR "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE )
message("-- Setting ${PROJECT_NAME}_TRIBITS_DIR=${${PROJECT_NAME}_TRIBITS_DIR}")

Expand Down
2 changes: 1 addition & 1 deletion cmake/tribits/ci_support/TribitsPackageFilePathUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#
# In general, any file at the top level <projectDir>/ or under the
# <projectDir>/cmake/ directory with the extension *.cmake is considered a
# file that requires a global rebuild of all packaes. However, there are a
# file that requires a global rebuild of all packages. However, there are a
# few special files that we don't want to have to do a global rebuild for by
# default.
#
Expand Down
4 changes: 2 additions & 2 deletions cmake/tribits/ci_support/cdash_build_testing_date.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def getTimeZoneOffset(timeZoneStr):
# Return a timezone aware datetime object given an input date and time given
# in the format "<YYYY>-<MM>-<DD>T<hh>:<mm>:<ss> <TZ>".
#
# Note. the timzone <TZ> can be any of those supported by the function
# Note. the timezone <TZ> can be any of those supported by the function
# getTimeZoneOffset()
def getBuildStartTimeUtcFromStr(buildStartTimeStr):
buildStartTimeStrArray = buildStartTimeStr.split(" ")
Expand Down Expand Up @@ -156,7 +156,7 @@ def getDateOnlyFromDateTime(dateTime):
#
# buildStartTimeStr [in]: The 'buildstarttime' field string as returned from
# CDash in the format "<YYYY>-<MM>-<DD>T<hh>:<mm>:<ss> <TZ>". Note. the
# timzone <TZ> can be any of those supported by the function
# timezone <TZ> can be any of those supported by the function
# getTimeZoneOffset()
#
# testingDayStartTimeUtcTD [in]: The testing day start time as the a timedelta
Expand Down
2 changes: 1 addition & 1 deletion cmake/tribits/ci_support/is_checkin_tested_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
gitRef = "HEAD"

#
# B) Deterimine if the commit was tested and pushed with checkin-test.py
# B) Determine if the commit was tested and pushed with checkin-test.py
# script.
#

Expand Down
2 changes: 1 addition & 1 deletion cmake/tribits/core/config_tests/BLASMangling.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# appended.
#
# BLAS_FUNC_DEFAULT
# The default mange mangling for Fortran functions
# The default mangling for Fortran functions
# that do not contain an underscore.
#
# The Fortran 2003 name binding facilities and ISO_C_BINDING module
Expand Down
4 changes: 2 additions & 2 deletions cmake/tribits/core/config_tests/FortranMangling.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ include(GlobalSet)
# appended.
#
# FC_FUNC_DEFAULT
# The default mange mangling for Fortran functions
# The default mangling for Fortran functions
# that do not contain an underscore.
#
# FC_FUNC__DEFAULT
# The default mange mangling for Fortran functions
# The default mangling for Fortran functions
# that do contain an underscore.
#
# The Fortran 2003 name binding facilities and ISO_C_BINDING module
Expand Down
68 changes: 46 additions & 22 deletions cmake/tribits/core/package_arch/TribitsAddLibrary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ include(TribitsSetAndIncDirs)
# [HEADERS <h0> <h1> ...]
# [HEADERS_INSTALL_SUBDIR <headerssubdir>]
# [NOINSTALLHEADERS <nih0> <hih1> ...]
# [SOURCES <src0> <src1> ...]
# [SOURCES <src0> <src1> ...|HEADERONLY]
# [DEPLIBS <deplib0> <deplib1> ...]
# [IMPORTEDLIBS <ideplib0> <ideplib1> ...]
# [STATIC|SHARED]
Expand Down Expand Up @@ -150,6 +150,12 @@ include(TribitsSetAndIncDirs)
# if, for example, ``-fPIC`` is specified). So be careful to use
# ``STATIC`` in all downstream libraries!
#
# ``HEADERONLY``
#
# If passed in, then the ``<libTargetName>`` library target will be
# declared ``INTERFACE`` and the ``SOURCES`` argument must be empty. This
# is used to create a header-only library.
#
# ``TESTONLY``
#
# If passed in, then ``<libTargetName>`` will **not** be added to
Expand Down Expand Up @@ -319,7 +325,7 @@ function(tribits_add_library LIBRARY_NAME_IN)
#prefix
PARSE
#Options
"STATIC;SHARED;TESTONLY;NO_INSTALL_LIB_OR_HEADERS;CUDALIBRARY"
"STATIC;SHARED;HEADERONLY;TESTONLY;NO_INSTALL_LIB_OR_HEADERS;CUDALIBRARY"
#one_value_keywords
""
#mulit_value_keywords
Expand Down Expand Up @@ -369,27 +375,39 @@ function(tribits_add_library LIBRARY_NAME_IN)
add_definitions(${PARSE_DEFINES})
endif()

if (PARSE_HEADERONLY)
set(tribitsAddLibraryIncludeDirsMode "INTERFACE")
else()
set(tribitsAddLibraryIncludeDirsMode "PUBLIC")
endif()

set(STATIC_KEYWORD "")
set(SHARED_KEYWORD "")

if (PARSE_STATIC)
set(STATIC_KEYWORD "STATIC")
else()
set(STATIC_KEYWORD "")
endif()

if (PARSE_SHARED)
set(SHARED_KEYWORD "SHARED")
else()
set(SHARED_KEYWORD "")
endif()

if (NOT PARSE_CUDALIBRARY)
add_library(
${LIBRARY_NAME}
${STATIC_KEYWORD}
${SHARED_KEYWORD}
${PARSE_HEADERS}
${PARSE_NOINSTALLHEADERS}
${PARSE_SOURCES}
)
if (PARSE_HEADERONLY)
add_library(
${LIBRARY_NAME}
INTERFACE
)
else()
add_library(
${LIBRARY_NAME}
${STATIC_KEYWORD}
${SHARED_KEYWORD}
${PARSE_HEADERS}
${PARSE_NOINSTALLHEADERS}
${PARSE_SOURCES}
)
endif()
else()
cuda_add_library(
${LIBRARY_NAME}
Expand Down Expand Up @@ -433,30 +451,35 @@ function(tribits_add_library LIBRARY_NAME_IN)

# DEPLIBS
foreach(depLib ${PARSE_DEPLIBS})
target_link_libraries(${LIBRARY_NAME} PUBLIC "${LIBRARY_NAME_PREFIX}${depLib}")
target_link_libraries(${LIBRARY_NAME}
${tribitsAddLibraryIncludeDirsMode} "${LIBRARY_NAME_PREFIX}${depLib}")
endforeach()
# ${PACKAGE_NAME}_LIBRARIES
target_link_libraries(${LIBRARY_NAME} PUBLIC ${${PACKAGE_NAME}_LIBRARIES})
target_link_libraries(${LIBRARY_NAME}
${tribitsAddLibraryIncludeDirsMode} ${${PACKAGE_NAME}_LIBRARIES})
# ${PACKAGE_NAME}_LIB_ENABLED_DEPENDENCIES
foreach(depPkg IN LISTS ${PACKAGE_NAME}_LIB_ENABLED_DEPENDENCIES)
target_link_libraries(${LIBRARY_NAME} PUBLIC ${depPkg}::all_libs)
target_link_libraries(${LIBRARY_NAME}
${tribitsAddLibraryIncludeDirsMode} ${depPkg}::all_libs)
endforeach()
# ${PACKAGE_NAME}_TEST_ENABLED_DEPENDENCIES (TESTONLY lib)
if (PARSE_TESTONLY)
foreach(depPkg IN LISTS ${PACKAGE_NAME}_TEST_ENABLED_DEPENDENCIES)
target_link_libraries(${LIBRARY_NAME} PUBLIC ${depPkg}::all_libs)
target_link_libraries(${LIBRARY_NAME}
${tribitsAddLibraryIncludeDirsMode} ${depPkg}::all_libs)
endforeach()
endif()
# IMPORTEDLIBS
foreach(importedLib ${PARSE_IMPORTEDLIBS})
target_link_libraries(${LIBRARY_NAME} PUBLIC "${importedLib}")
target_link_libraries(${LIBRARY_NAME}
${tribitsAddLibraryIncludeDirsMode} "${importedLib}")
endforeach()

# ToDo: #63: Above, allow for other link visibilities other than 'PUBLIC'!

if (${PROJECT_NAME}_CXX_STANDARD_FEATURE)
target_compile_features(${LIBRARY_NAME} PUBLIC
"${${PROJECT_NAME}_CXX_STANDARD_FEATURE}")
target_compile_features(${LIBRARY_NAME}
${tribitsAddLibraryIncludeDirsMode} "${${PROJECT_NAME}_CXX_STANDARD_FEATURE}")
endif()

# Add to the install target
Expand Down Expand Up @@ -510,7 +533,8 @@ function(tribits_add_library LIBRARY_NAME_IN)
foreach (includeDir IN LISTS INCLUDE_DIRS_CURRENT)
list(APPEND buildInterfaceIncludeDirs "$<BUILD_INTERFACE:${includeDir}>")
endforeach()
target_include_directories( ${LIBRARY_NAME} PUBLIC ${buildInterfaceIncludeDirs} )
target_include_directories( ${LIBRARY_NAME}
${tribitsAddLibraryIncludeDirsMode} ${buildInterfaceIncludeDirs} )

# Add ALIAS library <PackageName>::<libname>
add_library(${PACKAGE_NAME}::${LIBRARY_NAME} ALIAS ${LIBRARY_NAME})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ endmacro()
# package ``<packageName>`` are set as EXTERNAL as well. (We don't allow a
# subset of subpackages in a parent package to be EXTERNAL and the other
# subpackages to be INTERNAL. That would be way too complicated to implement
# and be way too confusing for implementors and users.)
# and be way too confusing for implementers and users.)
#
macro(tribits_set_package_and_related_upstream_packages_to_external packageName)

Expand Down
8 changes: 4 additions & 4 deletions cmake/tribits/core/package_arch/TribitsPackageMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -669,9 +669,9 @@ macro(tribits_package_postprocess_common)

tribits_package_create_all_libs_interface_library()

if (${PROJECT_NAME}_ENABLE_INSTALL_CMAKE_CONFIG_FILES)
# Create the configure file so external projects can find packages with a
# call to find_package(<package_name>).
if (${PROJECT_NAME}_ENABLE_INSTALL_CMAKE_CONFIG_FILES
AND (NOT ${PROJECT_NAME}_ENABLE_INSTALLATION_TESTING)
)
tribits_write_package_client_export_files(${PACKAGE_NAME})
endif()

Expand All @@ -689,7 +689,7 @@ macro(tribits_package_create_all_libs_interface_library)

# Find all of the non-TESTONLY library targets
tribits_get_all_build_targets_including_in_subdirs("${CMAKE_CURRENT_SOURCE_DIR}"
"STATIC_LIBRARY;SHARED_LIBRARY"
"STATIC_LIBRARY;SHARED_LIBRARY;INTERFACE_LIBRARY"
allPackageBuildableLibTargetsList )
#print_var(allPackageBuildableLibTargetsList)
set(packageLibsInAllLibsList)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ include(Split)
#
# This macro sets up a 2D array of ``NumTPLS`` by ``NumColumns`` listing out
# the `TriBITS TPLs`_ for a `TriBITS Repository`_. Each row (with 3 entries)
# specifies a different TriBITS exernal package/TPL which contains the columns
# specifies a different TriBITS external package/TPL which contains the columns
# (ordered 0-2):
#
# 0. **TPL** (``<tpli_name>``): The name of the TriBITS external package/TPL
Expand Down
Loading

0 comments on commit 613afcf

Please sign in to comment.