Skip to content

Commit

Permalink
Revert "Merge Pull Request trilinos#9894 from bartlettroscoe/Trilinos…
Browse files Browse the repository at this point in the history
…/tribits-299-modern-cmake-targets-1"

This reverts commit db3205b, reversing
changes made to 110b6c4 which reverts the PR
merge trilinos#9894.

This is to allow reproducing and addressing the problems described in the new
issues trilinos#9972 and #trilinos#9973 offline to allow the Albany and Nalu Trilinos
integration process, respectively, to continue working in the meantime.
  • Loading branch information
bartlettroscoe committed Nov 29, 2021
1 parent 37c24f4 commit fd27a20
Show file tree
Hide file tree
Showing 80 changed files with 772 additions and 2,844 deletions.
30 changes: 0 additions & 30 deletions cmake/tribits/ReleaseNotes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,6 @@
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: 1 addition & 38 deletions cmake/tribits/TriBITS.cmake
Original file line number Diff line number Diff line change
@@ -1,42 +1,4 @@
# @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 @@ -45,6 +7,7 @@
# 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,6 +4,7 @@
# 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 @@ -45,7 +46,7 @@
#
##############################################################################

include_guard()
${DEFINE_CMAKE_CURRENT_LIST_DIR_CODE_SNIPPET}

## ---------------------------------------------------------------------------
## Compilers used by ${PROJECT_NAME}/${PACKAGE_NAME} build
Expand Down
110 changes: 110 additions & 0 deletions cmake/tribits/core/installation/TribitsPackageConfigTemplate.export.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
##############################################################################
#
# Make variables for use by ${PROJECT_NAME}/${PACKAGE_NAME} clients.
#
# ${DISCOURAGE_EDITING}
#
##############################################################################


## ---------------------------------------------------------------------------
## Compilers used by ${PROJECT_NAME}/${PACKAGE_NAME} build
## ---------------------------------------------------------------------------

${EXPORT_FILE_VAR_PREFIX}_CXX_COMPILER=${CMAKE_CXX_COMPILER}

${EXPORT_FILE_VAR_PREFIX}_C_COMPILER=${CMAKE_C_COMPILER}

${EXPORT_FILE_VAR_PREFIX}_FORTRAN_COMPILER=${CMAKE_Fortran_COMPILER}
${EXPORT_FILE_VAR_PREFIX}_Fortran_COMPILER=${CMAKE_Fortran_COMPILER}


## ---------------------------------------------------------------------------
## Compiler flags used by ${PROJECT_NAME}/${PACKAGE_NAME} build
## ---------------------------------------------------------------------------

## Set compiler flags, including those determined by build type
${EXPORT_FILE_VAR_PREFIX}_CXX_FLAGS=${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}
${EXPORT_FILE_VAR_PREFIX}_CXX_COMPILER_FLAGS=${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}

${EXPORT_FILE_VAR_PREFIX}_C_FLAGS=${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}
${EXPORT_FILE_VAR_PREFIX}_C_COMPILER_FLAGS=${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}

${EXPORT_FILE_VAR_PREFIX}_FORTRAN_FLAGS=${CMAKE_FORTRAN_FLAGS} ${CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE}}
${EXPORT_FILE_VAR_PREFIX}_Fortran_COMPILER_FLAGS=${CMAKE_FORTRAN_FLAGS} ${CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE}}

## Extra link flags (e.g., specification of fortran libraries)
${EXPORT_FILE_VAR_PREFIX}_EXTRA_LD_FLAGS=${${PROJECT_NAME}_EXTRA_LINK_FLAGS}

## This is the command-line entry used for setting rpaths. In a build
## with static libraries it will be empty.
${EXPORT_FILE_VAR_PREFIX}_SHARED_LIB_RPATH_COMMAND=${SHARED_LIB_RPATH_COMMAND}
${EXPORT_FILE_VAR_PREFIX}_BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}

${EXPORT_FILE_VAR_PREFIX}_LINKER=${CMAKE_LINKER}
${EXPORT_FILE_VAR_PREFIX}_AR=${CMAKE_AR}

## ---------------------------------------------------------------------------
## Set library specifications and paths
## ---------------------------------------------------------------------------

## The project version number
${EXPORT_FILE_VAR_PREFIX}_VERSION=${${PROJECT_NAME}_VERSION}

## List of package include dirs
${EXPORT_FILE_VAR_PREFIX}_INCLUDE_DIRS=${MAKEFILE_INCLUDE_DIRS}

## List of package library paths
${EXPORT_FILE_VAR_PREFIX}_LIBRARY_DIRS=${MAKEFILE_LIBRARY_DIRS}

## List of package libraries
${EXPORT_FILE_VAR_PREFIX}_LIBRARIES=${MAKEFILE_FULL_LIBRARY_SET}

## Specification of directories for TPL headers
${EXPORT_FILE_VAR_PREFIX}_TPL_INCLUDE_DIRS=${MAKEFILE_${PACKAGE_NAME}_TPL_INCLUDE_DIRS}

## Specification of directories for TPL libraries
${EXPORT_FILE_VAR_PREFIX}_TPL_LIBRARY_DIRS=${MAKEFILE_${PACKAGE_NAME}_TPL_LIBRARY_DIRS}

## List of required TPLs
${EXPORT_FILE_VAR_PREFIX}_TPL_LIBRARIES=${MAKEFILE_${PACKAGE_NAME}_TPL_LIBRARIES}

## ---------------------------------------------------------------------------
## MPI specific variables
## These variables are provided to make it easier to get the mpi libraries
## and includes on systems that do not use the mpi wrappers for compiling
## ---------------------------------------------------------------------------

${EXPORT_FILE_VAR_PREFIX}_MPI_LIBRARIES=${MAKEFILE_TPL_MPI_LIBRARIES}
${EXPORT_FILE_VAR_PREFIX}_MPI_LIBRARY_DIRS=${MAKEFILE_TPL_MPI_LIBRARY_DIRS}
${EXPORT_FILE_VAR_PREFIX}_MPI_INCLUDE_DIRS=${MAKEFILE_TPL_MPI_INCLUDE_DIRS}
${EXPORT_FILE_VAR_PREFIX}_MPI_EXEC=${MPI_EXEC}
${EXPORT_FILE_VAR_PREFIX}_MPI_EXEC_MAX_NUMPROCS=${MPI_EXEC_MAX_NUMPROCS}
${EXPORT_FILE_VAR_PREFIX}_MPI_EXEC_NUMPROCS_FLAG=${MPI_EXEC_NUMPROCS_FLAG}

## ---------------------------------------------------------------------------
## Set useful general variables
## ---------------------------------------------------------------------------

## The packages enabled for this project
${EXPORT_FILE_VAR_PREFIX}_PACKAGE_LIST=${MAKEFILE_FULL_PACKAGE_SET}

## The TPLs enabled for this project
${EXPORT_FILE_VAR_PREFIX}_TPL_LIST=${MAKEFILE_ORDERED_FULL_TPL_SET}

## ---------------------------------------------------------------------------
## Deprecated variables
## These variables from the autotools version of Makefile.export.<package>
## have been deprecated. To help avoid confusion with projects that haven't
## migrated to the new version of the variable names when the don't compile.
## This will put an obvious statement in the link line that these Trilinos
## Makefile variables are no longer used. Without this there would be a link
## error with no obvious reason as to why other than the lack of Trilinos libs
## which would be confusing since the link line in the Makefile would have
## stated to put them on the line.
## ---------------------------------------------------------------------------

${EXPORT_FILE_VAR_PREFIX_UPPER}_LIBS="The Trilinos variable ${EXPORT_FILE_VAR_PREFIX_UPPER}_LIBS has been deprecated. Please see the documentation on the Makefile.export capability for instructions on how to transition to the new system."
${EXPORT_FILE_VAR_PREFIX_UPPER}_INCLUDES="The Trilinos variable ${EXPORT_FILE_VAR_PREFIX_UPPER}_INCLUDES has been deprecated. Please see the documentation on the Makefile.export capability for instructions on how to transition to the new system."


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

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

## ---------------------------------------------------------------------------
## Compilers used by ${PROJECT_NAME} build
Expand Down Expand Up @@ -103,8 +106,7 @@ 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)
set(${PROJECT_NAME}_NOT_FOUND_MESSAGE "")
foreach (comp IN ITEMS ${PDOLLAR}{COMPONENTS_LIST})
foreach(comp ${PDOLLAR}{COMPONENTS_LIST})
set(
INCLUDE_FILE
${PDOLLAR}{CMAKE_CURRENT_LIST_DIR}/../${PDOLLAR}{comp}/${PDOLLAR}{comp}Config.cmake
Expand All @@ -122,10 +124,10 @@ foreach (comp IN ITEMS ${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 @@ -196,30 +198,5 @@ 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} )
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
##############################################################################
#
# Make variables for use by ${PROJECT_NAME} clients.
#
# ${DISCOURAGE_EDITING}
#
##############################################################################


## ---------------------------------------------------------------------------
## Compilers used by ${PROJECT_NAME} build
## ---------------------------------------------------------------------------

${PROJECT_NAME}_CXX_COMPILER=${CMAKE_CXX_COMPILER}

${PROJECT_NAME}_C_COMPILER=${CMAKE_C_COMPILER}

${PROJECT_NAME}_Fortran_COMPILER=${CMAKE_Fortran_COMPILER}


## ---------------------------------------------------------------------------
## Compiler flags used by ${PROJECT_NAME} build
## ---------------------------------------------------------------------------

${PROJECT_NAME}_CXX_COMPILER_FLAGS=${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}

${PROJECT_NAME}_C_COMPILER_FLAGS=${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE}}

${PROJECT_NAME}_Fortran_COMPILER_FLAGS=${CMAKE_Fortran_FLAGS} ${CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE}}

## Extra link flags (e.g., specification of fortran libraries)
${PROJECT_NAME}_EXTRA_LD_FLAGS=${${PROJECT_NAME}_EXTRA_LINK_FLAGS}

## This is the command-line entry used for setting rpaths. In a build
## with static libraries it will be empty.
${PROJECT_NAME}_SHARED_LIB_RPATH_COMMAND=${SHARED_LIB_RPATH_COMMAND}
${PROJECT_NAME}_BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}

${PROJECT_NAME}_LINKER=${CMAKE_LINKER}
${PROJECT_NAME}_AR=${CMAKE_AR}


## ---------------------------------------------------------------------------
## Set library specifications and paths
## ---------------------------------------------------------------------------

## The project version number
${PROJECT_NAME}_VERSION=${${PROJECT_NAME}_VERSION}

## The project include file directories.
${PROJECT_NAME}_INCLUDE_DIRS=${MAKEFILE_${PROJECT_NAME}_CONFIG_INCLUDE_DIRS}

## The project library directories.
${PROJECT_NAME}_LIBRARY_DIRS=${MAKEFILE_${PROJECT_NAME}_CONFIG_LIBRARY_DIRS}

## The project libraries.
${PROJECT_NAME}_LIBRARIES=${MAKEFILE_${PROJECT_NAME}_CONFIG_LIBRARIES}

## The project tpl include paths
${PROJECT_NAME}_TPL_INCLUDE_DIRS=${MAKEFILE_${PROJECT_NAME}_CONFIG_TPL_INCLUDE_DIRS}

## The project tpl library paths
${PROJECT_NAME}_TPL_LIBRARY_DIRS=${MAKEFILE_${PROJECT_NAME}_CONFIG_TPL_LIBRARY_DIRS}

## The project tpl libraries
${PROJECT_NAME}_TPL_LIBRARIES=${MAKEFILE_${PROJECT_NAME}_CONFIG_TPL_LIBRARIES}

## ---------------------------------------------------------------------------
## MPI specific variables
## These variables are provided to make it easier to get the mpi libraries
## and includes on systems that do not use the mpi wrappers for compiling
## ---------------------------------------------------------------------------

${PROJECT_NAME}_MPI_LIBRARIES=${MAKEFILE_TPL_MPI_LIBRARIES}
${PROJECT_NAME}_MPI_LIBRARY_DIRS=${MAKEFILE_TPL_MPI_LIBRARY_DIRS}
${PROJECT_NAME}_MPI_INCLUDE_DIRS=${MAKEFILE_TPL_MPI_INCLUDE_DIRS}
${PROJECT_NAME}_MPI_EXEC=${MPI_EXEC}
${PROJECT_NAME}_MPI_EXEC_MAX_NUMPROCS=${MPI_EXEC_MAX_NUMPROCS}
${PROJECT_NAME}_MPI_EXEC_NUMPROCS_FLAG=${MPI_EXEC_NUMPROCS_FLAG}

## ---------------------------------------------------------------------------
## Set useful general variables
## ---------------------------------------------------------------------------

## The packages enabled for this project
${PROJECT_NAME}_PACKAGE_LIST=${MAKEFILE_FULL_PACKAGE_SET}

## The TPLs enabled for this project
${PROJECT_NAME}_TPL_LIST=${MAKEFILE_FULL_TPL_SET}

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

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

include(TribitsWriteClientExportFiles)
Expand Down

0 comments on commit fd27a20

Please sign in to comment.