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

TriBITS: Pull in partial refactoring to modern CMake targets (TriBITSPub/TriBITS#299) #9894

Merged
30 changes: 30 additions & 0 deletions cmake/tribits/ReleaseNotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,36 @@
Release Notes for TriBITS
----------------------------------------

2021/11/18:

(*) MAJOR: The default <Project>_GENERATE_REPO_VERSION_FILE_DEFAULT will be
overridden to OFF if the 'git' executable cannot be found at configure
time. See updated TriBITS Developer's Guilde documenation.

(*) MAJOR: The default value for <Project>_ENABLE_Fortran is set to OFF on
WIN32 systems. (Getting a Fortran compiler for native Windows is not
typically very easy.)

2021/10/11:

(*) MAJOR: The `<Package>Config.cmake` for each enabled package generated in
the build directory tree have been moved from
`<buildDir>/packages/<packageDir>/` to
`<buildDir>/cmake_packages/<PackageName>/`. This makes it easy for
`find_package(<PackageName>)` to find these files by simply adding the
directory ``<buildDir>/cmake_packages` to `CMAKE_PREFIX_PATH` and then
`<Package>Config.cmake` for any enabled package will be found
automatically found by CMake.

2021/09/13:

(*) MAJOR: Support for generation and installation of Makefile.export.* files
has been removed along with the cache variable
<Project>_ENABLE_EXPORT_MAKEFILES. This is to allow the refactoring of
TriBITS to use modern CMake targets that propagate all information and
removing complex dependency tracking information from TriBITS (see
TriBITSPub/TriBITS#63 and TriBITSPub/TriBITS#299).

2021/06/17:

(*) MINOR: Added tool tribits/python_utils/lower_case_cmake.py and driver
Expand Down
39 changes: 38 additions & 1 deletion cmake/tribits/TriBITS.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,42 @@
# @HEADER
# ************************************************************************
#
# TriBITS: Tribal Build, Integrate, and Test System
# Copyright 2013 Sandia Corporation
#
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Government retains certain rights in this software.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the name of the Corporation nor the names of the
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# ************************************************************************
# @HEADER

# Top-level include file that pulls in TriBITS so it can be used by a project.
# A Project's top-level CMakeLists.cmake file just does:
#
Expand All @@ -7,7 +45,6 @@
# and then they can call:
#
# tribits_project()
#

if (${PROJECT_NAME}_TRIBITS_DIR)
set(TRIBITS_BASE_DIR_LOCAL "${${PROJECT_NAME}_TRIBITS_DIR}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# TriBITS: Tribal Build, Integrate, and Test System
# Copyright 2013 Sandia Corporation
#
#
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Government retains certain rights in this software.
#
Expand Down Expand Up @@ -46,7 +45,7 @@
#
##############################################################################

${DEFINE_CMAKE_CURRENT_LIST_DIR_CODE_SNIPPET}
include_guard()

## ---------------------------------------------------------------------------
## Compilers used by ${PROJECT_NAME}/${PACKAGE_NAME} build
Expand Down
110 changes: 0 additions & 110 deletions cmake/tribits/core/installation/TribitsPackageConfigTemplate.export.in

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@
#
##############################################################################

#
# Ensure CMAKE_CURRENT_LIST_DIR is usable.
#
${DEFINE_CMAKE_CURRENT_LIST_DIR_CODE_SNIPPET}
include_guard()

## ---------------------------------------------------------------------------
## Compilers used by ${PROJECT_NAME} build
Expand Down Expand Up @@ -106,7 +103,8 @@ endif()
# Initialize ${PROJECT_NAME}_FOUND with true, and set it to FALSE if any of
# the required components wasn't found.
set(${PROJECT_NAME}_FOUND TRUE)
foreach(comp ${PDOLLAR}{COMPONENTS_LIST})
set(${PROJECT_NAME}_NOT_FOUND_MESSAGE "")
foreach (comp IN ITEMS ${PDOLLAR}{COMPONENTS_LIST})
set(
INCLUDE_FILE
${PDOLLAR}{CMAKE_CURRENT_LIST_DIR}/../${PDOLLAR}{comp}/${PDOLLAR}{comp}Config.cmake
Expand All @@ -124,10 +122,10 @@ foreach(comp ${PDOLLAR}{COMPONENTS_LIST})
list(APPEND ${PROJECT_NAME}_TPL_LIBRARY_DIRS ${PDOLLAR}{${PDOLLAR}{comp}_TPL_LIBRARY_DIRS})
list(APPEND ${PROJECT_NAME}_TPL_LIBRARIES ${PDOLLAR}{${PDOLLAR}{comp}_TPL_LIBRARIES})
else()
# Set ${PROJECT_NAME}_<component>_FOUND to FALSE.
set(${PROJECT_NAME}_${PDOLLAR}{comp}_FOUND FALSE)
# Set ${PROJECT_NAME}_FOUND to FALSE if component is not optional.
if(${PROJECT_NAME}_FIND_REQUIRED_${PDOLLAR}{comp})
string(APPEND ${PROJECT_NAME}_NOT_FOUND_MESSAGE
"ERROR: Could not find component '${PDOLLAR}{comp}'!\n")
set(${PROJECT_NAME}_FOUND FALSE)
endif()
endif()
Expand Down Expand Up @@ -198,5 +196,30 @@ set(${PROJECT_NAME}_Fortran_IMPLICIT_LINK_LIBRARIES "${CMAKE_Fortran_IMPLICIT_LI
## The packages enabled for this project
set(${PROJECT_NAME}_PACKAGE_LIST "${FULL_PACKAGE_SET}")

## The selected packages for this project
set(${PROJECT_NAME}_SELECTED_PACKAGE_LIST "${PDOLLAR}{COMPONENTS_LIST}")

## The TPLs enabled for this project
set(${PROJECT_NAME}_TPL_LIST "${FULL_TPL_SET}")

## ---------------------------------------------------------------------------
## Modern CMake (IMPORTED) targets
## ---------------------------------------------------------------------------

# ${PROJECT_NAME}::all_libs (Does *not* depend on COMPONENTS)
set(${PROJECT_NAME}_ALL_PACKAGES_TARGETS)
foreach (pkg IN ITEMS ${FULL_PACKAGE_SET})
list(APPEND ${PROJECT_NAME}_ALL_PACKAGES_TARGETS ${PDOLLAR}{pkg}::all_libs)
endforeach()
add_library(${PROJECT_NAME}::all_libs IMPORTED INTERFACE GLOBAL)
target_link_libraries(${PROJECT_NAME}::all_libs
INTERFACE ${PDOLLAR}{${PROJECT_NAME}_ALL_PACKAGES_TARGETS} )

# ${PROJECT_NAME}::all_selected_libs (Depend on COMPONENTS)
set(${PROJECT_NAME}_ALL_SELECTED_PACKAGES_TARGETS)
foreach (pkg IN ITEMS ${PDOLLAR}{COMPONENTS_LIST})
list(APPEND ${PROJECT_NAME}_ALL_SELECTED_PACKAGES_TARGETS ${PDOLLAR}{pkg}::all_libs)
endforeach()
add_library(${PROJECT_NAME}::all_selected_libs IMPORTED INTERFACE GLOBAL)
target_link_libraries(${PROJECT_NAME}::all_selected_libs
INTERFACE ${PDOLLAR}{${PROJECT_NAME}_ALL_SELECTED_PACKAGES_TARGETS} )

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
set(tribits_install_src
"${${PROJECT_NAME}_TRIBITS_DIR}/${TRIBITS_CMAKE_INSTALLATION_FILES_DIR}")

if((${PROJECT_NAME}_ENABLE_INSTALL_CMAKE_CONFIG_FILES
OR ${PROJECT_NAME}_ENABLE_EXPORT_MAKEFILES)
AND NOT ${PROJECT_NAME}_ENABLE_INSTALLATION_TESTING
if ( ${PROJECT_NAME}_ENABLE_INSTALL_CMAKE_CONFIG_FILES
AND NOT ${PROJECT_NAME}_ENABLE_INSTALLATION_TESTING
)

include(TribitsWriteClientExportFiles)
Expand Down
Loading