diff --git a/CMakeLists.txt b/CMakeLists.txt index f6aef3721c6a..01f7a476c14a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,6 +69,7 @@ INCLUDE(${CMAKE_CURRENT_LIST_DIR}/ProjectName.cmake) # not in an include file :-( PROJECT(${PROJECT_NAME} NONE) +# Set up to use ccache if($ENV{CCACHE_NODISABLE}) # ccache must be requested explicitly by setting env-var CCACHE_NODISABLE find_program(CCACHE_PROGRAM ccache) @@ -100,9 +101,12 @@ else() endif() endif() -## set an env so we know we are in configure +# Set an env so we know we are in configure set(ENV{CMAKE_IS_IN_CONFIGURE_MODE} 1) +# Don't define TriBITS override of include_directories() +set(TRIBITS_HIDE_DEPRECATED_INCLUDE_DIRECTORIES_OVERRIDE TRUE) + # # B) Pull in the TriBITS system and execute # diff --git a/cmake/tribits/CHANGELOG.md b/cmake/tribits/CHANGELOG.md index 144bb070dce2..c0ad93274308 100644 --- a/cmake/tribits/CHANGELOG.md +++ b/cmake/tribits/CHANGELOG.md @@ -2,6 +2,82 @@ ChangeLog for TriBITS ---------------------------------------- +## 2022-12-20: + +* **Deprecated:** The macro `set_and_inc_dirs()` is deprecated and replaced by + `tribits_set_and_inc_dirs()`. Use the script + `TriBITS/refactoring/replace_set_and_inc_dirs_r.sh` to update + `CMakeLists.txt` files. + +## 2022-11-03: + +* **Deprecated:** The long-deprecated TriBITS function override + `include_directories()` now emits a deprecated warning. To replace all + usages of `include_directories()` that should be + `tribits_include_directories()`, use the script + `TriBITS/refactoring/replace_include_directories_r.sh` (see documentation in + that script). + +* **Deprecated:** Many previously deprecated TriBITS features now will trigger + a CMake DEPRECATION warning message by default (by calling + `message(DEPRECATION ...)`). The message printed to the CMake output will + typically describe how to remove the usage of the deprecated feature. To + remove deprecation warnings, change to use the non-deprecated features + mentioned in the deprecation warning message. To temporarily disable + deprecation warnings, configure with `-D + TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE=IGNORE` (see build reference entry + for `TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE` for more details). + +## 2022-10-20: + +* **Changed:** Disabling an external package/TPL will now disable any + downstream external packages/TPLs that list a dependency on that external + package/TPL through its + [`FindTPLDependencies.cmake`](https://tribitspub.github.io/TriBITS/users_guide/index.html#findtpl-tplname-dependencies-cmake) + file. Prior to this, disabling an external package/TPL would not disable + dependent downstream external packages/TPLs (it would only disable + downstream dependent required internal packages). To avoid this, simply + leave the enable status of the upstream external package/TPL empty "" and no + downstream propagation of disables will take place. + +## 2022-10-16: + +* **Removed:** Removed the variables `_LIBRARY_DIRS`, + `_TPL_LIST` and `_TPL_LIBRARIES` from the installed + `Config.cmake` file. These are not needed after the change to + modern CMake targets `::all_libs` (see `::all_libs` + below). To determine if a TPL is enabled, check `if (TARGET + ::all_libs)`. To get the libraries and include dirs for a TPL, + link against the IMPORTED target `::all_libs` (see the updated + TriBITS example APP projects for details). + +* **Removed:** Removed the variables `_PACKAGE_LIST`, + `_TPL_LIST`, `_INCLUDE_DIR`, `_LIBRARY_DIRS`, + `_TPL_INCLUDE_DIRS`, `_TPL_LIBRARIES` and + `_TPL_LIBRARY_DIRS` from the generated `Config.cmake` + files. These are not needed with the move to modern CMake targets (see + `::all_libs` below). + +* **Changed:** Changed `_LIBRARIES` in generated + `Config.cmake` files from the full list of the package's library + targets to just `::all_libs`. (There is no need to list the + individual libraries after the move to modern CMake targets.) + +## 2022-10-11: + +* **Changed:** Added option `_ASSERT_DEFINED_DEPENDENCIES` to + determine if listed external package/TPL and internal package dependencies + are defined within the project or not. The initial default is `FATAL_ERROR` + for development mode and `IGNORE` for release mode. (Previously, undefined + external package/TPL dependencies where ignore.) To set a different + default, set `_ASSERT_DEFINED_DEPENDENCIES_DEFAULT` to `WARNING`, + for example, in the project's `ProjectName.cmake` file. + +* **Removed:** `_ASSERT_MISSING_PACKAGES` has been removed and setting + it will result in a `FATAL_ERROR`. Instead, use + `_ASSERT_DEFINED_DEPENDENCIES` (and make sure all of your project's + listed TPL dependencies are all defined within the project). + ## 2022-10-02: * **Changed:** The TriBITS FindTPLCUDA.cmake module changed @@ -11,7 +87,6 @@ ChangeLog for TriBITS `find_package(CUDAToolkit)` (see [Trilinos #10954](https://github.com/trilinos/Trilinos/issues/10954)). - ## 2022-09-16: * **Changed:** Changed nomenclature for packages and TPLs (see updated diff --git a/cmake/tribits/ci_support/TribitsDumpDepsXmlScript.cmake b/cmake/tribits/ci_support/TribitsDumpDepsXmlScript.cmake index 771c2e6dcd31..5c926e9023f6 100644 --- a/cmake/tribits/ci_support/TribitsDumpDepsXmlScript.cmake +++ b/cmake/tribits/ci_support/TribitsDumpDepsXmlScript.cmake @@ -116,8 +116,8 @@ include(TribitsWriteXmlDependenciesFiles) # Generate the dependencies file -set(${PROJECT_NAME}_ASSERT_MISSING_PACKAGES FALSE) -set(${PROJECT_NAME}_OUTPUT_DEPENDENCY_FILES FALSE) +set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES OFF) +set(${PROJECT_NAME}_OUTPUT_DEPENDENCY_FILES FALSE) if (NOT ${PROJECT_NAME}_PRE_REPOSITORIES) # Make sure is defined! set(${PROJECT_NAME}_PRE_REPOSITORIES "") endif() diff --git a/cmake/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake b/cmake/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake index 4050ba3e5060..1091008e3c01 100644 --- a/cmake/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake +++ b/cmake/tribits/ci_support/TribitsWriteXmlDependenciesFiles.cmake @@ -38,172 +38,215 @@ # @HEADER -# -# This file gets included in the main TriBITS framework. It is put here to -# reduce the size of the tribits/core/ directory. -# - - -function(tribits_write_deps_to_xml_string PACKAGE_NAME LIST_TYPE - XML_VAR - ) - - set(LOC_XML "${${XML_VAR}}") - - set(DEPS_VAR ${PACKAGE_NAME}_${LIST_TYPE}) - assert_defined(DEPS_VAR) - set(DEPS ${${DEPS_VAR}}) - - #print_var(PACKAGE_NAME) - #print_var(DEPS) +################################################################################ +# NOTE: This file gets included in the main TriBITS core framework. It is put +# here to reduce the size of the tribits/core/ directory as this is optional +# behavior. +################################################################################ - if (NOT DEPS) - list(APPEND LOC_XML - " <${LIST_TYPE}/>\n" ) - - else() - - set(VALUE_STR "") - - foreach(DEP ${DEPS}) - - if(VALUE_STR) - set(VALUE_STR "${VALUE_STR},") - endif() +# @MACRO: tribits_write_xml_dependency_files() +# +# Usage:: +# +# tribits_write_xml_dependency_files() +# +# Macro that outputs XML dependency files if asked based in the global project +# package dependency graph previously constructed. +# +macro(tribits_write_xml_dependency_files) - set(VALUE_STR "${VALUE_STR}${DEP}") + tribits_config_code_start_timer(WRITE_DEPENDENCY_FILES_TIME_START_SECONDS) - endforeach() + if (${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE) + if (NOT IS_ABSOLUTE ${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE}) + set(${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE + ${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE}) + endif() + message("" ) + message("Dumping the XML dependencies file" + " ${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE} ..." ) + tribits_dump_deps_xml_file() + endif() - list(APPEND LOC_XML - " <${LIST_TYPE} value=\"${VALUE_STR}\"/>\n" ) + if (${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE AND ${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE) + if (NOT IS_ABSOLUTE ${${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE}) + set(${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE + ${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE}) + endif() + message("" ) + message("Dumping the HTML dependencies webpage file" + " ${${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE} ..." ) + set(tribitsCiSupportDir "${${PROJECT_NAME}_TRIBITS_DIR}/${TRIBITS_CI_SUPPORT_DIR}") + execute_process( + COMMAND ${PYTHON_EXECUTABLE} + ${tribitsCiSupportDir}/dump-package-dep-table.py + --input-xml-deps-file=${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE} + --output-html-deps-file=${${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE} ) + endif() + if (${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE AND ${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE) + if (NOT IS_ABSOLUTE ${${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE}) + set(${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE + ${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE}) + endif() + message("" ) + message("Dumping the CDash XML dependencies file" + " ${${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE} ..." ) + set(tribitsCtestDriverDir + "${${PROJECT_NAME}_TRIBITS_DIR}/${TRIBITS_CTEST_DRIVER_DIR}") + if (EXISTS "${tribitsCtestDriverDir}") + execute_process( + COMMAND ${PYTHON_EXECUTABLE} + ${tribitsCtestDriverDir}/dump-cdash-deps-xml-file.py + --input-xml-deps-file=${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE} + --output-cdash-deps-xml-file=${${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE}) + else() + message(FATAL_ERROR "\nERROR: Can't write" + " ${${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE}" + " because '${tribitsCtestDriverDir}' does not exist!") + endif() endif() - if (LOC_XML) - set(${XML_VAR} "${LOC_XML}" PARENT_SCOPE) + if (${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE + OR ${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE + OR ${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE + ) + tribits_config_code_stop_timer(WRITE_DEPENDENCY_FILES_TIME_START_SECONDS + "\nTotal time to write dependency files") endif() -endfunction() +endmacro() +# Function that writes the dependency information for the TriBITS project +# ${PROJECT_NAME} into an XML file for other tools to use. # -# Function that writes the dependency information for ${PROJECT_NAME} into -# an XML file for other tools to use. -# - function(tribits_dump_deps_xml_file) - set(DEPS_XM) + set(depsXml "") get_filename_component(PROJECT_BASE_DIR_NAME "${${PROJECT_NAME}_SOURCE_DIR}" NAME) - list(APPEND DEPS_XML + list(APPEND depsXml "\n" ) - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) + foreach(tribitsPackage ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) - #message("") - #print_var(TRIBITS_PACKAGE) + list(APPEND depsXml + " \n") - list(APPEND DEPS_XML - " \n") + tribits_write_deps_to_xml_string(${tribitsPackage} LIB REQUIRED PACKAGES depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} LIB OPTIONAL PACKAGES depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} TEST REQUIRED PACKAGES depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} TEST OPTIONAL PACKAGES depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} LIB REQUIRED TPLS depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} LIB OPTIONAL TPLS depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} TEST REQUIRED TPLS depsXml) + tribits_write_deps_to_xml_string(${tribitsPackage} TEST OPTIONAL TPLS depsXml) - tribits_write_deps_to_xml_string(${TRIBITS_PACKAGE} LIB_REQUIRED_DEP_PACKAGES DEPS_XML) - tribits_write_deps_to_xml_string(${TRIBITS_PACKAGE} LIB_OPTIONAL_DEP_PACKAGES DEPS_XML) - tribits_write_deps_to_xml_string(${TRIBITS_PACKAGE} TEST_REQUIRED_DEP_PACKAGES DEPS_XML) - tribits_write_deps_to_xml_string(${TRIBITS_PACKAGE} TEST_OPTIONAL_DEP_PACKAGES DEPS_XML) - tribits_write_deps_to_xml_string(${TRIBITS_PACKAGE} LIB_REQUIRED_DEP_TPLS DEPS_XML) - tribits_write_deps_to_xml_string(${TRIBITS_PACKAGE} LIB_OPTIONAL_DEP_TPLS DEPS_XML) - tribits_write_deps_to_xml_string(${TRIBITS_PACKAGE} TEST_REQUIRED_DEP_TPLS DEPS_XML) - tribits_write_deps_to_xml_string(${TRIBITS_PACKAGE} TEST_OPTIONAL_DEP_TPLS DEPS_XML) - - list(APPEND DEPS_XML + list(APPEND depsXml " \n" - " \n" + " \n" " \n" ) - list(APPEND DEPS_XML - " \n" + list(APPEND depsXml + " \n" ) - list(APPEND DEPS_XML + list(APPEND depsXml " \n" ) endforeach() - list(APPEND DEPS_XML + list(APPEND depsXml "\n" ) - #print_var(DEPS_XML) - string(REPLACE "\n;" "\n" DEPS_XML "${DEPS_XML}") - file(WRITE ${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE} "${DEPS_XML}" ) + string(REPLACE "\n;" "\n" depsXml "${depsXml}") + file(WRITE ${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE} "${depsXml}" ) endfunction() -# @MACRO: tribits_write_xml_dependency_files() -# -# Usage:: -# -# tribits_write_xml_dependency_files() -# -# Macro that output XML dependency files if asked based in the global project -# package dependency graph previously constructed.. -# -macro(tribits_write_xml_dependency_files) +function(tribits_write_deps_to_xml_string packageName libOrTest requiredOrOptional + packagesOrTpls xmlVarInOut + ) - tribits_config_code_start_timer(WRITE_DEPENDENCY_FILES_TIME_START_SECONDS) + set(localXml "${${xmlVarInOut}}") - #print_var(${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE) - if (${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE) - if (NOT IS_ABSOLUTE ${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE}) - set(${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE - ${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE}) - endif() - message("" ) - message("Dumping the XML dependencies file ${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE} ..." ) - tribits_dump_deps_xml_file() + set(listType ${libOrTest}_${requiredOrOptional}_DEP_${packagesOrTpls}) + message("") + print_var(listType) + + tribits_get_legacy_package_deps_sublist(${packageName} ${libOrTest} + ${requiredOrOptional} ${packagesOrTpls} legacyPackageDepsList) + + if (NOT legacyPackageDepsList) + list(APPEND localXml + " <${listType}/>\n" ) + else() + set(depsListStr "") + foreach(depPkg IN LISTS legacyPackageDepsList) + tribits_append_dep_to_xml_string(${depPkg} depsListStr) + endforeach() + list(APPEND localXml + " <${listType} value=\"${depsListStr}\"/>\n" ) endif() - #print_var(${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE) - if (${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE AND ${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE) - if (NOT IS_ABSOLUTE ${${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE}) - set(${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE - ${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE}) - endif() - message("" ) - message("Dumping the HTML dependencies webpage file ${${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE} ..." ) - execute_process( - COMMAND ${PYTHON_EXECUTABLE} - ${${PROJECT_NAME}_TRIBITS_DIR}/${TRIBITS_CI_SUPPORT_DIR}/dump-package-dep-table.py - --input-xml-deps-file=${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE} - --output-html-deps-file=${${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE} ) + if (localXml) + set(${xmlVarInOut} "${localXml}" PARENT_SCOPE) endif() - #print_var(${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE) - if (${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE AND ${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE) - if (NOT IS_ABSOLUTE ${${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE}) - set(${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE}) +endfunction() + + +function(tribits_get_legacy_package_deps_sublist packageName libOrTest + requiredOrOptional packagesOrTpls legacyPackageDepsListOut + ) + + set(legacyPackageDepsList "") + + foreach(depPkg IN LISTS ${packageName}_${libOrTest}_DEFINED_DEPENDENCIES) + + set(matchesRequriedOrOptional FALSE) + if (((requiredOrOptional STREQUAL "REQUIRED") + AND ${packageName}_${libOrTest}_DEP_REQUIRED_${depPkg}) + OR + ((requiredOrOptional STREQUAL "OPTIONAL") + AND (NOT ${packageName}_${libOrTest}_DEP_REQUIRED_${depPkg})) + ) + set(matchesRequriedOrOptional TRUE) endif() - message("" ) - message("Dumping the CDash XML dependencies file ${${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE} ..." ) - execute_process( - COMMAND ${PYTHON_EXECUTABLE} - ${${PROJECT_NAME}_TRIBITS_DIR}/${TRIBITS_CTEST_DRIVER_DIR}/dump-cdash-deps-xml-file.py - --input-xml-deps-file=${${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE} - --output-cdash-deps-xml-file=${${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE} ) - endif() - if (${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE - OR ${PROJECT_NAME}_DEPS_HTML_OUTPUT_FILE - OR ${PROJECT_NAME}_CDASH_DEPS_XML_OUTPUT_FILE - ) - tribits_config_code_stop_timer(WRITE_DEPENDENCY_FILES_TIME_START_SECONDS - "\nTotal time to write dependency files") - endif() + set(matchesPackagesOrTpls FALSE) + if (((packagesOrTpls STREQUAL "PACKAGES") + AND (${depPkg}_PACKAGE_BUILD_STATUS STREQUAL "INTERNAL")) + OR + ((packagesOrTpls STREQUAL "TPLS") + AND (${depPkg}_PACKAGE_BUILD_STATUS STREQUAL "EXTERNAL")) + ) + set(matchesPackagesOrTpls TRUE) + endif() -endmacro() + if (matchesRequriedOrOptional AND matchesPackagesOrTpls) + list(APPEND legacyPackageDepsList ${depPkg}) + endif() + + endforeach() + + set(${legacyPackageDepsListOut} "${legacyPackageDepsList}" PARENT_SCOPE) + +endfunction() + + + +function(tribits_append_dep_to_xml_string depPkg depsListStrInOut) + set(depsListStr "${${depsListStrInOut}}") + if (depsListStr) + string(APPEND depsListStr ",") + endif() + string(APPEND depsListStr "${depPkg}") + set(${depsListStrInOut} "${depsListStr}" PARENT_SCOPE) +endfunction() diff --git a/cmake/tribits/common_tpls/FindTPLHDF5.cmake b/cmake/tribits/common_tpls/FindTPLHDF5.cmake index 57bb3c3eff01..d89e4cd98415 100644 --- a/cmake/tribits/common_tpls/FindTPLHDF5.cmake +++ b/cmake/tribits/common_tpls/FindTPLHDF5.cmake @@ -6,7 +6,7 @@ set(HDF5_INTERNAL_IS_MODERN FALSE) if (Netcdf_ALLOW_MODERN) - set(minimum_modern_HDF5_version 1.13.2) + set(minimum_modern_HDF5_version 1.10.9) print_var(Netcdf_ALLOW_MODERN) message("-- Using find_package(HDF5 ${minimum_modern_HDF5_version} CONFIG) ...") find_package(HDF5 ${minimum_modern_HDF5_version} CONFIG) diff --git a/cmake/tribits/common_tpls/FindTPLLAPACKDependencies.cmake b/cmake/tribits/common_tpls/FindTPLLAPACKDependencies.cmake new file mode 100644 index 000000000000..0256dbbfd4dd --- /dev/null +++ b/cmake/tribits/common_tpls/FindTPLLAPACKDependencies.cmake @@ -0,0 +1,2 @@ +tribits_extpkg_define_dependencies( LAPACK + DEPENDENCIES BLAS) diff --git a/cmake/tribits/common_tpls/FindTPLNetcdf.cmake b/cmake/tribits/common_tpls/FindTPLNetcdf.cmake index f81e3b9259d5..d025130f7d82 100644 --- a/cmake/tribits/common_tpls/FindTPLNetcdf.cmake +++ b/cmake/tribits/common_tpls/FindTPLNetcdf.cmake @@ -37,9 +37,7 @@ # ************************************************************************ # @HEADER -if (${CMAKE_VERSION} GREATER "3.13") - cmake_policy(SET CMP0074 NEW) -endif() +cmake_policy(SET CMP0074 NEW) set(Netcdf_ALLOW_MODERN FALSE CACHE BOOL "Allow finding Netcdf as a modern CMake config file with exported targets (and only this way)") diff --git a/cmake/tribits/core/installation/TribitsPackageConfigTemplate.cmake.in b/cmake/tribits/core/installation/TribitsPackageConfigTemplate.cmake.in index 465648d63ac3..499d5352e45f 100644 --- a/cmake/tribits/core/installation/TribitsPackageConfigTemplate.cmake.in +++ b/cmake/tribits/core/installation/TribitsPackageConfigTemplate.cmake.in @@ -101,23 +101,8 @@ set(${EXPORT_FILE_VAR_PREFIX}_AR ${CMAKE_AR}) ## Base install location (if not in the build tree) set(${EXPORT_FILE_VAR_PREFIX}_INSTALL_DIR "@CMAKE_INSTALL_PREFIX@") -## List of package include dirs -set(${EXPORT_FILE_VAR_PREFIX}_INCLUDE_DIRS "") - -## List of package library paths -set(${EXPORT_FILE_VAR_PREFIX}_LIBRARY_DIRS "") - ## List of package libraries -set(${EXPORT_FILE_VAR_PREFIX}_LIBRARIES "${FULL_LIBRARY_SET}") - -## Specification of directories for TPL headers -set(${EXPORT_FILE_VAR_PREFIX}_TPL_INCLUDE_DIRS "") - -## Specification of directories for TPL libraries -set(${EXPORT_FILE_VAR_PREFIX}_TPL_LIBRARY_DIRS "") - -## List of required TPLs -set(${EXPORT_FILE_VAR_PREFIX}_TPL_LIBRARIES "${${PACKAGE_NAME}_TPL_LIBRARIES}") +set(${EXPORT_FILE_VAR_PREFIX}_LIBRARIES ${PACKAGE_NAME}::all_libs) ## --------------------------------------------------------------------------- ## MPI specific variables @@ -136,12 +121,6 @@ set(${EXPORT_FILE_VAR_PREFIX}_MPI_EXEC_NUMPROCS_FLAG "${MPI_EXEC_NUMPROCS_FLAG}" ## Set useful general variables ## --------------------------------------------------------------------------- -## The packages enabled for this project -set(${EXPORT_FILE_VAR_PREFIX}_PACKAGE_LIST "${FULL_PACKAGE_SET}") - -## The TPLs enabled for this project -set(${EXPORT_FILE_VAR_PREFIX}_TPL_LIST "${ORDERED_FULL_TPL_SET}") - ${PACKAGE_CONFIG_CODE} ## ---------------------------------------------------------------------------- diff --git a/cmake/tribits/core/installation/TribitsProjectConfigTemplate.cmake.in b/cmake/tribits/core/installation/TribitsProjectConfigTemplate.cmake.in index 67eb685ed483..09c413821945 100644 --- a/cmake/tribits/core/installation/TribitsProjectConfigTemplate.cmake.in +++ b/cmake/tribits/core/installation/TribitsProjectConfigTemplate.cmake.in @@ -123,7 +123,6 @@ foreach (comp IN ITEMS ${PDOLLAR}{COMPONENTS_LIST}) include(${PDOLLAR}{compPkgConfigFile}) # Add variables to lists. list(APPEND ${PROJECT_NAME}_LIBRARIES ${PDOLLAR}{${PDOLLAR}{comp}_LIBRARIES}) - list(APPEND ${PROJECT_NAME}_TPL_LIBRARIES ${PDOLLAR}{${PDOLLAR}{comp}_TPL_LIBRARIES}) list(APPEND selectedComponentsFound ${PDOLLAR}{comp}) else() set(${PROJECT_NAME}_${PDOLLAR}{comp}_FOUND FALSE) @@ -138,18 +137,8 @@ endforeach() # Deprecated (see #299)! set(${PROJECT_NAME}_INCLUDE_DIRS "${TRIBITS_PROJECT_INSTALL_INCLUDE_DIR}") -# Deprecated (see #299)! -set(${PROJECT_NAME}_LIBRARY_DIRS "") - # Remove duplicates in ${PROJECT_NAME}_LIBRARIES -list(REVERSE ${PROJECT_NAME}_LIBRARIES) list(REMOVE_DUPLICATES ${PROJECT_NAME}_LIBRARIES) -list(REVERSE ${PROJECT_NAME}_LIBRARIES) - -# Remove duplicates in ${PROJECT_NAME}_TPL_LIBRARIES -list(REVERSE ${PROJECT_NAME}_TPL_LIBRARIES) -list(REMOVE_DUPLICATES ${PROJECT_NAME}_TPL_LIBRARIES) -list(REVERSE ${PROJECT_NAME}_TPL_LIBRARIES) ## --------------------------------------------------------------------------- ## MPI specific variables @@ -186,9 +175,6 @@ set(${PROJECT_NAME}_PACKAGE_LIST "${FULL_PACKAGE_SET}") ## The selected packages for this project set(${PROJECT_NAME}_SELECTED_PACKAGE_LIST "${PDOLLAR}{selectedComponentsFound}") -## The TPLs enabled for this project -set(${PROJECT_NAME}_TPL_LIST "${FULL_TPL_SET}") - ## --------------------------------------------------------------------------- ## Modern CMake (IMPORTED) targets ## --------------------------------------------------------------------------- diff --git a/cmake/tribits/core/package_arch/TribitsAddAdvancedTest.cmake b/cmake/tribits/core/package_arch/TribitsAddAdvancedTest.cmake index b7627d603882..0faae73d3a13 100644 --- a/cmake/tribits/core/package_arch/TribitsAddAdvancedTest.cmake +++ b/cmake/tribits/core/package_arch/TribitsAddAdvancedTest.cmake @@ -157,13 +157,10 @@ include(PrintVar) # for the overall test to pass. # # Finally, the test is only added if tests are enabled for the package -# (i.e. `${PACKAGE_NAME}_ENABLE_TESTS`_ ``= ON``) or the parent package (if -# this is a subpackage) (i.e. ``${PARENT_PACKAGE_NAME}_ENABLE_TESTS=ON``) or -# if other criteria are met (see some of the arguments in `Overall Arguments -# (tribits_add_advanced_test())`_ that can trigger a test to not be added). -# (NOTE: A more efficient way to optionally enable tests is to put them in a -# ``test/`` subdir and then include that subdir with -# `tribits_add_test_directories()`_.) +# (i.e. `${PACKAGE_NAME}_ENABLE_TESTS`_ ``= ON``) and if other criteria are +# met (see `Overall Arguments (tribits_add_advanced_test())`_). (NOTE: A more +# efficient way to optionally enable tests is to put them in a ``test/`` +# subdir and then include that subdir with `tribits_add_test_directories()`_.) # # *Sections:* # diff --git a/cmake/tribits/core/package_arch/TribitsAddExecutable.cmake b/cmake/tribits/core/package_arch/TribitsAddExecutable.cmake index f08e7b78bca0..ec989628f82f 100644 --- a/cmake/tribits/core/package_arch/TribitsAddExecutable.cmake +++ b/cmake/tribits/core/package_arch/TribitsAddExecutable.cmake @@ -44,6 +44,7 @@ include(TribitsAddTestHelpers) include(TribitsGeneralMacros) include(TribitsLibIsTestOnly) include(TribitsReportInvalidTribitsUsage) +include(TribitsDeprecatedHelpers) include(PrintVar) include(AppendSet) @@ -374,7 +375,7 @@ function(tribits_add_executable EXE_NAME) endif() if (PARSE_DEFINES) - message(WARNING "WARNING: Passing extra defines through 'DEFINES' ${PARSE_DEFINES}" + tribits_deprecated("Passing extra defines through 'DEFINES' ${PARSE_DEFINES}" " is deprecated. Instead, pass them through 'TARGET_DEFINES'. The 'DEFINES'" " argument was incorrectly implemented by calling add_definitions() which has" " directory scope and not function scope as was documented. This resulted in" @@ -657,12 +658,12 @@ macro(tribits_add_executable_convert_from_deplibs) set(prefixedDepLib "${${PROJECT_NAME}_LIBRARY_NAME_PREFIX}${depLib}") tribits_lib_is_testonly(${prefixedDepLib} depLibIsTestOnlyLib) if (depLibIsTestOnlyLib) - message(WARNING "WARNING: Passing TESTONLY lib '${depLib}' through DEPLIBS" + tribits_deprecated("Passing TESTONLY lib '${depLib}' through DEPLIBS" " is deprecated! Instead, please pass through TESTONLYLIBS instead!" " DEPLIBS is deprecated!") list(APPEND PARSE_TESTONLYLIBS ${depLib}) elseif (TARGET ${prefixedDepLib}) - message(WARNING "WARNING: Passing non-TESTONLY lib '${depLib}' through DEPLIBS" + tribits_deprecated("Passing non-TESTONLY lib '${depLib}' through DEPLIBS" " is deprecated! The library '${depLib}' appears to be a" " library defined in this CMake project." " TriBITS takes care of linking against libraries in dependent upstream" diff --git a/cmake/tribits/core/package_arch/TribitsAddExecutableAndTest.cmake b/cmake/tribits/core/package_arch/TribitsAddExecutableAndTest.cmake index 298f64ac75c7..73148b8a8a76 100644 --- a/cmake/tribits/core/package_arch/TribitsAddExecutableAndTest.cmake +++ b/cmake/tribits/core/package_arch/TribitsAddExecutableAndTest.cmake @@ -40,6 +40,7 @@ include(TribitsAddExecutable) include(TribitsAddTest) +include(TribitsDeprecatedHelpers) # @@ -105,6 +106,7 @@ endmacro() # [COMM [serial] [mpi]] # [ARGS " ..." " ..." ...] # [NUM_MPI_PROCS ] +# [RUN_SERIAL] # [LINKER_LANGUAGE (C|CXX|Fortran)] # [STANDARD_PASS_OUTPUT # | PASS_REGULAR_EXPRESSION ";;..."] @@ -146,6 +148,16 @@ endmacro() # through ``ARGS``. For more flexibility, just use # ``tribits_add_executable()`` followed by ``tribits_add_test()``. # +# Finally, the tests are only added if tests are enabled for the package +# (i.e. `${PACKAGE_NAME}_ENABLE_TESTS`_ ``= ON``) and other criteria are met. +# But the test executable will always be added if this function is called, +# regardless of the value of ``${PACKAGE_NAME}_ENABLE_TESTS``. To avoid +# adding the test (or example) executable when +# ``${PACKAGE_NAME}_ENABLE_TESTS=OFF``, put this command in a subdir under +# ``test/`` or ``example/`` and that subdir with +# `tribits_add_test_directories()`_ or `tribits_add_example_directories()`_, +# respectively. +# function(tribits_add_executable_and_test EXE_NAME) # @@ -156,7 +168,7 @@ function(tribits_add_executable_and_test EXE_NAME) #prefix PARSE #options - "STANDARD_PASS_OUTPUT;WILL_FAIL;ADD_DIR_TO_NAME;INSTALLABLE;NOEXEPREFIX;NOEXESUFFIX" + "RUN_SERIAL;STANDARD_PASS_OUTPUT;WILL_FAIL;ADD_DIR_TO_NAME;INSTALLABLE;NOEXEPREFIX;NOEXESUFFIX" #one_value_keywords "DISABLED" #mulit_value_keywords @@ -197,6 +209,10 @@ function(tribits_add_executable_and_test EXE_NAME) # C) tribits_add_executable(...) # + if (PARSE_DEPLIBS) + tribits_deprecated("DEPLIBS argument of tribits_add_executable_and_test() is deprecated.") + endif() + set(CALL_ARGS "") tribits_fwd_parse_arg(CALL_ARGS SOURCES) tribits_fwd_parse_arg(CALL_ARGS DEPLIBS) # Deprecated @@ -234,6 +250,7 @@ function(tribits_add_executable_and_test EXE_NAME) tribits_fwd_parse_arg(CALL_ARGS FAIL_REGULAR_EXPRESSION) tribits_fwd_parse_arg(CALL_ARGS ENVIRONMENT) tribits_fwd_parse_arg(CALL_ARGS DISABLED) + tribits_fwd_parse_opt(CALL_ARGS RUN_SERIAL) tribits_fwd_parse_opt(CALL_ARGS STANDARD_PASS_OUTPUT) tribits_fwd_parse_opt(CALL_ARGS WILL_FAIL) tribits_fwd_parse_arg(CALL_ARGS TIMEOUT) @@ -257,3 +274,5 @@ function(tribits_add_executable_and_test EXE_NAME) endif() endfunction() + +# LocalWords: executables diff --git a/cmake/tribits/core/package_arch/TribitsAddLibrary.cmake b/cmake/tribits/core/package_arch/TribitsAddLibrary.cmake index 4bac9f943c0b..30036149dbdc 100644 --- a/cmake/tribits/core/package_arch/TribitsAddLibrary.cmake +++ b/cmake/tribits/core/package_arch/TribitsAddLibrary.cmake @@ -48,7 +48,8 @@ include(PrependGlobalSet) include(RemoveGlobalDuplicates) include(TribitsGeneralMacros) include(TribitsReportInvalidTribitsUsage) -include(SetAndIncDirs) +include(TribitsDeprecatedHelpers) +include(TribitsSetAndIncDirs) # @FUNCTION: tribits_add_library() @@ -670,7 +671,7 @@ function(tribits_add_library_assert_deplibs) # dependency on the upstream package that owns this upstream TESTONLY # library if it comes from an upstream package. elseif (NOT PARSE_TESTONLY AND depLibIsTestOnlyLib) # any depLibAlreadyInPkgLibs - message(WARNING "WARNING: '${depLib}' in DEPLIBS is a TESTONLY lib" + tribits_deprecated("'${depLib}' in DEPLIBS is a TESTONLY lib" " and it is illegal to link to this non-TESTONLY library '${LIBRARY_NAME}'." " Such usage is deprecated (and this warning will soon become an error)!" " If this is a regular library in this package or in an dependent upstream" @@ -680,7 +681,7 @@ function(tribits_add_library_assert_deplibs) " ${${PACKAGE_NAME}_SOURCE_DIR}/cmake/Dependencies.cmake") # ToDo: Turn the above to FATAL_ERROR after dropping deprecated code elseif (NOT depLibAlreadyInPkgLibs AND TARGET ${prefixedDepLib}) # any PARSE_TESTONLY - message(WARNING "WARNING: '${depLib}' in DEPLIBS is not" + tribits_deprecated("'${depLib}' in DEPLIBS is not" " a lib in this package but is a library defined in the current" " cmake project! Such usage is deprecated (and" " will result in a configure error soon). If this is a library in" @@ -691,7 +692,7 @@ function(tribits_add_library_assert_deplibs) " this package's dependencies file" " ${${PACKAGE_NAME}_SOURCE_DIR}/cmake/Dependencies.cmake.") elseif (NOT depLibAlreadyInPkgLibs AND NOT TARGET ${prefixedDepLib} ) - message(WARNING "WARNING: '${depLib}' in DEPLIBS is not" + tribits_deprecated("'${depLib}' in DEPLIBS is not" " a lib defined in the current cmake project! Such usage is deprecated (and" " will result in a configure error soon). If this is an external" " lib you are trying to link in, it should likely be handled as a TriBITS" @@ -725,7 +726,7 @@ function(tribits_add_library_assert_importedlibs) FOUND_IMPORTEDLIB_IN_LIBRARIES_IDX) tribits_lib_is_testonly(${prefixedImportedLib} importedLibIsTestOnlyLib) if (importedLibIsTestOnlyLib) - message(WARNING "WARNING: '${importedLib}' in IMPORTEDLIBS is a TESTONLY lib" + tribits_deprecated("'${importedLib}' in IMPORTEDLIBS is a TESTONLY lib" " and it is illegal to pass in through IMPORTEDLIBS!" " Such usage is deprecated (and this warning will soon become an error)!" " Should '${importedLib}' instead be passed through DEPLIBS?") diff --git a/cmake/tribits/core/package_arch/TribitsAddTest.cmake b/cmake/tribits/core/package_arch/TribitsAddTest.cmake index d9dfa911133a..842bf3b2b94c 100644 --- a/cmake/tribits/core/package_arch/TribitsAddTest.cmake +++ b/cmake/tribits/core/package_arch/TribitsAddTest.cmake @@ -78,10 +78,11 @@ include(TribitsAddTestHelpers) # ) # # The tests are only added if tests are enabled for the package -# (i.e. `${PACKAGE_NAME}_ENABLE_TESTS`_) or the parent package (if this is a -# subpackage) (i.e. ``${PARENT_PACKAGE_NAME}_ENABLE_TESTS``). (NOTE: A more -# efficient way to optionally enable tests is to put them in a ``test/`` -# subdir and then include that subdir with `tribits_add_test_directories()`_.) +# (i.e. `${PACKAGE_NAME}_ENABLE_TESTS`_ ``= ON``). (NOTE: A more efficient +# way to optionally enable tests or examples is to put them in a ``test/`` or +# ``example/`` subdir and then include that subdir with +# `tribits_add_test_directories()`_ or `tribits_add_example_directories()`_, +# respectively.) # # *Sections:* # diff --git a/cmake/tribits/core/package_arch/TribitsAddTestHelpers.cmake b/cmake/tribits/core/package_arch/TribitsAddTestHelpers.cmake index 453de5432672..ba8a6412b67b 100644 --- a/cmake/tribits/core/package_arch/TribitsAddTestHelpers.cmake +++ b/cmake/tribits/core/package_arch/TribitsAddTestHelpers.cmake @@ -211,8 +211,8 @@ function(tribits_add_test_process_enable_tests ADD_THE_TEST_OUT) set(ADD_THE_TEST TRUE) else() message_wrapper( - "-- ${TEST_NAME}: NOT added test because ${PACKAGE_NAME}_ENABLE_TESTS='${${PACKAGE_NAME}_ENABLE_TESTS}'." - ) + "-- ${TEST_NAME}: NOT added test because" + " ${PACKAGE_NAME}_ENABLE_TESTS='${${PACKAGE_NAME}_ENABLE_TESTS}'.") set(ADD_THE_TEST FALSE) endif() set(${ADD_THE_TEST_OUT} ${ADD_THE_TEST} PARENT_SCOPE) diff --git a/cmake/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake b/cmake/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake index 55c83d96af77..53bbb1f2b5d5 100644 --- a/cmake/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake +++ b/cmake/tribits/core/package_arch/TribitsAdjustPackageEnables.cmake @@ -42,7 +42,9 @@ include(TribitsProcessPackagesAndDirsLists) include(TribitsAddOptionAndDefine) include(TribitsGeneralMacros) include(TribitsPrintEnabledPackagesLists) +include(TribitsPrintDependencyInfo) include(TribitsPackageDependencies) +include(TribitsGetPackageEnableStatus) include(AdvancedOption) include(AdvancedSet) @@ -59,258 +61,385 @@ include(SetDefault) include(MessageWrapper) include(DualScopeSet) include(CMakeParseArguments) +include(TribitsCreateReverseList) +# NOTE: A nice way to view and navigate the contents of this file is to use +# the emacs 'occur' string: # -# Private helper macros +# "\(^##########\|^# .*-level\|^function\|^macro\)" + + +# @MACRO: tribits_adjust_package_enables() +# +# Usage: +# +# tribits_adjust_package_enables() +# +# Macro that adjusts all of the package enables from what the user input to +# the final set that will be used to enable packages. # +macro(tribits_adjust_package_enables) + tribits_unenable_enabled_packages() + tribits_sweep_forward_apply_disables() + tribits_sweep_forward_apply_enables() + tribits_disable_and_enable_tests_and_examples() + tribits_sweep_backward_enable_upstream_packages() + tribits_set_cache_vars_for_current_enabled_packages() + tribits_do_final_parent_packages_enables_for_subpackage_enables() + tribits_setup_enabled_lists_and_pkg_idxs() + tribits_setup_direct_packages_dependencies_lists_and_lib_required_enable_vars() + tribits_print_direct_packages_dependencies_lists() +endmacro() -function(tribits_private_print_disable - ENABLE_BEING_DISABLED_VAR_NAME PACKAGE_WITH_SOMETHING_BEING_DISABLED - DEP_TYPE_STR THING_DISALBED_TYPE THING_DISABLED_NAME - ) - #print_var(${ENABLE_BEING_DISABLED_VAR_NAME}) - if (${ENABLE_BEING_DISABLED_VAR_NAME}) - if (${PROJECT_NAME}_DISABLE_ENABLED_FORWARD_DEP_PACKAGES) - message( - " ***\n" - " *** NOTE: Setting ${ENABLE_BEING_DISABLED_VAR_NAME}=OFF" - " which was '${${ENABLE_BEING_DISABLED_VAR_NAME}}' because" - " ${PACKAGE_WITH_SOMETHING_BEING_DISABLED} has" - " a required ${DEP_TYPE_STR} dependence on disabled" - " ${THING_DISALBED_TYPE} ${THING_DISABLED_NAME}" - " but ${PROJECT_NAME}_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON!\n" - " ***\n" - ) - else() - message(FATAL_ERROR - " ***\n" - " *** ERROR: Setting ${ENABLE_BEING_DISABLED_VAR_NAME}=OFF" - " which was '${${ENABLE_BEING_DISABLED_VAR_NAME}}' because" - " ${PACKAGE_WITH_SOMETHING_BEING_DISABLED} has" - " a required ${DEP_TYPE_STR} dependence on disabled" - " ${THING_DISALBED_TYPE} ${THING_DISABLED_NAME}!\n" - " ***\n" - ) - endif() - else() - message("-- " - "Setting ${ENABLE_BEING_DISABLED_VAR_NAME}=OFF" - " because ${PACKAGE_WITH_SOMETHING_BEING_DISABLED} has a required ${DEP_TYPE_STR}" - " dependence on disabled ${THING_DISALBED_TYPE} ${THING_DISABLED_NAME}") - endif() -endfunction() + +################################################################################ +# +# First-level macros called directly from ``tribits_adjust_package_enables()`` +# +# NOTE: In the below macros, local variables are prefixed by 'tap1_' in all of +# the macros() which will not clash because they are at the same level in the +# call stack (and are initialized in each macro). +# +################################################################################ -macro(tribits_private_disable_tpl_required_package_enable - TPL_NAME PACKAGE_NAME LIBRARY_DEP - ) +# @MACRO: tribits_unenable_enabled_packages() +# +# Macro to enable all unenabled packages if asked. +# +# See implementation for details. +# +macro(tribits_unenable_enabled_packages) + if (${PROJECT_NAME}_UNENABLE_ENABLED_PACKAGES) + message("\nSetting to empty '' all enabled packages because" + " ${PROJECT_NAME}_UNENABLE_ENABLED_PACKAGES=" + "'${${PROJECT_NAME}_UNENABLE_ENABLED_PACKAGES}'\n") + foreach(tap1_tribitsPkg IN LISTS ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES) + if (${PROJECT_NAME}_ENABLE_${tap1_tribitsPkg}) + message("-- " "Setting ${PROJECT_NAME}_ENABLE_${tap1_tribitsPkg}=''") + set_cache_on_off_empty(${PROJECT_NAME}_ENABLE_${tap1_tribitsPkg} "" + "Forced to empty '' by ${PROJECT_NAME}_UNENABLE_ENABLED_PACKAGES=ON" FORCE) + endif() + # NOTE: Above, we don't want to set to empty those packages that have hard + # disables because this will mess up the logic in later invocations. + endforeach() + advanced_set(${PROJECT_NAME}_UNENABLE_ENABLED_PACKAGES OFF CACHE BOOL + "Forced to FALSE after use" FORCE) + endif() +endmacro() - #message("TRIBITS_PRIVATE_DISABLE_TPL_REQUIRED_PACKAGE_ENABLE" - # " ${TPL_NAME} ${PACKAGE_NAME} ${LIBRARY_DEP}") - # Only turn off PACKAGE_NAME libraries and test/examples if it - # is currently enabled or could be enabled. +# @MACRO: tribits_sweep_forward_apply_disables() +# +# Sweep forward and apply all disables in order first. +# +# See implementation for details. +# +macro(tribits_sweep_forward_apply_disables) - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} - OR ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} STREQUAL "" - ) + message("\nDisabling all packages that have a required dependency" + " on disabled TPLs and optional package TPL support based on TPL_ENABLE_=OFF ...\n") - if ("${LIBRARY_DEP}" STREQUAL "TRUE") + message("\nDisabling subpackages for hard disables of parent packages" + " due to ${PROJECT_NAME}_ENABLE_=OFF ...\n") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES) + tribits_disable_parents_subpackages(${tad1_tribitsPkg}) + endforeach() - tribits_private_print_disable( - ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} ${PACKAGE_NAME} "library" - "TPL" ${TPL_NAME} - ) + message("\nDisabling forward required packages and optional intra-package" + " support that have a dependency on disabled packages" + " ${PROJECT_NAME}_ENABLE_=OFF (or" + " TPL_ENABLE_=OFF) ...\n") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_DEFINED_PACKAGES) + tribits_disable_forward_required_dep_packages(${tad1_tribitsPkg}) + endforeach() - set(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} OFF) +endmacro() - else() - set(DEP_TYPE_STR "test/example") +# @MACRO: tribits_sweep_forward_apply_enables() +# +# Updates the following variables in the local scope: +# +# * ``${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES`` +# * `${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES`_ +# +# See implementation for details. +# +macro(tribits_sweep_forward_apply_enables) - if (${PACKAGE_NAME}_ENABLE_TESTS - OR "${${PACKAGE_NAME}_ENABLE_TESTS}" STREQUAL "" - ) - tribits_private_print_disable( - ${PACKAGE_NAME}_ENABLE_TESTS ${PACKAGE_NAME} "${DEP_TYPE_STR}" - "TPL" ${TPL_NAME} - ) - set(${PACKAGE_NAME}_ENABLE_TESTS OFF) - endif() + tribits_get_sublist_nondisabled( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES + ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES "") + tribits_create_reverse_list(${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES + ${PROJECT_NAME}_REVERSE_NOTDISABLED_INTERNAL_PACKAGES) - if (${PACKAGE_NAME}_ENABLE_EXAMPLES - OR "${${PACKAGE_NAME}_ENABLE_EXAMPLES}" STREQUAL "" - ) - tribits_private_print_disable( - ${PACKAGE_NAME}_ENABLE_EXAMPLES ${PACKAGE_NAME} "${DEP_TYPE_STR}" - "TPL" ${TPL_NAME} - ) - set(${PACKAGE_NAME}_ENABLE_EXAMPLES OFF) - endif() + message("\nEnabling subpackages for hard enables of parent packages" + " due to ${PROJECT_NAME}_ENABLE_=ON ...\n") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES) + tribits_enable_parents_subpackages(${tad1_tribitsPkg}) + endforeach() - # NOTE: We can't assert that ${PACKAGE_NAME}_ENABLE_TESTS or - # ${PACKAGE_NAME}_ENABLE_EXAMPLES exists yet because - # tribits_set_up_optional_package_enables_and_cache_vars() which defines - # them is not called until after the final package enables are set. + if (${PROJECT_NAME}_ENABLE_ALL_PACKAGES) + message("\nEnabling all packages that are not currently disabled because of" + " ${PROJECT_NAME}_ENABLE_ALL_PACKAGES=ON" + " (${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE=" + "${${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE}) ...\n") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES) + tribits_apply_all_package_enables(${tad1_tribitsPkg}) + endforeach() + endif() - endif() + if (${PROJECT_NAME}_ENABLE_ALL_FORWARD_DEP_PACKAGES) + message("\nSweep forward enabling all forward library dependent packages because" + " ${PROJECT_NAME}_ENABLE_ALL_FORWARD_DEP_PACKAGES=ON ...\n") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES) + tribits_enable_forward_lib_package_enables(${tad1_tribitsPkg}) + endforeach() + tribits_get_sublist_enabled( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES + ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") + tribits_create_reverse_list(${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES + ${PROJECT_NAME}_REVERSE_ENABLED_INTERNAL_PACKAGES) + + message("\nSweep backward enabling all forward test dependent packages because" + " ${PROJECT_NAME}_ENABLE_ALL_FORWARD_DEP_PACKAGES=ON ...\n") + foreach(tad1_tribitsPkg IN LISTS + ${PROJECT_NAME}_REVERSE_ENABLED_INTERNAL_PACKAGES + ) + tribits_enable_forward_test_package_enables(${tad1_tribitsPkg}) + endforeach() + # NOTE: Above, we want to sweep backward to enable test-dependent packages + # because we don't want to enable package Z just because package Y was enabled + # because it had a test-only dependency on package X. Sweeping backwards through + # the packages makes sure this does not happen. + set(${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES ON) endif() + tribits_get_sublist_enabled( ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES + ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") + endmacro() +# NOTE: Above, we are sweeping over *all* of the not-disabled packages listed +# in ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES, including those package that +# might have _PACKAGE_BUILD_STATUS=EXTERNAL. That makes sense +# because these are TriBITS (or TriBITS compatible) packages so we should +# assume that all of their downstream packages, whether internal or external, +# should be enabled as well. If we find this is not the desirable behavior, +# then we can change this later. -function(tribits_private_print_disable_required_package_enable - PACKAGE_NAME PACKAGE_ENABLE_SOMETHING_VAR_NAME FORWARD_DEP_PACKAGE_NAME - DEP_TYPE_STR - ) - tribits_private_print_disable( - ${PACKAGE_ENABLE_SOMETHING_VAR_NAME} ${FORWARD_DEP_PACKAGE_NAME} - "${DEP_TYPE_STR}" "package" ${PACKAGE_NAME} ) -endfunction() +# @MACRO: tribits_disable_and_enable_tests_and_examples() +# +# Adjust test and example enables based on different criteria. +# +# See implementation for details. +# +macro(tribits_disable_and_enable_tests_and_examples) + message("\nDisabling subpackage tests/examples based on parent package" + " tests/examples disables ...\n") + foreach(tad1_tribitsPkg IN LISTS + ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES + ) + tribits_apply_package_examples_disable(${tad1_tribitsPkg} TESTS) + tribits_apply_subpackage_tests_or_examples_disables(${tad1_tribitsPkg} TESTS) + tribits_apply_subpackage_tests_or_examples_disables(${tad1_tribitsPkg} EXAMPLES) + endforeach() -macro(tribits_private_disable_required_package_enables - FORWARD_DEP_PACKAGE_NAME PACKAGE_NAME LIBRARY_DEP - ) + if (${PROJECT_NAME}_ENABLE_TESTS OR ${PROJECT_NAME}_ENABLE_EXAMPLES) + message("\nEnabling all tests and/or examples that have not been" + " explicitly disabled because ${PROJECT_NAME}_ENABLE_[TESTS,EXAMPLES]=ON ...\n") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES) + tribits_apply_test_example_enables(${tad1_tribitsPkg}) + endforeach() + endif() + # NOTE: Above, we enable tests and examples here, before the remaining required + # packages so that we don't enable tests that don't need to be enabled based + # on the use of the option ${PROJECT_NAME}_ENABLE_ALL_FORWARD_DEP_PACKAGES. - #message("TRIBITS_PRIVATE_DISABLE_REQUIRED_PACKAGE_ENABLES" - # " ${FORWARD_DEP_PACKAGE_NAME} ${LIBRARY_DEP}") + message("\nEnabling subpackage tests/examples based on parent package tests/examples enables ...\n") + foreach(tad1_tribitsPkg IN LISTS + ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES + ) + tribits_apply_subpackage_tests_examples_enables(${tad1_tribitsPkg}) + endforeach() + # NOTE: We want to apply this logic here instead of later after the backward + # sweep of package enables because we don't want to enable the + # tests/examples for a subpackage if it is not needed based on set of + # requested subpackages and packages to be enabled and the optional forward + # sweep of downstream packages. - # Only turn off FORWARD_DEP_PACKAGE libraries and test/examples if it - # is currently enabled or could be enabled +endmacro() - assert_defined(${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME}) - if (${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME} - OR ${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME} STREQUAL "" - ) - if ("${LIBRARY_DEP}" STREQUAL "TRUE") +# @MACRO: tribits_sweep_backward_enable_upstream_packages() +# +# Sweep backwards and enable required and (optionally) optional upstream +# packages. +# +# This sets the final value for: +# +# * `${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES`_ +# +# See implementation for details. +# +macro(tribits_sweep_backward_enable_upstream_packages) - tribits_private_print_disable_required_package_enable( - ${PACKAGE_NAME} ${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME} - ${FORWARD_DEP_PACKAGE_NAME} "library" ) + set(tap1_extraMsgStr "") + if (${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES) + set(tap1_extraMsgStr + " (and optional since ${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES=ON)") + endif() - set(${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME} OFF) + tribits_get_sublist_nondisabled( ${PROJECT_NAME}_DEFINED_PACKAGES + ${PROJECT_NAME}_NOTDISABLED_PACKAGES "") + tribits_create_reverse_list(${PROJECT_NAME}_NOTDISABLED_PACKAGES + ${PROJECT_NAME}_REVERSE_NOTDISABLED_PACKAGES) + + message("\nEnabling all required${tap1_extraMsgStr} upstream packages for current" + " set of enabled packages (${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE=" + "${${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE}) ...\n") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_REVERSE_NOTDISABLED_PACKAGES) + tribits_enable_upstream_packages(${tad1_tribitsPkg}) + endforeach() + # NOTE: Above, we have to loop through the packages backward to enable all + # the packages that this package depends on. This has to include *all* + # upstream package enables including required packages, and optional + # packages (when ${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES). - else() + tribits_get_sublist_enabled( ${PROJECT_NAME}_NOTDISABLED_INTERNAL_PACKAGES + ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") - set(DEP_TYPE_STR "test/example") + message("\nEnabling all optional intra-package enables" + " _ENABLE_ that are not currently disabled" + " if both sets of packages are enabled ...\n") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES) + tribits_postprocess_optional_package_enables(${tad1_tribitsPkg}) + endforeach() - if (${FORWARD_DEP_PACKAGE_NAME}_ENABLE_TESTS - OR "${${FORWARD_DEP_PACKAGE_NAME}_ENABLE_TESTS}" STREQUAL "" - ) - tribits_private_print_disable_required_package_enable( - ${PACKAGE_NAME} ${FORWARD_DEP_PACKAGE_NAME}_ENABLE_TESTS - ${FORWARD_DEP_PACKAGE_NAME} "${DEP_TYPE_STR}" ) - set(${FORWARD_DEP_PACKAGE_NAME}_ENABLE_TESTS OFF) - endif() +endmacro() - if (${FORWARD_DEP_PACKAGE_NAME}_ENABLE_EXAMPLES - OR "${${FORWARD_DEP_PACKAGE_NAME}_ENABLE_EXAMPLES}" STREQUAL "" - ) - tribits_private_print_disable_required_package_enable( - ${PACKAGE_NAME} ${FORWARD_DEP_PACKAGE_NAME}_ENABLE_EXAMPLES - ${FORWARD_DEP_PACKAGE_NAME} "${DEP_TYPE_STR}" ) - set(${FORWARD_DEP_PACKAGE_NAME}_ENABLE_EXAMPLES OFF) - endif() - endif() +# @MACRO: tribits_set_cache_vars_for_current_enabled_packages() +# +macro(tribits_set_cache_vars_for_current_enabled_packages) + message("\nSet cache entries for optional packages/TPLs and tests/examples for packages actually enabled ...\n") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES) + tribits_setup_optional_package_enables_and_cache_vars(${tad1_tribitsPkg}) + endforeach() +endmacro() - endif() -endmacro() +# @MACRO: tribits_do_final_parent_packages_enables_for_subpackage_enables() +# +macro(tribits_do_final_parent_packages_enables_for_subpackage_enables) + message("\nEnabling the shell of non-enabled parent packages (mostly for show)" + " that have at least one subpackage enabled ...\n") + foreach(tad1_tribitsPkg IN LISTS + ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES + ) + tribits_enable_parent_package_for_subpackage_enables(${tad1_tribitsPkg}) + endforeach() + # NOTE: The above ensures that loops involving the parent package will + # process the parent package. But this has to be done after all of the + # other enable/disable logic to ensure no downstream dependencies will be + # enabled based on this. -macro(tribits_private_disable_optional_package_enables - FORWARD_DEP_PACKAGE_NAME PACKAGE_NAME - ) +endmacro() - #message("TRIBITS_PRIVATE_DISABLE_OPTIONAL_PACKAGE_ENABLES" - # " ${FORWARD_DEP_PACKAGE_NAME} ${PACKAGE_NAME}") - #message("-- " "${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME} = ${${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME}}") - #assert_defined(${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME}) - if (${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME} OR "${${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME}}" STREQUAL "") - # Always disable the conditional enable but only print the message if the package is enabled. - #message("-- Disable ${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME} ...") - if (${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME}) - if (${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME}) # is explicitly try already! - message("-- " - "NOTE: Setting ${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME}=OFF" - " which was ${${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME}}" - " because ${FORWARD_DEP_PACKAGE_NAME} has an optional library dependence" - " on disabled package ${PACKAGE_NAME}") - else() # Not explicitly set - message("-- " - "Setting ${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME}=OFF" - " because ${FORWARD_DEP_PACKAGE_NAME} has an optional library dependence" - " on disabled package ${PACKAGE_NAME}") - endif() - endif() - set(${FORWARD_DEP_PACKAGE_NAME}_ENABLE_${PACKAGE_NAME} OFF) - endif() +# Macro that sets up the basic lists of enabled packages and packages. +# +macro(tribits_setup_enabled_lists_and_pkg_idxs) + + # ${PROJECT_NAME}_ENABLED_PACKAGES + tribits_get_sublist_enabled( + ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES + ${PROJECT_NAME}_ENABLED_INTERNAL_TOPLEVEL_PACKAGES + ${PROJECT_NAME}_NUM_ENABLED_INTERNAL_TOPLEVEL_PACKAGES) + + # ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES + tribits_get_sublist_enabled( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES + ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES + ${PROJECT_NAME}_NUM_ENABLED_INTERNAL_PACKAGES) + + # ${PROJECT_NAME}_REVERSE_ENABLED_INTERNAL_PACKAGES + unset(${PROJECT_NAME}_REVERSE_ENABLED_INTERNAL_PACKAGES) # Wipe out temp value + + # Set ${tribitsPackage}_PKG_IDX for each enabled package + set(pkgIdx 0) + foreach(tribitsPackage ${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}) + set(${tribitsPackage}_PKG_IDX ${pkgIdx}) + math(EXPR pkgIdx "${pkgIdx} + 1") + endforeach() endmacro() -# Macro that disabled a packages if its required upstream TPL is disabled.. +# @MACRO: tribits_setup_direct_packages_dependencies_lists_and_lib_required_enable_vars() +# +# Set up flat list of direct external and inner package dependencies (even for +# non-enabled packages) and enabled package dependencies for enabled packages. # -macro(tribits_disable_package_if_tpl_disabled TRIBITS_PACKAGE) +macro(tribits_setup_direct_packages_dependencies_lists_and_lib_required_enable_vars) - foreach(TPL_NAME ${${TRIBITS_PACKAGE}_LIB_REQUIRED_DEP_TPLS}) - if ( (NOT TPL_ENABLE_${TPL_NAME}) AND - (NOT "${TPL_ENABLE_${TPL_NAME}}" STREQUAL "") - ) - tribits_private_disable_tpl_required_package_enable( - ${TPL_NAME} ${TRIBITS_PACKAGE} TRUE ) - endif() + foreach(tad1_externalPkgName IN LISTS ${PROJECT_NAME}_DEFINED_TPLS) + tribits_extpkg_setup_enabled_dependencies(${tad1_externalPkgName}) + # ToDo: Assert that all of the listed dependencies in + # ${tad1_externalPkgName}_LIB_ENABLED_DEPENDENCIES exist and are + # upstream from ${tad1_externalPkgName} endforeach() - foreach(TPL_NAME ${${TRIBITS_PACKAGE}_TEST_REQUIRED_DEP_TPLS}) - if ( (NOT TPL_ENABLE_${TPL_NAME}) AND - (NOT "${TPL_ENABLE_${TPL_NAME}}" STREQUAL "") - ) - tribits_private_disable_tpl_required_package_enable( - ${TPL_NAME} ${TRIBITS_PACKAGE} FALSE ) - endif() + foreach(tad1_internalPkgName IN LISTS ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES) + tribits_setup_enabled_dependencies_lists_and_enable_vars(${tad1_internalPkgName}) endforeach() endmacro() -# Macro that disables all of the subpackages of a parent package. +# @MACRO: tribits_print_direct_packages_dependencies_lists() +# +macro(tribits_print_direct_packages_dependencies_lists) + if (${PROJECT_NAME}_DUMP_PACKAGE_DEPENDENCIES) + message("\nDumping direct enabled dependencies for each package ...") + foreach(tad1_tribitsPkg IN LISTS ${PROJECT_NAME}_DEFINED_PACKAGES) + tribits_print_direct_package_dependencies_lists(${tad1_tribitsPkg}) + endforeach() + endif() +endmacro() + + + +################################################################################ # -macro(tribits_disable_parents_subpackages PARENT_PACKAGE_NAME) +# Second-level macros called indirectly from ``tribits_adjust_package_enables()`` +# +################################################################################ - #message("TRIBITS_DISABLE_PARENTS_SUBPACKAGES: ${PARENT_PACKAGE_NAME}") - #print_var(${PROJECT_NAME}_ENABLE_${PARENT_PACKAGE_NAME}) +# Macro that disables all of the subpackages of a parent package. +# +macro(tribits_disable_parents_subpackages parentPackageName) - if(NOT ${PROJECT_NAME}_ENABLE_${PARENT_PACKAGE_NAME} - AND NOT ${PROJECT_NAME}_ENABLE_${PARENT_PACKAGE_NAME} STREQUAL "" + if(NOT ${PROJECT_NAME}_ENABLE_${parentPackageName} + AND (NOT ${PROJECT_NAME}_ENABLE_${parentPackageName} STREQUAL "") ) - set(SUBPACKAGE_IDX 0) - foreach(TRIBITS_SUBPACKAGE ${${PARENT_PACKAGE_NAME}_SUBPACKAGES}) + foreach(tap2_subPkgName IN LISTS ${parentPackageName}_SUBPACKAGES) - set(SUBPACKAGE_NAME ${TRIBITS_SUBPACKAGE}) - set(SUBPACKAGE_FULLNAME ${PARENT_PACKAGE_NAME}${TRIBITS_SUBPACKAGE}) + set(subpkgFullName ${parentPackageName}${tap2_subPkgName}) - #print_var(${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}) - if (NOT ${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME} STREQUAL "OFF") - set(ENABLE_BEING_DISABLED_VAR_NAME ${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}) + if (NOT ${PROJECT_NAME}_ENABLE_${subpkgFullName} STREQUAL "OFF") + set(packageBeingDisabledVarName ${PROJECT_NAME}_ENABLE_${subpkgFullName}) message("-- " - "Setting subpackage enable ${ENABLE_BEING_DISABLED_VAR_NAME}=OFF" - " because parent package ${PROJECT_NAME}_ENABLE_${PARENT_PACKAGE_NAME}=OFF") - set(${ENABLE_BEING_DISABLED_VAR_NAME} OFF) + "Setting subpackage enable ${packageBeingDisabledVarName}=OFF" + " because parent package ${PROJECT_NAME}_ENABLE_${parentPackageName}=OFF") + set(${packageBeingDisabledVarName} OFF) endif() - math(EXPR SUBPACKAGE_IDX "${SUBPACKAGE_IDX}+1") - endforeach() endif() @@ -318,44 +447,62 @@ macro(tribits_disable_parents_subpackages PARENT_PACKAGE_NAME) endmacro() -# Macro that enables all of the subpackages of a parent package. +# Macro that disables forward package that depends on the passed-in package # -macro(tribits_enable_parents_subpackages PARENT_PACKAGE_NAME) - - #message("TRIBITS_ENABLE_PARENTS_SUBPACKAGES: ${PARENT_PACKAGE_NAME}") +macro(tribits_disable_forward_required_dep_packages packageName) + tribits_get_package_enable_status(${packageName} packageEnable "") + if ((NOT packageEnable) AND (NOT "${packageEnable}" STREQUAL "")) + foreach(fwdDepPkg IN LISTS ${packageName}_FORWARD_LIB_DEFINED_DEPENDENCIES) + if (${fwdDepPkg}_LIB_DEP_REQUIRED_${packageName}) + tribits_private_disable_required_package_enables(${fwdDepPkg} + ${packageName} TRUE) + else() + tribits_private_disable_optional_package_enables(${fwdDepPkg} + ${packageName} TRUE) + endif() + endforeach() + foreach(fwdDepPkg IN LISTS ${packageName}_FORWARD_TEST_DEFINED_DEPENDENCIES) + if (${fwdDepPkg}_TEST_DEP_REQUIRED_${packageName}) + tribits_private_disable_required_package_enables(${fwdDepPkg} + ${packageName} FALSE) + endif() + endforeach() + endif() +endmacro() - #print_var(${PROJECT_NAME}_ENABLE_${PARENT_PACKAGE_NAME}) - if(${PROJECT_NAME}_ENABLE_${PARENT_PACKAGE_NAME}) +# Macro that enables all of the subpackages of a parent package. +# +macro(tribits_enable_parents_subpackages parentPackageName) - set(SUBPACKAGE_IDX 0) - foreach(TRIBITS_SUBPACKAGE ${${PARENT_PACKAGE_NAME}_SUBPACKAGES}) + if(${PROJECT_NAME}_ENABLE_${parentPackageName}) - set(SUBPACKAGE_NAME ${TRIBITS_SUBPACKAGE}) - set(SUBPACKAGE_FULLNAME ${PARENT_PACKAGE_NAME}${TRIBITS_SUBPACKAGE}) + set(subpkgIdx 0) + foreach(tap2_subPkgName IN LISTS ${parentPackageName}_SUBPACKAGES) - #print_var(${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}) + set(subpkgFullName ${parentPackageName}${tap2_subPkgName}) - if (NOT ${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME} AND - NOT "${${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}}" STREQUAL "" + if (NOT ${PROJECT_NAME}_ENABLE_${subpkgFullName} AND + NOT "${${PROJECT_NAME}_ENABLE_${subpkgFullName}}" STREQUAL "" ) # The subpackage is already disabled and is not just empty! - elseif (${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}) + elseif (${PROJECT_NAME}_ENABLE_${subpkgFullName}) # The subpackage is already enabled so there is no reason to enable it! else() # The subpackage is not hard off or on so turn it on by default - tribits_implicit_package_enable_is_allowed( "" ${SUBPACKAGE_FULLNAME} - SUBPACKAGE_ALLOW_IMPLICIT_ENABLE) - if (SUBPACKAGE_ALLOW_IMPLICIT_ENABLE) - set(ENABLE_BEING_ENABLED_VAR_NAME ${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}) + tribits_implicit_package_enable_is_allowed( "" ${subpkgFullName} + subpkgAllowImplicitEnable) + if (subpkgAllowImplicitEnable) + set(enableVarName ${PROJECT_NAME}_ENABLE_${subpkgFullName}) message("-- " - "Setting subpackage enable ${ENABLE_BEING_ENABLED_VAR_NAME}=ON" - " because parent package ${PROJECT_NAME}_ENABLE_${PARENT_PACKAGE_NAME}=ON") - set(${ENABLE_BEING_ENABLED_VAR_NAME} ON) + "Setting subpackage enable ${enableVarName}=ON" + " because parent package ${PROJECT_NAME}_ENABLE_${parentPackageName}=" + "${${PROJECT_NAME}_ENABLE_${parentPackageName}}") + set(${enableVarName} ON) endif() endif() - math(EXPR SUBPACKAGE_IDX "${SUBPACKAGE_IDX}+1") + math(EXPR subpkgIdx "${subpkgIdx}+1") endforeach() @@ -364,129 +511,201 @@ macro(tribits_enable_parents_subpackages PARENT_PACKAGE_NAME) endmacro() -# Macro that disables all forward packages that depend on the given packages +# Macro used to set ${PROJECT_NAME}_ENABLE_ based on +# ${PROJECT_NAME}_ENABLE_ALL_PACKAGES # -macro(tribits_disable_forward_required_dep_packages PACKAGE_NAME) - - #message("TRIBITS_DISABLE_FORWARD_REQUIRED_DEP_PACKAGES: ${PACKAGE_NAME}") - - if ( - (NOT ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - AND - (NOT "${${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}}" STREQUAL "") - ) - - foreach(FWD_DEP_PKG ${${PACKAGE_NAME}_FORWARD_LIB_REQUIRED_DEP_PACKAGES}) - tribits_private_disable_required_package_enables(${FWD_DEP_PKG} ${PACKAGE_NAME} TRUE) - endforeach() +macro(tribits_apply_all_package_enables packageName) + tribits_is_primary_meta_project_package(${packageName} packageIsPmpp) + tribits_implicit_package_enable_is_allowed( "" ${packageName} + processThisPackageEnable ) + if (packageIsPmpp AND processThisPackageEnable) + tribits_set_package_enable_based_on_project_enable( + ${PROJECT_NAME}_ENABLE_ALL_PACKAGES ${PROJECT_NAME}_ENABLE_${packageName} ) + endif() +endmacro() - foreach(FWD_DEP_PKG ${${PACKAGE_NAME}_FORWARD_LIB_OPTIONAL_DEP_PACKAGES}) - tribits_private_disable_optional_package_enables(${FWD_DEP_PKG} ${PACKAGE_NAME}) - endforeach() - foreach(FWD_DEP_PKG ${${PACKAGE_NAME}_FORWARD_TEST_REQUIRED_DEP_PACKAGES}) - tribits_private_disable_required_package_enables(${FWD_DEP_PKG} ${PACKAGE_NAME} FALSE) +# Macro used to set ${PROJECT_NAME}_ENABLE_${FWD_PACKAGE_NAME}=ON for all +# forward required or optional LIB dependency on ${packageName} +# +macro(tribits_enable_forward_lib_package_enables packageName) + if (${PROJECT_NAME}_ENABLE_${packageName}) + foreach(fwdDepPkgName IN LISTS ${packageName}_FORWARD_LIB_DEFINED_DEPENDENCIES) + tribits_private_enable_forward_package(${fwdDepPkgName} ${packageName}) endforeach() - endif() - endmacro() -# Macro that prints out dependencies for a package +# Macro used to set ${PROJECT_NAME}_ENABLE_${FWD_PACKAGE_NAME}=ON for all +# forward required or optional TEST dependency on ${packageName} # -# Does not modify the global state. -# -macro(tribits_print_package_dependencies PACKAGE_NAME) - - set(PRINTED_VAR "") +macro(tribits_enable_forward_test_package_enables packageName) + foreach(fwdDepPkgName IN LISTS ${packageName}_FORWARD_TEST_DEFINED_DEPENDENCIES) + tribits_private_enable_forward_package(${fwdDepPkgName} ${packageName}) + endforeach() +endmacro() +# NOTE: The above macro does not need to check if ${packageName} is enabled +# because it will only be called for packages that are enabled already. This +# not only improves performance but it also aids in testing. - print_nonempty_var_with_spaces(${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES PRINTED_VAR) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES PRINTED_VAR) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_TEST_REQUIRED_DEP_PACKAGES PRINTED_VAR) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES PRINTED_VAR) - if (${PROJECT_NAME}_DUMP_FORWARD_PACKAGE_DEPENDENCIES) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_FORWARD_LIB_REQUIRED_DEP_PACKAGES - PRINTED_VAR) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_FORWARD_LIB_OPTIONAL_DEP_PACKAGES - PRINTED_VAR) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_FORWARD_TEST_REQUIRED_DEP_PACKAGES - PRINTED_VAR) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_FORWARD_TEST_OPTIONAL_DEP_PACKAGES - PRINTED_VAR) +# Macro to disable ${parentPackageName)_ENABLE_ENABLES by default if +# ${parentPackageName)_ENABLE_TESTS is explicitly disabled. +# +macro(tribits_apply_package_examples_disable parentPackageName) + if ( (NOT ${parentPackageName}_ENABLE_TESTS) + AND (NOT "${${parentPackageName}_ENABLE_TESTS}" STREQUAL "") + AND ("${${parentPackageName}_ENABLE_EXAMPLES}" STREQUAL "") + ) + message("-- " "Setting" + " ${parentPackageName}_ENABLE_EXAMPLES" + "=${${parentPackageName}_ENABLE_TESTS}" + " because" + " ${parentPackageName}_ENABLE_TESTS" + "=${${parentPackageName}_ENABLE_TESTS}" ) + set(${parentPackageName}_ENABLE_EXAMPLES ${${parentPackageName}_ENABLE_TESTS}) endif() +endmacro() +# NOTE: Above, the top-level package ${parentPackageName} may not even be +# enabled yet when this gets called but its subpackages might and we need to +# process this default disable in case their are any enabled subpackages. - print_nonempty_var_with_spaces(${PACKAGE_NAME}_LIB_REQUIRED_DEP_TPLS PRINTED_VAR) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_LIB_OPTIONAL_DEP_TPLS PRINTED_VAR) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_TEST_REQUIRED_DEP_TPLS PRINTED_VAR) - print_nonempty_var_with_spaces(${PACKAGE_NAME}_TEST_OPTIONAL_DEP_TPLS PRINTED_VAR) - if (NOT PRINTED_VAR) - message("-- ${PACKAGE_NAME}: No dependencies!") +# Macro to disable _ENABLE_TESTS and +# _ENABLE_EXAMPLES based on +# _ENABLE_TESTS or _ENABLE_EXAMPLES +# +macro(tribits_apply_subpackage_tests_or_examples_disables parentPackageName + testsOrExamples + ) + set(parentPkgEnableVar ${parentPackageName}_ENABLE_${testsOrExamples}) + if ((NOT ${parentPkgEnableVar}) AND (NOT "${${parentPkgEnableVar}}" STREQUAL "")) + foreach(subpkgName IN LISTS ${parentPackageName}_SUBPACKAGES) + set(fullSpkgName ${parentPackageName}${subpkgName}) + if (${PROJECT_NAME}_ENABLE_${fullSpkgName}) + if ("${${fullSpkgName}_ENABLE_${testsOrExamples}}" STREQUAL "") + message("-- " "Setting" + " ${fullSpkgName}_ENABLE_${testsOrExamples}=${${parentPkgEnableVar}}" + " because parent package" + " ${parentPkgEnableVar}=${${parentPkgEnableVar}}") + set(${fullSpkgName}_ENABLE_${testsOrExamples} ${${parentPkgEnableVar}}) + endif() + endif() + endforeach() endif() - endmacro() +# Macro used to set _ENABLE_TESTS and +# _ENABLE_EXAMPLES based on ${PROJECT_NAME}_ENABLE_TESTS and +# ${PROJECT_NAME}_ENABLE_EXAMPLES # -# Private helper macros -# - +macro(tribits_apply_test_example_enables packageName) + if (${PROJECT_NAME}_ENABLE_${packageName}) + tribits_is_primary_meta_project_package(${packageName} packageIsPmmp) + if (packageIsPmmp) + tribits_set_package_enable_based_on_project_enable_on( + ${PROJECT_NAME}_ENABLE_TESTS ${packageName}_ENABLE_TESTS ) + tribits_set_package_enable_based_on_project_enable_on( + ${PROJECT_NAME}_ENABLE_EXAMPLES ${packageName}_ENABLE_EXAMPLES ) + endif() + endif() +endmacro() -macro(tribits_private_add_optional_package_enable PACKAGE_NAME OPTIONAL_DEP_PACKAGE - TYPE SET_AS_CACHE_IN - ) - #message("\nPACKAGE_ARCH_PRIVATE_ADD_OPTIONAL_PACKAGE_ENABLE: ${PACKAGE_NAME} ${OPTIONAL_DEP_PACKAGE}") +# Macro to enable subpackage tests and examples based on parent package tests +# and examples enables +# +macro(tribits_apply_subpackage_tests_examples_enables parentPackageName) + # Set default for ${parentPackageName}_ENABLE_EXAMPLES=OFF if tests disabled + if ( ("${${parentPackageName}_ENABLE_EXAMPLES}" STREQUAL "") + AND ${parentPackageName}_ENABLE_TESTS + ) + message("-- " "Setting" + " ${parentPackageName}_ENABLE_EXAMPLES=${${parentPackageName}_ENABLE_TESTS}" + " because" + " ${parentPackageName}_ENABLE_TESTS=${${parentPackageName}_ENABLE_TESTS}") + set(${parentPackageName}_ENABLE_EXAMPLES ${${parentPackageName}_ENABLE_TESTS}) + endif() + # Set defaults for _ENABLE_[TESTS|EXAMPLES] + set(parentEnableExamples ${${parentPackageName}_ENABLE_EXAMPLES}) + set(parentEnableTests ${${parentPackageName}_ENABLE_TESTS}) + foreach(subpkgName IN LISTS ${parentPackageName}_SUBPACKAGES) + set(fullSpkgName ${parentPackageName}${subpkgName}) + if (${PROJECT_NAME}_ENABLE_${fullSpkgName}) + if (parentEnableTests AND ("${${fullSpkgName}_ENABLE_TESTS}" STREQUAL "")) + message("-- " "Setting" + " ${fullSpkgName}_ENABLE_TESTS=${parentEnableTests}" + " because parent package" + " ${parentPackageName}_ENABLE_TESTS=${parentEnableTests}") + set(${fullSpkgName}_ENABLE_TESTS ${parentEnableTests}) + endif() + if (parentEnableExamples AND ("${${fullSpkgName}_ENABLE_EXAMPLES}" STREQUAL "")) + message("-- " "Setting" + " ${fullSpkgName}_ENABLE_EXAMPLES=${parentEnableExamples}" + " because parent package" + " ${parentPackageName}_ENABLE_EXAMPLES=${parentEnableExamples}") + set(${fullSpkgName}_ENABLE_EXAMPLES ${parentEnableExamples}) + endif() + endif() + endforeach() +endmacro() +# NOTE: Above, the parent package may not actually be enabled yet +# (i.e. ${PROJECT_NAME}_ENABLE_${parentPackageName} my not be TRUE) if only +# subpackages needed to be enabled in the forward sweep but we want the tests +# and examples for a subpackage to be enabled if the tests and examples for +# the parent package, respectfully, are enabled. - if (SET_AS_CACHE_IN) - multiline_set(DOCSTR - "Enable optional ${TYPE} support in the package ${PACKAGE_NAME}" - " for the package ${OPTIONAL_DEP_PACKAGE}." - " Set to 'ON', 'OFF', or leave empty" - " to allow for other logic to decide." - ) +# Macro that enables upstream (required and optional) packages for a given +# package +# +macro(tribits_enable_upstream_packages packageName) - set_cache_on_off_empty( ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE} "" - ${DOCSTR} ) + if (${PROJECT_NAME}_ENABLE_${packageName}) - else() + foreach(depPkg IN LISTS ${packageName}_LIB_DEFINED_DEPENDENCIES) + tribits_private_enable_dep_package(${packageName} ${depPkg} LIB) + endforeach() - if (NOT DEFINED ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}) - set( ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE} "" ) - endif() + foreach(depPkg IN LISTS ${packageName}_TEST_DEFINED_DEPENDENCIES) + tribits_private_enable_dep_package(${packageName} ${depPkg} TEST) + endforeach() endif() endmacro() +# NOTE: The above macro has a defect. It is enabling upstream test dependent +# packages even if tests nor examples are not enabled (see +# TriBITSPub/TriBITS#56). But fixing this will break backward compatibility +# and therefore require upgrading the packages that currently only work +# correctly because of this defect. -macro(tribits_private_add_optional_tpl_enable PACKAGE_NAME OPTIONAL_DEP_TPL - TYPE SET_AS_CACHE_IN ) - - if (SET_AS_CACHE_IN) - - multiline_set(DOCSTR - "Enable optional ${TYPE} support in the package ${PACKAGE_NAME}" - " for the TPL ${OPTIONAL_DEP_TPL}." - " Set to 'ON', 'OFF', or leave empty" - " to allow for other logic to decide." - ) +# Macro that post-processes optional dependencies after all other +# dependencies have been worked out +# +macro(tribits_postprocess_optional_package_enables packageName) - set_cache_on_off_empty( ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL} "" - ${DOCSTR} ) + if (${PROJECT_NAME}_ENABLE_${packageName}) - else() + foreach(depPkg ${${packageName}_LIB_DEFINED_DEPENDENCIES}) + tribits_private_postprocess_optional_package_enable( + ${packageName} ${depPkg} ) + endforeach() - if (NOT DEFINED ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}) - set( ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL} "" ) - endif() + foreach(depPkg ${${packageName}_TEST_DEFINED_DEPENDENCIES}) + tribits_private_postprocess_optional_package_enable( + ${packageName} ${depPkg} ) + endforeach() endif() endmacro() +# NOTE: Above, it is harmless to process required dependencies as well so we +# leave of the if () statement based on +# ${packageName}_[LIB|TEST]_DEP_REQUIRED_${depPkg}. # Macro that sets cache vars for optional package interdependencies @@ -494,70 +713,89 @@ endmacro() # This also will set ${PACKAGE_NAME}_ENABLE_TESTS and # ${PACKAGE_NAME}_ENABLE_EXAMPLES to empty non-cache vars # -macro(tribits_set_up_optional_package_enables_and_cache_vars PACKAGE_NAME) - - #message("\nPACKAGE_ARCH_ADD_OPTIONAL_PACKAGE_ENABLES: ${PACKAGE_NAME}") +macro(tribits_setup_optional_package_enables_and_cache_vars packageName) - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - set(SET_AS_CACHE ${${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}}) + assert_defined(${PROJECT_NAME}_ENABLE_${packageName}) + set(setAsCacheVar ${${PROJECT_NAME}_ENABLE_${packageName}}) - if (SET_AS_CACHE) + if (setAsCacheVar) - multiline_set(DOCSTR - "Build tests for the package ${PACKAGE_NAME}. Set to 'ON', 'OFF', or leave empty ''" + multiline_set(docStr + "Build tests for the package ${packageName}. Set to 'ON', 'OFF', or leave empty ''" " to allow for other logic to decide." ) - set_cache_on_off_empty( ${PACKAGE_NAME}_ENABLE_TESTS "" ${DOCSTR} ) + set_cache_on_off_empty( ${packageName}_ENABLE_TESTS "" ${docStr} ) - multiline_set(DOCSTR - "Build examples for the package ${PACKAGE_NAME}. Set to 'ON', 'OFF', or leave empty ''" + multiline_set(docStr + "Build examples for the package ${packageName}. Set to 'ON', 'OFF', or leave empty ''" " to allow for other logic to decide." ) - set_cache_on_off_empty( ${PACKAGE_NAME}_ENABLE_EXAMPLES "" ${DOCSTR} ) + set_cache_on_off_empty( ${packageName}_ENABLE_EXAMPLES "" ${docStr} ) - multiline_set(DOCSTR - "Build examples for the package ${PACKAGE_NAME}. Set to 'ON', 'OFF', or leave empty ''" + multiline_set(docStr + "Build examples for the package ${packageName}. Set to 'ON', 'OFF', or leave empty ''" " to allow for other logic to decide." ) - set( ${PACKAGE_NAME}_SKIP_CTEST_ADD_TEST - "${${PROJECT_NAME}_SKIP_CTEST_ADD_TEST}" CACHE BOOL ${DOCSTR} ) + set( ${packageName}_SKIP_CTEST_ADD_TEST + "${${PROJECT_NAME}_SKIP_CTEST_ADD_TEST}" CACHE BOOL ${docStr} ) else() - if (NOT DEFINED ${PACKAGE_NAME}_ENABLE_TESTS) - set( ${PACKAGE_NAME}_ENABLE_TESTS "" ) + if (NOT DEFINED ${packageName}_ENABLE_TESTS) + set( ${packageName}_ENABLE_TESTS "" ) endif() - if (NOT DEFINED ${PACKAGE_NAME}_ENABLE_EXAMPLES) - set( ${PACKAGE_NAME}_ENABLE_EXAMPLES "" ) + if (NOT DEFINED ${packageName}_ENABLE_EXAMPLES) + set( ${packageName}_ENABLE_EXAMPLES "" ) endif() endif() - foreach(OPTIONAL_DEP_PACKAGE ${${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES}) + foreach(optDepPkg ${${packageName}_LIB_DEFINED_DEPENDENCIES}) tribits_private_add_optional_package_enable( - ${PACKAGE_NAME} ${OPTIONAL_DEP_PACKAGE} "library" "${SET_AS_CACHE}" ) + ${packageName} ${optDepPkg} "library" "${setAsCacheVar}" ) endforeach() - foreach(OPTIONAL_DEP_PACKAGE ${${PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES}) + foreach(optDepPkg ${${packageName}_TEST_DEFINED_DEPENDENCIES}) tribits_private_add_optional_package_enable( - ${PACKAGE_NAME} ${OPTIONAL_DEP_PACKAGE} "test" "${SET_AS_CACHE}" ) - endforeach() - - foreach(OPTIONAL_DEP_TPL ${${PACKAGE_NAME}_LIB_OPTIONAL_DEP_TPLS}) - tribits_private_add_optional_tpl_enable( - ${PACKAGE_NAME} ${OPTIONAL_DEP_TPL} "library" "${SET_AS_CACHE}" ) - endforeach() - - foreach(OPTIONAL_DEP_TPL ${${PACKAGE_NAME}_TEST_OPTIONAL_DEP_TPLS}) - tribits_private_add_optional_tpl_enable( - ${PACKAGE_NAME} ${OPTIONAL_DEP_TPL} "test" "${SET_AS_CACHE}" ) + ${packageName} ${optDepPkg} "test" "${setAsCacheVar}" ) endforeach() endmacro() -# Macro that sets up the flat list of direct package dependencies and enabled -# package dependencies and sets ${packageName}_ENABLE_${depPkg} for LIB +# Macro that enables a the top-level parent package enable if any of its +# subpackages are enabled. +# +macro(tribits_enable_parent_package_for_subpackage_enables toplevelPackageName) + foreach(tap2_subPkgName IN LISTS ${toplevelPackageName}_SUBPACKAGES) + set(subpkgFullName ${toplevelPackageName}${tap2_subPkgName}) + if (${PROJECT_NAME}_ENABLE_${subpkgFullName} + AND (NOT ${PROJECT_NAME}_ENABLE_${toplevelPackageName}) + ) + message("-- " + "Setting ${PROJECT_NAME}_ENABLE_${toplevelPackageName}=ON" + " because ${PROJECT_NAME}_ENABLE_${subpkgFullName}=ON") + set(${PROJECT_NAME}_ENABLE_${toplevelPackageName} ON) + tribits_set_parent_package_subpackage_enable_for_enabled_subpackages( + ${toplevelPackageName}) + tribits_set_parent_package_test_example_enable_for_enabled_subpackages( + ${toplevelPackageName} TESTS) + tribits_set_parent_package_test_example_enable_for_enabled_subpackages( + ${toplevelPackageName} EXAMPLES) + # NOTE: Above, we need to enable the parent package even if it was + # disabled by some means before this. (There are use cases where the + # parent package my be disabled but that may not trigger the disable of + # subpackages of that package.) Other logic should ensure that the + # parent package is never explicitly disabled and a subpackage is + # allowed to be enabled. + break() # We only need trigger above code for single enabled subpackage! + endif() + endforeach() +endmacro() + + +# Macro that sets up the flat list of direct package dependencies and enabled +# package dependencies and sets ${packageName}_ENABLE_${depPkg} for LIB # dependencies # # This makes it easy to just loop over all of the direct upstream dependencies @@ -565,17 +803,11 @@ endmacro() # # NOTES: # -# * ${packageName}_LIB_DEFINED_DEPENDENCIES will be set regardless if -# ${packageName} is enabled or not. -# # * ${packageName}_LIB_ENABLED_DEPENDENCIES is only set if ${packageName} is # enabled and will only contain the names of direct library upstream # internal and external packages ${depPkg} that are required or are # optional and ${packageName}_ENABLE_${depPkg} is set to ON. # -# * ${packageName}_TEST_DEFINED_DEPENDENCIES will be set regardless if -# ${packageName} is enabled or not. -# # * ${packageName}_TEST_ENABLED_DEPENDENCIES is only set if ${packageName} is # enabled and will only contain the names of direct test/example upstream # internal and external packages ${depPkg} that are required or are @@ -589,1196 +821,387 @@ endmacro() # packages where only the shell of the parent package is enabled and not # all of its required subpackages are enabled. # -macro(tribits_setup_direct_package_dependencies_lists_and_lib_required_enable_vars - packageName - ) +macro(tribits_setup_enabled_dependencies_lists_and_enable_vars packageName) - # LIB dependencies + tribits_get_package_enable_status(${packageName} packageEnable packageEnableVar) - set(${packageName}_LIB_DEFINED_DEPENDENCIES "") set(${packageName}_LIB_ENABLED_DEPENDENCIES "") - - foreach(depPkg ${${packageName}_LIB_REQUIRED_DEP_PACKAGES}) - list(APPEND ${packageName}_LIB_DEFINED_DEPENDENCIES ${depPkg}) - if (${PROJECT_NAME}_ENABLE_${packageName} AND ${PROJECT_NAME}_ENABLE_${depPkg}) - set(${packageName}_ENABLE_${depPkg} ON) - list(APPEND ${packageName}_LIB_ENABLED_DEPENDENCIES ${depPkg}) - endif() - endforeach() - # See below NOTE about required subpackage dependencies not being enabled in - # some cases! - - foreach(depPkg ${${packageName}_LIB_OPTIONAL_DEP_PACKAGES}) - list(APPEND ${packageName}_LIB_DEFINED_DEPENDENCIES ${depPkg}) - if (${PROJECT_NAME}_ENABLE_${packageName} AND ${packageName}_ENABLE_${depPkg}) - list(APPEND ${packageName}_LIB_ENABLED_DEPENDENCIES ${depPkg}) - endif() - endforeach() - - foreach(depPkg ${${packageName}_LIB_REQUIRED_DEP_TPLS}) - list(APPEND ${packageName}_LIB_DEFINED_DEPENDENCIES ${depPkg}) - if (${PROJECT_NAME}_ENABLE_${packageName}) - set(${packageName}_ENABLE_${depPkg} ON) - list(APPEND ${packageName}_LIB_ENABLED_DEPENDENCIES ${depPkg}) - endif() - endforeach() - - foreach(depPkg ${${packageName}_LIB_OPTIONAL_DEP_TPLS}) - list(APPEND ${packageName}_LIB_DEFINED_DEPENDENCIES ${depPkg}) - if (${PROJECT_NAME}_ENABLE_${packageName} AND ${packageName}_ENABLE_${depPkg}) - list(APPEND ${packageName}_LIB_ENABLED_DEPENDENCIES ${depPkg}) + foreach(depPkg IN LISTS ${packageName}_LIB_DEFINED_DEPENDENCIES) + tribits_get_package_enable_status(${depPkg} depPkgEnable depPkgEnableVar) + if (${packageName}_LIB_DEP_REQUIRED_${depPkg}) + if (packageEnable AND depPkgEnable) + set(${packageName}_ENABLE_${depPkg} ON) + # See below NOTE about required subpackage dependencies not being + # enabled in some cases + list(APPEND ${packageName}_LIB_ENABLED_DEPENDENCIES ${depPkg}) + endif() + else() + if (packageEnable AND ${packageName}_ENABLE_${depPkg}) + list(APPEND ${packageName}_LIB_ENABLED_DEPENDENCIES ${depPkg}) + endif() endif() endforeach() - # TEST dependencies - - set(${packageName}_TEST_DEFINED_DEPENDENCIES "") set(${packageName}_TEST_ENABLED_DEPENDENCIES "") - - if (${PROJECT_NAME}_ENABLE_${packageName} - AND - (${packageName}_ENABLE_TESTS OR ${packageName}_ENABLE_EXAMPLES) - ) - set(enablePkgAndTestsOrExamples ON) - else() - set(enablePkgAndTestsOrExamples OFF) + if (packageEnable AND (${packageName}_ENABLE_TESTS OR ${packageName}_ENABLE_EXAMPLES)) + foreach(depPkg IN LISTS ${packageName}_TEST_DEFINED_DEPENDENCIES) + if (${packageName}_TEST_DEP_REQUIRED_${depPkg}) + list(APPEND ${packageName}_TEST_ENABLED_DEPENDENCIES ${depPkg}) + else() + if (${packageName}_ENABLE_${depPkg}) + list(APPEND ${packageName}_TEST_ENABLED_DEPENDENCIES ${depPkg}) + endif() + endif() + endforeach() endif() - foreach(depPkg ${${packageName}_TEST_REQUIRED_DEP_PACKAGES}) - list(APPEND ${packageName}_TEST_DEFINED_DEPENDENCIES ${depPkg}) - if (enablePkgAndTestsOrExamples) - list(APPEND ${packageName}_TEST_ENABLED_DEPENDENCIES ${depPkg}) - endif() - endforeach() - - foreach(depPkg ${${packageName}_TEST_OPTIONAL_DEP_PACKAGES}) - list(APPEND ${packageName}_TEST_DEFINED_DEPENDENCIES ${depPkg}) - if (enablePkgAndTestsOrExamples AND ${packageName}_ENABLE_${depPkg}) - list(APPEND ${packageName}_TEST_ENABLED_DEPENDENCIES ${depPkg}) - endif() - endforeach() - - foreach(depPkg ${${packageName}_TEST_REQUIRED_DEP_TPLS}) - list(APPEND ${packageName}_TEST_DEFINED_DEPENDENCIES ${depPkg}) - if (enablePkgAndTestsOrExamples) - list(APPEND ${packageName}_TEST_ENABLED_DEPENDENCIES ${depPkg}) - endif() - endforeach() - - foreach(depPkg ${${packageName}_TEST_OPTIONAL_DEP_TPLS}) - list(APPEND ${packageName}_TEST_DEFINED_DEPENDENCIES ${depPkg}) - if (enablePkgAndTestsOrExamples AND ${packageName}_ENABLE_${depPkg}) - list(APPEND ${packageName}_TEST_ENABLED_DEPENDENCIES ${depPkg}) - endif() - endforeach() - endmacro() # NOTE: Above, a required dependency of an enabled package may not actually be -# enabled if it is a required subpackage of a parent package and the parent -# package was not actually enabled due to a dependency but the shell of the -# parent package was only enabled at the very end. This is one of the more -# confusing aspects of the TriBITS dependency system. +# enabled if the upstream depPkg is a required subpackage of a parent package +# and the parent package was not actually enabled due to a dependency, but +# instead, only the shell of the parent package was enabled at the very end +# (in tribits_do_final_parent_packages_enables_for_subpackage_enables()). +# This is one of the more confusing aspects of the TriBITS dependency system. # Function to print the direct package dependency lists # function(tribits_print_direct_package_dependencies_lists packageName) - set(PRINTED_VAR "") message("") - print_nonempty_var_with_spaces(${packageName}_LIB_ENABLED_DEPENDENCIES PRINTED_VAR) - print_var_with_spaces(${packageName}_LIB_DEFINED_DEPENDENCIES PRINTED_VAR) - print_nonempty_var_with_spaces(${packageName}_TEST_ENABLED_DEPENDENCIES PRINTED_VAR) - print_nonempty_var_with_spaces(${packageName}_TEST_DEFINED_DEPENDENCIES PRINTED_VAR) + set(printedVar "") + tribits_print_nonempty_package_deps_list(${packageName} LIB ENABLED printedVar) + tribits_print_nonempty_package_deps_list(${packageName} TEST ENABLED printedVar) + if (NOT printedVar) + message("-- ${packageName}: No enabled dependencies!") + endif() endfunction() + +################################################################################ # -# Private helper macros +# Third and lower-level macros called indirectly from +# ``tribits_adjust_package_enables()`` # +################################################################################ -# Enable optional intra-package support for enabled target package -# ${PACKAGE_NAME} (i.e. ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} is assumed to -# be TRUE before calling this macro. +# Only turn off ${fwdDepPkgName} libraries or test/examples if it is currently +# enabled or could be enabled # -macro(tribits_private_postprocess_optional_package_enable PACKAGE_NAME OPTIONAL_DEP_PACKAGE) - - #message("TRIBITS_PRIVATE_POSTPROCESS_OPTIONAL_PACKAGE_ENABLE: ${PACKAGE_NAME} ${OPTIONAL_DEP_PACKAGE}") - #print_var(${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}) - #print_var(${PROJECT_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}) - - if (${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE} AND ${PROJECT_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}) - message("-- " "NOTE:" - " ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}=${${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}}" - " is already set!") - elseif ("${${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}}" STREQUAL "") - if (${PROJECT_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}) - message("-- " "Setting ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}=ON" - " since ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}=ON AND" - " ${PROJECT_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}=ON") - set(${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE} ON) +macro(tribits_private_disable_required_package_enables + fwdDepPkgName packageName libraryDep + ) + tribits_get_package_enable_status(${fwdDepPkgName} "" fwdDepPkgEnableVarName) + if (${fwdDepPkgEnableVarName} OR "${${fwdDepPkgEnableVarName}}" STREQUAL "") + if ("${libraryDep}" STREQUAL "TRUE") + tribits_private_print_disable_required_package_enable( + ${packageName} ${fwdDepPkgEnableVarName} + ${fwdDepPkgName} "library" ) + set(${fwdDepPkgEnableVarName} OFF) else() - message("-- " "NOT setting ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}=ON" - " since ${OPTIONAL_DEP_PACKAGE} is NOT enabled at this point!") - endif() - elseif (NOT "${${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}}" STREQUAL "" - AND NOT ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE} - AND ${PROJECT_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE} - ) - message("-- " "NOTE: ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}=${${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}}" - " is already set so not enabling even though ${PROJECT_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}=${${PROJECT_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}} is set!") - endif() - - string(TOUPPER ${PACKAGE_NAME} PACKAGE_NAME_UPPER) - string(TOUPPER ${OPTIONAL_DEP_PACKAGE} OPTIONAL_DEP_PACKAGE_UPPER) - set(MACRO_DEFINE_NAME HAVE_${PACKAGE_NAME_UPPER}_${OPTIONAL_DEP_PACKAGE_UPPER}) + set(depTypeStr "test/example") + if (${fwdDepPkgName}_ENABLE_TESTS + OR "${${fwdDepPkgName}_ENABLE_TESTS}" STREQUAL "" + ) + tribits_private_print_disable_required_package_enable( + ${packageName} ${fwdDepPkgName}_ENABLE_TESTS + ${fwdDepPkgName} "${depTypeStr}" ) + set(${fwdDepPkgName}_ENABLE_TESTS OFF) + endif() - if(${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_PACKAGE}) - set(${MACRO_DEFINE_NAME} ON) - else() - set(${MACRO_DEFINE_NAME} OFF) + if (${fwdDepPkgName}_ENABLE_EXAMPLES + OR "${${fwdDepPkgName}_ENABLE_EXAMPLES}" STREQUAL "" + ) + tribits_private_print_disable_required_package_enable( + ${packageName} ${fwdDepPkgName}_ENABLE_EXAMPLES + ${fwdDepPkgName} "${depTypeStr}" ) + set(${fwdDepPkgName}_ENABLE_EXAMPLES OFF) + endif() + endif() endif() - endmacro() +function(tribits_private_print_disable_required_package_enable + packageName packageEnableSomethingVarName fwdDepPkgName + depTypeStr + ) + tribits_private_print_disable( + ${packageEnableSomethingVarName} ${fwdDepPkgName} + "${depTypeStr}" "package" ${packageName} ) +endfunction() -# Enable optional intra-package support for enabled target package -# ${PACKAGE_NAME} (i.e. ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} is assumed to -# be TRUE before calling this macro. -# -macro(tribits_private_postprocess_optional_tpl_enable PACKAGE_NAME OPTIONAL_DEP_TPL) - - #message("TRIBITS_PRIVATE_POSTPROCESS_OPTIONAL_TPL_ENABLE: ${PACKAGE_NAME} ${OPTIONAL_DEP_TPL}") - - if (${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL} AND TPL_ENABLE_${OPTIONAL_DEP_TPL}) - message("-- " "NOTE:" - " ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}=${${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}}" - " is already set!") - elseif ( - (NOT TPL_ENABLE_${OPTIONAL_DEP_TPL}) - AND - (NOT "${TPL_ENABLE_${OPTIONAL_DEP_TPL}}" STREQUAL "") - AND - ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL} - ) - message( - "\n***" - "\n*** NOTE: Setting ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}=OFF" - " which was ON since TPL_ENABLE_${OPTIONAL_DEP_TPL}=OFF" - "\n***\n" - ) - set(${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL} OFF) - elseif ("${${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}}" STREQUAL "" - AND TPL_ENABLE_${OPTIONAL_DEP_TPL} - ) - message("-- " "Setting ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}=ON" - " since TPL_ENABLE_${OPTIONAL_DEP_TPL}=ON") - set(${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL} ON) - elseif (NOT "${${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}}" STREQUAL "" - AND NOT ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL} - AND TPL_ENABLE_${OPTIONAL_DEP_TPL} - ) - message("-- " "NOTE: ${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}=${${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}}" - " is already set so not enabling even though TPL_ENABLE_${OPTIONAL_DEP_TPL}=${TPL_ENABLE_${OPTIONAL_DEP_TPL}} is set!") - endif() - - string(TOUPPER ${PACKAGE_NAME} PACKAGE_NAME_UPPER) - string(TOUPPER ${OPTIONAL_DEP_TPL} OPTIONAL_DEP_TPL_UPPER) - set(MACRO_DEFINE_NAME HAVE_${PACKAGE_NAME_UPPER}_${OPTIONAL_DEP_TPL_UPPER}) - if (${PACKAGE_NAME}_ENABLE_${OPTIONAL_DEP_TPL}) - set(${MACRO_DEFINE_NAME} ON) +function(tribits_private_print_disable + packageBeingDisabledVarName packageWithSomethingBeingDisabledName + depTypeStr thingBeingDisabledType thingBeingDisabledName + ) + if (${packageBeingDisabledVarName}) + if (${PROJECT_NAME}_DISABLE_ENABLED_FORWARD_DEP_PACKAGES) + message( + " ***\n" + " *** NOTE: Setting ${packageBeingDisabledVarName}=OFF" + " which was '${${packageBeingDisabledVarName}}' because" + " ${packageWithSomethingBeingDisabledName} has" + " a required ${depTypeStr} dependence on disabled" + " ${thingBeingDisabledType} ${thingBeingDisabledName}" + " but ${PROJECT_NAME}_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON!\n" + " ***\n" + ) + else() + message(FATAL_ERROR + " ***\n" + " *** ERROR: Setting ${packageBeingDisabledVarName}=OFF" + " which was '${${packageBeingDisabledVarName}}' because" + " ${packageWithSomethingBeingDisabledName} has" + " a required ${depTypeStr} dependence on disabled" + " ${thingBeingDisabledType} ${thingBeingDisabledName}!\n" + " ***\n" + ) + endif() else() - set(${MACRO_DEFINE_NAME} OFF) - endif() - -endmacro() - - -# Macro that post-processes optional dependencies after all other -# dependencies have been worked out -# -macro(tribits_postprocess_optional_package_enables PACKAGE_NAME) - - #message("\nPACKAGE_ARCH_POSTPROCESS_OPTIONAL_PACKAGE_ENABLES: ${PACKAGE_NAME}") - - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - foreach(OPTIONAL_DEP_PACKAGE ${${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES}) - tribits_private_postprocess_optional_package_enable( - ${PACKAGE_NAME} ${OPTIONAL_DEP_PACKAGE} ) - endforeach() - - foreach(OPTIONAL_DEP_PACKAGE ${${PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES}) - tribits_private_postprocess_optional_package_enable( - ${PACKAGE_NAME} ${OPTIONAL_DEP_PACKAGE} ) - endforeach() - + message("-- " + "Setting ${packageBeingDisabledVarName}=OFF" + " because ${packageWithSomethingBeingDisabledName} has a required ${depTypeStr}" + " dependence on disabled ${thingBeingDisabledType} ${thingBeingDisabledName}") endif() +endfunction() -endmacro() - - -# Macro that post-processes final package enables for packages with subpackage -# enables. -# -macro(tribits_postprocess_package_with_subpackages_enables PACKAGE_NAME) - #message("TRIBITS_POSTPROCESS_PACKAGE_WITH_SUBPACKAGES_ENABLES '${PACKAGE_NAME}'") - foreach(TRIBITS_SUBPACKAGE ${${PACKAGE_NAME}_SUBPACKAGES}) - set(SUBPACKAGE_FULLNAME ${PACKAGE_NAME}${TRIBITS_SUBPACKAGE}) - #print_var(${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}) - #print_var(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - #print_var(${SUBPACKAGE_FULLNAME}_ENABLE_TESTS) - #print_var(${PACKAGE_NAME}_ENABLE_TESTS) - #print_var(${SUBPACKAGE_FULLNAME}_ENABLE_EXAMPLES) - #print_var(${PACKAGE_NAME}_ENABLE_EXAMPLES) - if (${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME} - AND NOT ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} - ) - message("-- " - "Setting ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}=ON" - " because ${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}=ON") - set(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} ON) - tribits_postprocess_package_with_subpackages_optional_subpackage_enables( - ${PACKAGE_NAME}) - tribits_postprocess_package_with_subpackages_test_example_enables( - ${PACKAGE_NAME} TESTS) - tribits_postprocess_package_with_subpackages_test_example_enables( - ${PACKAGE_NAME} EXAMPLES) - # NOTE: We need to enable the parent package even if it was disabled by - # some means before this because a subpackage is enabled. But other - # logic should ensure that the parent package is never disabled and a - # subpackage is allowed to be enabled. - endif() - endforeach() -endmacro() +macro(tribits_private_disable_optional_package_enables fwdDepPkgName packageName) -# Set _ENABLE_=ON if not already enabled for all -# subpackages of a parent package. -# -macro(tribits_postprocess_package_with_subpackages_optional_subpackage_enables - PACKAGE_NAME - ) - #message("TRIBITS_POSTPROCESS_PACKAGE_WITH_SUBPACKAGES_TEST_EXAMPLE_ENABLES '${PACKAGE_NAME}'") - foreach(TRIBITS_SUBPACKAGE ${${PACKAGE_NAME}_SUBPACKAGES}) - set(SUBPACKAGE_FULLNAME ${PACKAGE_NAME}${TRIBITS_SUBPACKAGE}) - if (${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME} - AND "${${PACKAGE_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}}" STREQUAL "" - ) - message("-- " - "Setting ${PACKAGE_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}=ON" - " because ${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}=ON") - set(${PACKAGE_NAME}_ENABLE_${SUBPACKAGE_FULLNAME} ON) + if (${fwdDepPkgName}_ENABLE_${packageName} + OR "${${fwdDepPkgName}_ENABLE_${packageName}}" STREQUAL "" + ) + # Always disable the conditional enable but only print the message if the + # package is enabled or if a disable overrides an enable + if (${PROJECT_NAME}_ENABLE_${fwdDepPkgName}) + if (${fwdDepPkgName}_ENABLE_${packageName}) # is explicitly enabled already! + message("-- " + "NOTE: Setting ${fwdDepPkgName}_ENABLE_${packageName}=OFF" + " which was ${${fwdDepPkgName}_ENABLE_${packageName}}" + " because ${fwdDepPkgName} has an optional library dependence" + " on disabled package ${packageName}") + else() # Not explicitly set + message("-- " + "Setting ${fwdDepPkgName}_ENABLE_${packageName}=OFF" + " because ${fwdDepPkgName} has an optional library dependence" + " on disabled package ${packageName}") + endif() endif() - endforeach() -endmacro() - - -# Set the parent package tests/examples enables if one subpackage is enabled -# and has its tests/examples -# -macro(tribits_postprocess_package_with_subpackages_test_example_enables - PACKAGE_NAME TESTS_OR_EXAMPLES - ) - #message("TRIBITS_POSTPROCESS_PACKAGE_WITH_SUBPACKAGES_TEST_EXAMPLE_ENABLES '${PACKAGE_NAME}'") - foreach(TRIBITS_SUBPACKAGE ${${PACKAGE_NAME}_SUBPACKAGES}) - set(SUBPACKAGE_FULLNAME ${PACKAGE_NAME}${TRIBITS_SUBPACKAGE}) - #print_var(${PROJECT_NAME}_ENABLE_${SUBPACKAGE_FULLNAME}) - #print_var(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - #print_var(${SUBPACKAGE_FULLNAME}_ENABLE_${TESTS_OR_EXAMPLES}) - #print_var(${PACKAGE_NAME}_ENABLE_${TESTS_OR_EXAMPLES}) - #print_var(${SUBPACKAGE_FULLNAME}_ENABLE_EXAMPLES) - #print_var(${PACKAGE_NAME}_ENABLE_EXAMPLES) - if (${SUBPACKAGE_FULLNAME}_ENABLE_${TESTS_OR_EXAMPLES} - AND "${${PACKAGE_NAME}_ENABLE_${TESTS_OR_EXAMPLES}}" STREQUAL "" + if (${fwdDepPkgName}_ENABLE_${packageName} + AND (NOT ${PROJECT_NAME}_ENABLE_${packageName}) + AND (NOT "${${PROJECT_NAME}_ENABLE_${packageName}}" STREQUAL "") ) - message("-- " - "Setting ${PACKAGE_NAME}_ENABLE_${TESTS_OR_EXAMPLES}=ON" - " because ${SUBPACKAGE_FULLNAME}_ENABLE_${TESTS_OR_EXAMPLES}=ON") - set(${PACKAGE_NAME}_ENABLE_${TESTS_OR_EXAMPLES} ON) + message("-- " "NOTE: ${fwdDepPkgName}_ENABLE_${packageName}=" + "${${fwdDepPkgName}_ENABLE_${packageName}} but" + " ${PROJECT_NAME}_ENABLE_${packageName}=" + "${${PROJECT_NAME}_ENABLE_${packageName}} is set. Setting" + " ${fwdDepPkgName}_ENABLE_${packageName}=OFF!") endif() - endforeach() -endmacro() - - -# Post-processes optional package TPL based on if the TPL -# has been enabled or not -# -macro(tribits_postprocess_optional_tpl_enables PACKAGE_NAME) - - #message("\nPACKAGE_ARCH_ADD_OPTIONAL_TPL_ENABLES: ${PACKAGE_NAME}") - - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - foreach(OPTIONAL_DEP_TPL ${${PACKAGE_NAME}_LIB_OPTIONAL_DEP_TPLS}) - tribits_private_postprocess_optional_tpl_enable( - ${PACKAGE_NAME} ${OPTIONAL_DEP_TPL} ) - endforeach() - - foreach(OPTIONAL_DEP_TPL ${${PACKAGE_NAME}_TEST_OPTIONAL_DEP_TPLS}) - tribits_private_postprocess_optional_tpl_enable( - ${PACKAGE_NAME} ${OPTIONAL_DEP_TPL} ) - endforeach() - + set(${fwdDepPkgName}_ENABLE_${packageName} OFF) endif() endmacro() -# Set an individual package variable enable variable (to on or off) based on a +# Set an individual package variable enable variable (to ON or OFF) based on a # global enable value # -macro(tribits_set_package_enable_based_on_global_enable projectEnableVar +macro(tribits_set_package_enable_based_on_project_enable projectEnableVar packageEnableVar ) - if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message("") - message("TRIBITS_SET_PACKAGE_ENABLE_BASED_ON_GLOBAL_ENABLE:") - message("-- " "${projectEnableVar} = ${${projectEnableVar}}") - message("-- " "${packageEnableVar} = ${${packageEnableVar}}") - endif() - if ("${${packageEnableVar}}" STREQUAL "") if (${projectEnableVar}) message("-- " "Setting ${packageEnableVar}=ON") set(${packageEnableVar} ON) - elseif ( - (NOT ${projectEnableVar}) - AND - (NOT "${projectEnableVar}" STREQUAL "") + elseif ( (NOT ${projectEnableVar}) + AND (NOT "${projectEnableVar}" STREQUAL "") ) message("-- " "Setting ${packageEnableVar}=OFF") set(${packageEnableVar} OFF) else() - if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message("-- " "ELSE") - # Otherwise, we will leave it up the the individual package - # to decide? - endif() + # Otherwise, we will leave it up the the individual package + # to decide? endif() else() - if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message("-- " "${packageEnableVar} NOT DEFAULT") - endif() - endif() - - if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message("-- " "${packageEnableVar} = ${${packageEnableVar}}") + # "${packageEnableVar} not at the default empty '' endif() endmacro() -# Set an individual package test or examples enable to on only if global enable var is on +# Set an individual package test or examples enable to on only if global +# enable var is on # -macro(tribits_set_package_enable_based_on_global_enable_on projectEnableVar +macro(tribits_set_package_enable_based_on_project_enable_on projectEnableVar packageEnableVar ) - if ("${${packageEnableVar}}" STREQUAL "") - if (${projectEnableVar}) - message("-- " "Setting ${packageEnableVar}=ON") - set(${packageEnableVar} ON) - endif() + if (("${${packageEnableVar}}" STREQUAL "") AND ${projectEnableVar}) + message("-- " "Setting ${packageEnableVar}=ON") + set(${packageEnableVar} ON) endif() endmacro() -# Macro used to set ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} based on -# ${PROJECT_NAME}_ENABLE_ALL_PACKAGES -# -macro(tribits_apply_all_package_enables PACKAGE_NAME) - tribits_is_primary_meta_project_package(${PACKAGE_NAME} PACKAGE_IS_PMPP) - tribits_implicit_package_enable_is_allowed( "" ${PACKAGE_NAME} - PROCESS_PACKAGE_ENABLE ) - if (PACKAGE_IS_PMPP AND PROCESS_PACKAGE_ENABLE) - tribits_set_package_enable_based_on_global_enable( - ${PROJECT_NAME}_ENABLE_ALL_PACKAGES ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} ) +macro(tribits_private_enable_dep_package packageName depPkgName libOrTest) + tribits_get_package_enable_status(${depPkgName} depPkgEnable depPkgEnableVar) + if (depPkgEnable) + #message("The package is already enabled so there is nothing to enable!") + elseif (${depPkgEnableVar} STREQUAL "") + set(tpedp_enableDepPkg "") + if (${packageName}_${libOrTest}_DEP_REQUIRED_${depPkgName}) + message("-- " "Setting ${depPkgEnableVar}=ON" + " because ${packageName} has a required dependence on ${depPkgName}") + set(tpedp_enableDepPkg ON) + elseif (${packageName}_ENABLE_${depPkgName}) + # Enable the upstream package if the user directly specified the + # optional package enable regardless if it is PT or ST or even EX. + message("-- " "Setting ${depPkgEnableVar}=ON" + " because ${packageName}_ENABLE_${depPkgName}=ON") + set(tpedp_enableDepPkg ON) + elseif (${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES) + # Enable the package if there is an optional dependence and we are asked + # to enabled optional dependencies. + tribits_implicit_package_enable_is_allowed(${packageName} ${depPkgName} + allowImplicitEnable) + if (allowImplicitEnable) + message("-- " "Setting ${depPkgEnableVar}=ON" + " because ${packageName} has an optional dependence on ${depPkgName}") + set(tpedp_enableDepPkg ON) + endif() + endif() + # Enable the upstream package + if (tpedp_enableDepPkg) + set(${depPkgEnableVar} ON) + set(${depPkgName}_ENABLING_PKG ${packageName}) + endif() endif() endmacro() -# Macro used to set ${TRIBITS_PACKAGE)_ENABLE_TESTS and ${TRIBITS_PACKAGE)_ENABLE_EXAMPLES -# based on ${PROJECT_NAME}_ENABLE_TESTS and ${PROJECT_NAME}_ENABLE_EXAMPLES +# Enable optional intra-package support for enabled target package +# ${packageName} (i.e. ${PROJECT_NAME}_ENABLE_${packageName} is assumed to +# be TRUE before calling this macro. # -macro(tribits_apply_test_example_enables PACKAGE_NAME) - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - tribits_is_primary_meta_project_package(${PACKAGE_NAME} PACKAGE_IS_PMPP) - if (PACKAGE_IS_PMPP) - tribits_set_package_enable_based_on_global_enable_on( - ${PROJECT_NAME}_ENABLE_TESTS ${PACKAGE_NAME}_ENABLE_TESTS ) - tribits_set_package_enable_based_on_global_enable_on( - ${PROJECT_NAME}_ENABLE_EXAMPLES ${PACKAGE_NAME}_ENABLE_EXAMPLES ) - endif() - endif() -endmacro() +macro(tribits_private_postprocess_optional_package_enable packageName optDepPkg) + tribits_get_package_enable_status(${optDepPkg} optDepPkgEnable optDepPkgEnableVar) + tribits_get_package_enable_status(${packageName} packageEnable packageEnableVar) -# Macro to disable ${PARENT_PACKAGE_NAME)_ENABLE_ENABLES by default if -# ${PARENT_PACKAGE_NAME)_ENABLE_TESTS is explicitly disabled. -# -macro(tribits_apply_package_examples_disable PARENT_PACKAGE_NAME) - if (NOT "${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}" STREQUAL "" - AND NOT ${PARENT_PACKAGE_NAME}_ENABLE_TESTS - AND "${${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES}" STREQUAL "" + if (${packageName}_ENABLE_${optDepPkg} AND optDepPkgEnable) + message("-- " "NOTE:" + " ${packageName}_ENABLE_${optDepPkg}=${${packageName}_ENABLE_${optDepPkg}}" + " is already set!") + elseif ("${${packageName}_ENABLE_${optDepPkg}}" STREQUAL "") + if (optDepPkgEnable) + message("-- " "Setting ${packageName}_ENABLE_${optDepPkg}=ON" + " since ${packageEnableVar}=ON AND" + " ${optDepPkgEnableVar}=ON") + set(${packageName}_ENABLE_${optDepPkg} ON) + else() + message("-- " "NOT setting ${packageName}_ENABLE_${optDepPkg}=ON" + " since ${optDepPkg} is NOT enabled at this point!") + endif() + elseif ((NOT "${${packageName}_ENABLE_${optDepPkg}}" STREQUAL "") + AND (NOT ${packageName}_ENABLE_${optDepPkg}) + AND optDepPkgEnable ) - message("-- " "Setting" - " ${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES" - "=${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}" - " because" - " ${PARENT_PACKAGE_NAME}_ENABLE_TESTS" - "=${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}" ) - set(${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES ${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}) + message("-- " "NOTE: ${packageName}_ENABLE_${optDepPkg}=" + "${${packageName}_ENABLE_${optDepPkg}} is already set so not enabling even" + " though ${optDepPkgEnableVar}=" + "${optDepPkgEnable} is set!") endif() -endmacro() -# NOTE: Above, the top-level package ${PARENT_PACKAGE_NAME} may not even be -# enabled yet when this gets called but its subpackages might and we need to -# process this default disable in case their are any enabled subpackages. + string(TOUPPER ${packageName} packageName_UPPER) + string(TOUPPER ${optDepPkg} optDepPkg_UPPER) + set(macroDefineName HAVE_${packageName_UPPER}_${optDepPkg_UPPER}) -# Macro to disable ${TRIBITS_SUBPACKAGE)_ENABLE_TESTS and -# ${TRIBITS_SUBPACKAGE)_ENABLE_EXAMPLES based on -# ${TRIBITS_PARENTPACKAGE)_ENABLE_TESTS or -# ${TRIBITS_PARENTPACKAGE)_ENABLE_EXAMPLES -# -macro(tribits_apply_subpackage_tests_or_examples_disables PARENT_PACKAGE_NAME - TESTS_OR_EXAMPLES - ) - set(parentPkgEnableVar ${PARENT_PACKAGE_NAME}_ENABLE_${TESTS_OR_EXAMPLES}) - if (NOT "${${parentPkgEnableVar}}" STREQUAL "" AND NOT ${parentPkgEnableVar}) - foreach(spkg IN LISTS ${PARENT_PACKAGE_NAME}_SUBPACKAGES) - set(fullSpkgName ${PARENT_PACKAGE_NAME}${spkg}) - if (${PROJECT_NAME}_ENABLE_${fullSpkgName} AND NOT ${parentPkgEnableVar}) - if ("${${fullSpkgName}_ENABLE_${TESTS_OR_EXAMPLES}}" STREQUAL "") - message("-- " "Setting" - " ${fullSpkgName}_ENABLE_${TESTS_OR_EXAMPLES}=${${parentPkgEnableVar}}" - " because parent package" - " ${parentPkgEnableVar}=${${parentPkgEnableVar}}") - set(${fullSpkgName}_ENABLE_${TESTS_OR_EXAMPLES} ${${parentPkgEnableVar}}) - endif() - endif() - endforeach() + if(${packageName}_ENABLE_${optDepPkg}) + set(${macroDefineName} ON) + else() + set(${macroDefineName} OFF) endif() + endmacro() -# Macro to enable ${TRIBITS_SUBPACKAGE)_ENABLE_TESTS and -# ${TRIBITS_SUBPACKAGE)_ENABLE_EXAMPLES based on -# ${TRIBITS_PARENTPACKAGE)_ENABLE_TESTS or -# ${TRIBITS_PARENTPACKAGE)_ENABLE_EXAMPLES -# -macro(tribits_apply_subpackage_tests_examples_enables PARENT_PACKAGE_NAME) - if ("${${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES}" STREQUAL "" - AND ${PARENT_PACKAGE_NAME}_ENABLE_TESTS - ) - message("-- " "Setting" - " ${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES=${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}" - " because" - " ${PARENT_PACKAGE_NAME}_ENABLE_TESTS=${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}") - set(${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES ${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}) +macro(tribits_private_enable_forward_package fwdDepPkgName packageName) + tribits_implicit_package_enable_is_allowed( "" ${fwdDepPkgName} allowFwdDepPkgEnable) + if ("${${PROJECT_NAME}_ENABLE_${fwdDepPkgName}}" STREQUAL "" AND allowFwdDepPkgEnable) + message("-- " "Setting ${PROJECT_NAME}_ENABLE_${fwdDepPkgName}=ON" + " because ${PROJECT_NAME}_ENABLE_${packageName}=ON") + set(${PROJECT_NAME}_ENABLE_${fwdDepPkgName} ON) endif() - foreach(spkg IN LISTS ${PARENT_PACKAGE_NAME}_SUBPACKAGES) - set(fullSpkgName ${PARENT_PACKAGE_NAME}${spkg}) - if (${PROJECT_NAME}_ENABLE_${fullSpkgName}) - if (${PARENT_PACKAGE_NAME}_ENABLE_TESTS) - if ("${${fullSpkgName}_ENABLE_TESTS}" STREQUAL "") - message("-- " "Setting" - " ${fullSpkgName}_ENABLE_TESTS=${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}" - " because parent package" - " ${PARENT_PACKAGE_NAME}_ENABLE_TESTS" - "=${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}") - set(${fullSpkgName}_ENABLE_TESTS ${${PARENT_PACKAGE_NAME}_ENABLE_TESTS}) - endif() - endif() - if (${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES) - if ("${${fullSpkgName}_ENABLE_EXAMPLES}" STREQUAL "") - message("-- " "Setting" - " ${fullSpkgName}_ENABLE_EXAMPLES=${${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES}" - " because parent package" - " ${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES" - "=${${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES}") - set(${fullSpkgName}_ENABLE_EXAMPLES ${${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES}) - endif() - endif() - endif() - endforeach() endmacro() -# NOTE: Above, the parent package may not actually be enabled yet -# (i.e. ${PROJECT_NAME}_ENABLE_${PARENT_PACKAGE_NAME} my not be TRUE) if only -# subpackages needed to be enabled in the forward sweep but we want the tests -# and examples for subpackage to be enabled if -# ${PARENT_PACKAGE_NAME}_ENABLE_TESTS=ON or just examples i -# f${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES=ON -macro(tribits_private_enable_forward_package FORWARD_DEP_PACKAGE_NAME PACKAGE_NAME) - tribits_implicit_package_enable_is_allowed( "" ${FORWARD_DEP_PACKAGE_NAME} - ALLOW_PACKAGE_ENABLE ) - assert_defined(${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME}) - if("${${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME}}" STREQUAL "" - AND ALLOW_PACKAGE_ENABLE - ) - message("-- " "Setting ${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME}=ON" - " because ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}=ON") - assert_defined(${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME}) - set(${PROJECT_NAME}_ENABLE_${FORWARD_DEP_PACKAGE_NAME} ON) - endif() -endmacro() +macro(tribits_private_add_optional_package_enable packageName optionalDepPkgName + libraryOrTest setAsCacheVar + ) + if (setAsCacheVar) -# Macro used to set ${PROJECT_NAME}_ENABLE_${FWD_PACKAGE_NAME)=ON for all -# -macro(tribits_enable_forward_lib_package_enables PACKAGE_NAME) + multiline_set(docStr + "Enable optional ${libraryOrTest} support in the package ${packageName}" + " for the package ${optionalDepPkgName}." + " Set to 'ON', 'OFF', or leave empty" + " to allow for other logic to decide." + ) - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) + set_cache_on_off_empty( ${packageName}_ENABLE_${optionalDepPkgName} "" + ${docStr} ) - foreach(FWD_DEP_PKG ${${PACKAGE_NAME}_FORWARD_LIB_REQUIRED_DEP_PACKAGES}) - tribits_private_enable_forward_package(${FWD_DEP_PKG} ${PACKAGE_NAME}) - endforeach() + else() - foreach(FWD_DEP_PKG ${${PACKAGE_NAME}_FORWARD_LIB_OPTIONAL_DEP_PACKAGES}) - tribits_private_enable_forward_package(${FWD_DEP_PKG} ${PACKAGE_NAME}) - endforeach() + if (NOT DEFINED ${packageName}_ENABLE_${optionalDepPkgName}) + set(${packageName}_ENABLE_${optionalDepPkgName} "" ) + endif() endif() endmacro() -# Macro used to set ${PROJECT_NAME}_ENABLE_${FWD_PACKAGE_NAME)=ON for all -# optional and required forward test dependencies of the package -# ${PACKAGE_NAME} +# Macro that sets ``_ENABLE_=ON`` if not already +# enabled for all enabled subpackages of a parent package. # -macro(tribits_enable_forward_test_package_enables PACKAGE_NAME) - - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - foreach(FWD_DEP_PKG ${${PACKAGE_NAME}_FORWARD_TEST_REQUIRED_DEP_PACKAGES}) - tribits_private_enable_forward_package(${FWD_DEP_PKG} ${PACKAGE_NAME}) - endforeach() - - foreach(FWD_DEP_PKG ${${PACKAGE_NAME}_FORWARD_TEST_OPTIONAL_DEP_PACKAGES}) - tribits_private_enable_forward_package(${FWD_DEP_PKG} ${PACKAGE_NAME}) - endforeach() - - endif() - +macro(tribits_set_parent_package_subpackage_enable_for_enabled_subpackages + toplevelPackageName + ) + foreach(tap3_subPkg IN LISTS ${toplevelPackageName}_SUBPACKAGES) + set(subpkgFullName ${toplevelPackageName}${tap3_subPkg}) + if (${PROJECT_NAME}_ENABLE_${subpkgFullName} + AND "${${toplevelPackageName}_ENABLE_${subpkgFullName}}" STREQUAL "" + ) + message("-- " + "Setting ${toplevelPackageName}_ENABLE_${subpkgFullName}=ON" + " because ${PROJECT_NAME}_ENABLE_${subpkgFullName}=ON") + set(${toplevelPackageName}_ENABLE_${subpkgFullName} ON) + endif() + endforeach() endmacro() +# Macro that sets ``_ENABLE_[TESTS|EXAMPLES]=ON`` if subpackage +# is enabled and has its tests/examples are enabled. # -# Private helper macros -# - - -macro(tribits_private_enable_dep_package PACKAGE_NAME DEP_PACKAGE_NAME - OPTREQ_IN +macro(tribits_set_parent_package_test_example_enable_for_enabled_subpackages + toplevelPackageName testOrExamples ) + foreach(tap3_subPkg IN LISTS ${toplevelPackageName}_SUBPACKAGES) + set(subpkgFullName ${toplevelPackageName}${tap3_subPkg}) + if (${subpkgFullName}_ENABLE_${testOrExamples} + AND "${${toplevelPackageName}_ENABLE_${testOrExamples}}" STREQUAL "" + ) + message("-- " + "Setting ${toplevelPackageName}_ENABLE_${testOrExamples}=ON" + " because ${subpkgFullName}_ENABLE_${testOrExamples}=ON") + set(${toplevelPackageName}_ENABLE_${testOrExamples} ON) + endif() + endforeach() +endmacro() - #message("TRIBITS_PRIVATE_ENABLE_DEP_PACKAGE: '${PACKAGE_NAME}' '${DEP_PACKAGE_NAME}' '${OPTREQ_IN}'") - - assert_defined(${PROJECT_NAME}_ENABLE_${DEP_PACKAGE_NAME}) - #print_var(${PACKAGE_NAME}_ENABLE_${DEP_PACKAGE_NAME}) - - if (${PROJECT_NAME}_ENABLE_${DEP_PACKAGE_NAME}) - #message("The package is already enabled so there is nothing to enable!") - - elseif (${PROJECT_NAME}_ENABLE_${DEP_PACKAGE_NAME} STREQUAL "") - - set(TRIBITS_PRIVATE_ENABLE_DEP_PACKAGES_ENABLE_PACKAGE "") - - if ("${OPTREQ_IN}" STREQUAL "REQUIRED") - - #message("Always enable the upstream dependency if it is required") - - message("-- " "Setting ${PROJECT_NAME}_ENABLE_${DEP_PACKAGE_NAME}=ON" - " because ${PACKAGE_NAME} has a required dependence on ${DEP_PACKAGE_NAME}") - - set(TRIBITS_PRIVATE_ENABLE_DEP_PACKAGES_ENABLE_PACKAGE ON) - - elseif (${PACKAGE_NAME}_ENABLE_${DEP_PACKAGE_NAME}) - - # Enable the upstream package if the user directly specified the - # optional package enable regardless if it is PT or ST or even EX. - - message("-- " "Setting ${PROJECT_NAME}_ENABLE_${DEP_PACKAGE_NAME}=ON" - " because ${PACKAGE_NAME}_ENABLE_${DEP_PACKAGE_NAME}=ON") - - set(TRIBITS_PRIVATE_ENABLE_DEP_PACKAGES_ENABLE_PACKAGE ON) - - elseif (${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES) - - # Enable the package if there is an optional dependence and we are asked - # to enabled optional dependencies. - - tribits_implicit_package_enable_is_allowed(${PACKAGE_NAME} ${DEP_PACKAGE_NAME} - ALLOW_IMPLICIT_ENABLE) - if (ALLOW_IMPLICIT_ENABLE) - message("-- " "Setting ${PROJECT_NAME}_ENABLE_${DEP_PACKAGE_NAME}=ON" - " because ${PACKAGE_NAME} has an optional dependence on ${DEP_PACKAGE_NAME}") - set(TRIBITS_PRIVATE_ENABLE_DEP_PACKAGES_ENABLE_PACKAGE ON) - endif() - - endif() - - # Enable the upstream package - if (TRIBITS_PRIVATE_ENABLE_DEP_PACKAGES_ENABLE_PACKAGE) - assert_defined(${PROJECT_NAME}_ENABLE_${DEP_PACKAGE_NAME}) - set(${PROJECT_NAME}_ENABLE_${DEP_PACKAGE_NAME} ON) - endif() - - endif() - -endmacro() - - -macro(tribits_private_enable_dep_tpl PACKAGE_NAME DEP_TPL_NAME) - assert_defined(TPL_ENABLE_${DEP_TPL_NAME}) - if(TPL_ENABLE_${DEP_TPL_NAME} STREQUAL "") - message("-- " "Setting TPL_ENABLE_${DEP_TPL_NAME}=ON because" - " it is required by the enabled package ${PACKAGE_NAME}") - assert_defined(TPL_ENABLE_${DEP_TPL_NAME}) - set(TPL_ENABLE_${DEP_TPL_NAME} ON) - set(TPL_${DEP_TPL_NAME}_ENABLING_PKG ${PACKAGE_NAME}) - endif() -endmacro() - - -macro(tribits_private_enable_optional_dep_tpl PACKAGE_NAME DEP_TPL_NAME) - #assert_defined(${PACKAGE_NAME}_ENABLE_${DEP_TPL_NAME}) - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} - AND ${PACKAGE_NAME}_ENABLE_${DEP_TPL_NAME} - AND TPL_ENABLE_${DEP_TPL_NAME} STREQUAL "" - ) - message("-- " "Setting TPL_ENABLE_${DEP_TPL_NAME}=ON because" - " ${PACKAGE_NAME}_ENABLE_${DEP_TPL_NAME}=ON") - assert_defined(TPL_ENABLE_${DEP_TPL_NAME}) - set(TPL_ENABLE_${DEP_TPL_NAME} ON) - endif() -endmacro() - - -# Macro that enables the optional TPLs for given package -# -macro(tribits_enable_optional_tpls PACKAGE_NAME) - - #message("TRIBITS_ENABLE_OPTIONAL_TPLS: ${PACKAGE_NAME}") - #message("-- " "${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}=${${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}}") - - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - foreach(DEP_TPL ${${PACKAGE_NAME}_LIB_OPTIONAL_DEP_TPLS}) - tribits_private_enable_optional_dep_tpl(${PACKAGE_NAME} ${DEP_TPL}) - endforeach() - - foreach(DEP_TPL ${${PACKAGE_NAME}_TEST_OPTIONAL_DEP_TPLS}) - tribits_private_enable_optional_dep_tpl(${PACKAGE_NAME} ${DEP_TPL}) - endforeach() - - endif() - -endmacro() - - -# Macro that enables upstream (required and optional) packages given package -# -# Here I have to enable the required packages too or the logic just does no -# work as expected. -# -macro(tribits_enable_upstream_packages PACKAGE_NAME) - - #message("TRIBITS_ENABLE_UPSTREAM_PACKAGES: ${PACKAGE_NAME}") - #message("-- " "${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}=${${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}}") - - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - foreach(DEP_PKG ${${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES}) - tribits_private_enable_dep_package(${PACKAGE_NAME} ${DEP_PKG} REQUIRED) - endforeach() - - foreach(DEP_PKG ${${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES}) - tribits_private_enable_dep_package(${PACKAGE_NAME} ${DEP_PKG} OPTIONAL) - endforeach() - - foreach(DEP_PKG ${${PACKAGE_NAME}_TEST_REQUIRED_DEP_PACKAGES}) - tribits_private_enable_dep_package(${PACKAGE_NAME} ${DEP_PKG} REQUIRED) - endforeach() - - foreach(DEP_PKG ${${PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES}) - tribits_private_enable_dep_package(${PACKAGE_NAME} ${DEP_PKG} OPTIONAL) - endforeach() - - endif() - -endmacro() - - -# Macro that sets the required TPLs for given package -# -macro(tribits_enable_required_tpls PACKAGE_NAME) - - #message("PACKAGE_ARCH_ENABLE_REQUIRED_TPL_ENABLES: ${PACKAGE_NAME}") - #message("-- " "${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}=${${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}}") - - assert_defined(${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - if (${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) - - foreach(DEP_TPL ${${PACKAGE_NAME}_LIB_REQUIRED_DEP_TPLS}) - tribits_private_enable_dep_tpl(${PACKAGE_NAME} ${DEP_TPL}) - endforeach() - - foreach(DEP_TPL ${${PACKAGE_NAME}_TEST_REQUIRED_DEP_TPLS}) - tribits_private_enable_dep_tpl(${PACKAGE_NAME} ${DEP_TPL}) - endforeach() - - endif() - -endmacro() - - -# @MACRO: tribits_adjust_package_enables() -# -# Usage: -# -# tribits_adjust_package_enables() -# -# Macro that adjusts all of the package enables from what the user input to -# the final set that will be used to enable packages. -# -macro(tribits_adjust_package_enables) - - if (${PROJECT_NAME}_UNENABLE_ENABLED_PACKAGES) - message("") - message("Setting to empty '' all enabled packages on request ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) - if (${PROJECT_NAME}_ENABLE_${TRIBITS_PACKAGE}) - set_cache_on_off_empty(${PROJECT_NAME}_ENABLE_${TRIBITS_PACKAGE} "" - "Forced to empty '' by ${PROJECT_NAME}_UNENABLE_ENABLED_PACKAGES=ON" FORCE) - set(${PROJECT_NAME}_ENABLE_${TRIBITS_PACKAGE} "") - endif() - #print_var(${PROJECT_NAME}_ENABLE_${TRIBITS_PACKAGE}) - # NOTE: Above, we don't want to set to empty those packages that have hard - # disables because this will mess up the logic in later invocations. - endforeach() - advanced_set(${PROJECT_NAME}_UNENABLE_ENABLED_PACKAGES OFF CACHE BOOL - "Forced to FALSE after use" FORCE) - endif() - - # - # A) Sweep forward through and apply all disables first! - # - - tribits_get_nondisabled_list( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} - ${PROJECT_NAME}_NOTDISABLED_PACKAGES "") - - message("") - message("Disabling all packages that have a required dependency" - " on disabled TPLs and optional package TPL support based on TPL_ENABLE_=OFF ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_NOTDISABLED_PACKAGES}) - tribits_disable_package_if_tpl_disabled(${TRIBITS_PACKAGE}) - endforeach() - - message("") - message("Disabling subpackages for hard disables of parent packages" - " due to ${PROJECT_NAME}_ENABLE_=OFF ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) - tribits_disable_parents_subpackages(${TRIBITS_PACKAGE}) - endforeach() - - message("") - message("Disabling forward required packages and optional intra-package" - " support that have a dependency on disabled packages" - " ${PROJECT_NAME}_ENABLE_=OFF ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) - tribits_disable_forward_required_dep_packages(${TRIBITS_PACKAGE}) - endforeach() - - tribits_get_nondisabled_list( ${PROJECT_NAME}_NOTDISABLED_PACKAGES ${PROJECT_NAME} - ${PROJECT_NAME}_NOTDISABLED_PACKAGES "") - - set(${PROJECT_NAME}_REVERSE_NOTDISABLED_PACKAGES - "${${PROJECT_NAME}_NOTDISABLED_PACKAGES}") - list(REVERSE ${PROJECT_NAME}_REVERSE_NOTDISABLED_PACKAGES) - - # - # B) Apply all forward enables - # - - message("") - message("Enabling subpackages for hard enables of parent packages" - " due to ${PROJECT_NAME}_ENABLE_=ON ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_NOTDISABLED_PACKAGES}) - tribits_enable_parents_subpackages(${TRIBITS_PACKAGE}) - endforeach() - - if (${PROJECT_NAME}_ENABLE_ALL_PACKAGES) - message("") - message("Enabling all packages that are not currently disabled because of" - " ${PROJECT_NAME}_ENABLE_ALL_PACKAGES=ON" - " (${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE=${${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE})" - " ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_NOTDISABLED_PACKAGES}) - tribits_apply_all_package_enables(${TRIBITS_PACKAGE}) - endforeach() - endif() - - if (${PROJECT_NAME}_ENABLE_ALL_FORWARD_DEP_PACKAGES) - message("") - message("Sweep forward enabling all forward library dependent packages because" - " ${PROJECT_NAME}_ENABLE_ALL_FORWARD_DEP_PACKAGES=ON ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_NOTDISABLED_PACKAGES}) - tribits_enable_forward_lib_package_enables(${TRIBITS_PACKAGE}) - endforeach() - message("") - message("Sweep backward enabling all forward test dependent packages because" - " ${PROJECT_NAME}_ENABLE_ALL_FORWARD_DEP_PACKAGES=ON ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_REVERSE_NOTDISABLED_PACKAGES}) - tribits_enable_forward_test_package_enables(${TRIBITS_PACKAGE}) - endforeach() - # NOTE: Above, we want to sweep backward to enable test-dependent packages - # because we don't want to enable package Z just because package Y was enabled - # because it had a test-only dependency on package X. Sweeping backwards through - # the packages makes sure this does not happen. - set(${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES ON) - endif() - - tribits_get_enabled_list( ${PROJECT_NAME}_NOTDISABLED_PACKAGES ${PROJECT_NAME} - ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") - - # - # C) Disable and enable tests for currently enabled packages - # - - message("") - message("Disabling subpackage tests/examples based on parent package tests/examples disables ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES}) - tribits_apply_package_examples_disable(${TRIBITS_PACKAGE} TESTS) - tribits_apply_subpackage_tests_or_examples_disables(${TRIBITS_PACKAGE} TESTS) - tribits_apply_subpackage_tests_or_examples_disables(${TRIBITS_PACKAGE} EXAMPLES) - endforeach() - - if (${PROJECT_NAME}_ENABLE_TESTS OR ${PROJECT_NAME}_ENABLE_EXAMPLES) - message("") - message("Enabling all tests and/or examples that have not been" - " explicitly disabled because ${PROJECT_NAME}_ENABLE_[TESTS,EXAMPLES]=ON ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}) - tribits_apply_test_example_enables(${TRIBITS_PACKAGE}) - endforeach() - endif() - # NOTE: Above, we enable tests and examples here, before the remaining required - # packages so that we don't enable tests that don't need to be enabled based - # on the use of the option ${PROJECT_NAME}_ENABLE_ALL_FORWARD_DEP_PACKAGES. - - message("") - message("Enabling subpackage tests/examples based on parent package tests/examples enables ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES}) - tribits_apply_subpackage_tests_examples_enables(${TRIBITS_PACKAGE}) - endforeach() - # NOTE: We want to apply this logic here instead of later after the backward - # sweep of package enables because we don't want to enable the - # tests/examples for a subpackage if it is not needed based on set of - # requested subpackages and packages to be enabled and the optional forward - # sweep of downstream packages. - - # - # D) Sweep backwards and enable upstream required and optional packages - # - - if (${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES) - set(EXTRA_MSG_STR " (and optional since ${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES=ON)") - else() - set(EXTRA_MSG_STR "") - endif() - - message("") - message("Enabling all required${EXTRA_MSG_STR} upstream packages for current set of" - " enabled packages" - " (${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE=${${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE})" - " ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_REVERSE_NOTDISABLED_PACKAGES}) - tribits_enable_upstream_packages(${TRIBITS_PACKAGE}) - endforeach() - # NOTE: Above, we have to loop through the packages backward to enable all - # the packages that feed into these packages. This has to include *all* - # upstream package enables including required packages, optional packages - # (when ${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES), and packages - - tribits_get_enabled_list( ${PROJECT_NAME}_NOTDISABLED_PACKAGES ${PROJECT_NAME} - ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES "") - - message("") - message("Enabling all optional intra-package enables _ENABLE_" - " that are not currently disabled if both sets of packages are enabled ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}) - tribits_postprocess_optional_package_enables(${TRIBITS_PACKAGE}) - endforeach() - - # - # E) Enable TPLs - # - - message("") - message("Enabling all remaining required TPLs for current set of" - " enabled packages ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}) - tribits_enable_required_tpls(${TRIBITS_PACKAGE}) - endforeach() - - message("") - message("Enabling all optional package TPL support" - " _ENABLE_ not currently disabled for" - " enabled TPLs ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}) - tribits_postprocess_optional_tpl_enables(${TRIBITS_PACKAGE}) - endforeach() - - message("") - message("Enabling TPLs based on _ENABLE_=ON if TPL is not explicitly disabled ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}) - tribits_enable_optional_tpls(${TRIBITS_PACKAGE}) - endforeach() - # NOTE: We need to do this after the above optional package TPL support - # logic so that the TPL will be turned on for this package only as requested - # in bug 4298. - - # - # F) Set user cache variables for current set of enabled packages - # - - message("") - message("Set cache entries for optional packages/TPLs and tests/examples for packages actually enabled ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}) - tribits_set_up_optional_package_enables_and_cache_vars(${TRIBITS_PACKAGE}) - endforeach() - - # - # G) Turn on parent packages where at least one subpackage has been enabled - # - - message("") - message("Enabling the shell of non-enabled parent packages (mostly for show) that have at least one subpackage enabled ...") - message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES}) - tribits_postprocess_package_with_subpackages_enables(${TRIBITS_PACKAGE}) - endforeach() - # NOTE: The above ensures that loops involving the parent package will - # process the parent package but doing this last ensures that no downstream - # dependencies will be enabled. - - tribits_set_up_enabled_lists_and_pkg_idx() - - # - # H) Set up flat list of direct external and inner package dependencies (even - # for non-enabled packages) and enabled package dependencies for enabled - # packages - # - - foreach(externalPkgName ${${PROJECT_NAME}_DEFINED_TPLS}) - tribits_extpkg_setup_enabled_dependencies(${externalPkgName}) - # ToDo: Assert that all of the listed dependencies in - # ${externalPkgName}_LIB_ENABLED_DEPENDENCIES exist and are upstream from - # ${externalPkgName} - endforeach() - - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) - tribits_setup_direct_package_dependencies_lists_and_lib_required_enable_vars( - ${TRIBITS_PACKAGE}) - endforeach() - - if (${PROJECT_NAME}_DUMP_PACKAGE_DEPENDENCIES) - message("\nDumping direct dependencies for each package ...") - foreach(tribitsPkg IN LISTS ${PROJECT_NAME}_DEFINED_TPLS - ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES - ) - tribits_print_direct_package_dependencies_lists(${tribitsPkg}) - endforeach() - endif() - -endmacro() - - -# Function that sets up the full package dependencies for each enabled package -# including all of its indirect upstream package dependencies. -# -# This is needed in several different parts of the TriBITS implementation. -# -# ToDo: #63: Remove this function since we should not need a full list of -# direct and indirect package dependencies! -# -function(tribits_package_set_full_enabled_dep_packages PACKAGE_NAME) - - set(PACKAGE_FULL_DEPS_LIST "") - - foreach(DEP_PKG ${${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES}) - if (${PROJECT_NAME}_ENABLE_${DEP_PKG}) - list(APPEND PACKAGE_FULL_DEPS_LIST ${DEP_PKG}) - endif() - # NOTE: This if() should not be needed but this is a safeguard - endforeach() - - foreach(DEP_PKG ${${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES}) - if (${PACKAGE_NAME}_ENABLE_${DEP_PKG}) - list(APPEND PACKAGE_FULL_DEPS_LIST ${DEP_PKG}) - endif() - endforeach() - - if(PACKAGE_FULL_DEPS_LIST) - list(REMOVE_DUPLICATES PACKAGE_FULL_DEPS_LIST) - - foreach(DEP_PACKAGE ${PACKAGE_FULL_DEPS_LIST}) - list(APPEND PACKAGE_FULL_DEPS_LIST ${${DEP_PACKAGE}_FULL_ENABLED_DEP_PACKAGES}) - endforeach() - - list(REMOVE_DUPLICATES PACKAGE_FULL_DEPS_LIST) - endif() - - set(ORDERED_PACKAGE_FULL_DEPS_LIST "") - - foreach(DEP_PACKAGE ${PACKAGE_FULL_DEPS_LIST}) - - #print_var(${DEP_PACKAGE}_PKG_IDX) - set(DEP_PACKAGE_VALUE ${${DEP_PACKAGE}_PKG_IDX}) - - set(SORTED_INDEX 0) - set(INSERTED_DEP_PACKAGE FALSE) - - foreach(SORTED_PACKAGE ${ORDERED_PACKAGE_FULL_DEPS_LIST}) - - #print_var(${SORTED_PACKAGE}_PKG_IDX) - set(SORTED_PACKAGE_VALUE ${${SORTED_PACKAGE}_PKG_IDX}) - - if (${DEP_PACKAGE_VALUE} GREATER ${SORTED_PACKAGE_VALUE}) - list(INSERT ORDERED_PACKAGE_FULL_DEPS_LIST ${SORTED_INDEX} ${DEP_PACKAGE}) - set(INSERTED_DEP_PACKAGE TRUE) - break() - endif() - - math(EXPR SORTED_INDEX ${SORTED_INDEX}+1) - - endforeach() - - if(NOT INSERTED_DEP_PACKAGE) - list(APPEND ORDERED_PACKAGE_FULL_DEPS_LIST ${DEP_PACKAGE}) - endif() - - endforeach() - - global_set(${PACKAGE_NAME}_FULL_ENABLED_DEP_PACKAGES - ${ORDERED_PACKAGE_FULL_DEPS_LIST}) - - if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - print_var(${PACKAGE_NAME}_FULL_ENABLED_DEP_PACKAGES) - endif() - -endfunction() - - -# Function that creates enable-only dependency data-structures -# -# ToDo: #63: Remove this function since we should not need a full list of -# direct and indirect package dependencies! -# -function(tribits_set_up_enabled_only_dependencies) - - set(GENERATE_EXPORT_DEPENDENCIES ${${PROJECT_NAME}_GENERATE_EXPORT_FILE_DEPENDENCIES}) - set(lastExportTribitsPackage) - - if ("${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES}" STREQUAL "" - AND NOT - "${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES}" STREQUAL "" - ) - message(DEPRECATION - "WARNING! The cache var" - " ${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES" - "='${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES}'" - " is deprecated! Please instead set" - " ${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES" - "='${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES}'") - set(${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES - ${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES} ) - endif() - - if (GENERATE_EXPORT_DEPENDENCIES - AND ${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES - ) - # Find the last enabled package for which an export file is requested. - set(LAST_PKG_IDX -1) - set(LAST_PKG) - foreach(tribitsPkg ${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES}) - #print_var(tribitsPkg) - set(PKG_IDX ${${tribitsPkg}_PKG_IDX}) - #print_var(PKG_IDX) - if (PKG_IDX) - # The listed package is enabled so we will consider it - if (PKG_IDX GREATER ${LAST_PKG_IDX}) - set(LAST_PKG_IDX ${PKG_IDX}) - set(LAST_PKG ${tribitsPkg}) - #print_var(LAST_PKG_IDX) - #print_var(LAST_PKG) - endif() - endif() - endforeach() - if (LAST_PKG) - # At least one listed package was enabled - set(lastExportTribitsPackage ${LAST_PKG}) - else() - # None of the listed packages were enabled so don't bother generating - # any export dependencies - set(GENERATE_EXPORT_DEPENDENCIES FALSE) - endif() - - endif() - - if (GENERATE_EXPORT_DEPENDENCIES) - - if (lastExportTribitsPackage) - message("\nSetting up export dependencies up through ${lastExportTribitsPackage} ...\n") - else() - message("\nSetting up export dependencies for all enabled packages ...\n") - endif() - - foreach(tribitsPackage ${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}) - tribits_package_set_full_enabled_dep_packages(${tribitsPackage}) - if (${PROJECT_NAME}_DUMP_PACKAGE_DEPENDENCIES) - set(PRINTED_VAR FALSE) - print_nonempty_var_with_spaces(${tribitsPackage}_FULL_ENABLED_DEP_PACKAGES - PRINTED_VAR) - if (NOT PRINTED_VAR) - message("-- ${tribitsPackage}: No library dependencies!") - endif() - endif() - if ("${lastExportTribitsPackage}" STREQUAL ${tribitsPackage}) - break() - endif() - endforeach() - - endif() - -endfunction() +# LocalWords: tribits TriBITS foreach endmacro endfunction diff --git a/cmake/tribits/core/package_arch/TribitsExternalPackageWriteConfigFile.cmake b/cmake/tribits/core/package_arch/TribitsExternalPackageWriteConfigFile.cmake index 2d041a2ca424..fd4adb86a9f8 100644 --- a/cmake/tribits/core/package_arch/TribitsExternalPackageWriteConfigFile.cmake +++ b/cmake/tribits/core/package_arch/TribitsExternalPackageWriteConfigFile.cmake @@ -166,8 +166,9 @@ endfunction() # @FUNCTION: tribits_extpkg_write_config_file_str() # -# Create the text string for a ``Config.cmake`` file given the list of -# include directories and libraries for an external package/TPL. +# Create the text string for a ``Config.cmake`` file given the list +# of include directories and libraries for an external package/TPL from the +# legacy TriBITS TPL specification. # # Usage:: # @@ -194,9 +195,11 @@ endfunction() # packages listed in ``_LIB_ENABLED_DEPENDENCIES``. # # The arguments in ``TPL__LIBRARIES`` are handled in special ways in -# order to create the namespaced IMPORTED targets ``::`` and -# the ``::all_libs`` target that depends on these. The types of -# arguments that are handled and how the are interpreted: +# order to create the namespaced IMPORTED targets +# ``tribits::::`` and the ``::all_libs`` target +# that depends on these. +# +# The types of arguments that are handled and how the are interpreted: # # ``/[lib].`` # @@ -204,13 +207,13 @@ endfunction() # imported target name ```` is derived from the file name (of the # form ``lib.`` removing beginning ``lib`` and file # extension ``.``). The IMPORTED target -# ``::`` is created and the file path is set using the -# ``IMPORTED_LOCATION`` target property. +# ``tribits::::`` is created and the file path is set +# using the ``IMPORTED_LOCATION`` target property. # # ``-l`` # # Arguments of the form ``-l`` are used to create IMPORTED -# targets with the name ``::`` using the +# targets with the name ``tribits::::`` using the # ``IMPORTED_LIBNAME`` target property. # # ```` @@ -248,6 +251,20 @@ endfunction() # ``_LIB_ENABLED_DEPENDENCIES``, a link dependency is created using # ``target_link_library(::all_libs INTERFACE )``. # +# NOTE: The IMPORTED targets generated for each library argument +# ``::`` are prefixed with ``tribits::`` to give +# ``tribits::::``. This is to avoid clashing with IMPORTED +# targets ``::`` from other package config files +# ``Config.cmake`` or find modules ``Find.cmake`` that may +# clash (see TriBITSPub/TriBITS#548). But the generated INTERFACE IMPORTED +# target ``::all_libs`` is **not** namespaced with ``tribits::`` +# since the ``all_libs`` target is unlikely to clash. The targets +# ``tribits::::`` are not directly used in downstream +# ``target_link_library()`` calls so the names of these targets are really +# just an implementation detail. (The reason we give these a name based of +# the library name they represent ```` is to make it more clear what +# the matching library is and to make the name unique.) +# function(tribits_extpkg_write_config_file_str tplName tplConfigFileStrOut) # A) Set up beginning of config file text @@ -529,14 +546,14 @@ function(tribits_extpkg_process_libraries_list_library_entry tribits_extpkg_get_libname_and_path_from_libentry( "${libentry}" ${libEntryType} libname libpath) # Create IMPORTED library target - set(prefixed_libname "${tplName}::${libname}") + set(prefixed_libname "tribits::${tplName}::${libname}") if (NOT (prefixed_libname IN_LIST libTargets)) tribits_extpkg_append_add_library_str (${libname} ${prefixed_libname} ${libEntryType} "${libpath}" configFileStr) if (lastLibProcessed) string(APPEND configFileStr "target_link_libraries(${prefixed_libname}\n" - " INTERFACE ${tplName}::${lastLibProcessed})\n" + " INTERFACE tribits::${tplName}::${lastLibProcessed})\n" ) else() tribits_extpkg_append_upstream_target_link_libraries_str( ${tplName} @@ -553,10 +570,11 @@ function(tribits_extpkg_process_libraries_list_library_entry set(${lastLibProcessedInOut} ${lastLibProcessed} PARENT_SCOPE) set(${configFileStrInOut} ${configFileStr} PARENT_SCOPE) endfunction() -# NOTE: Above, we only need to link the first library :: -# against the upstream TPL libraries ::all_libs. The other -# imported targets :: for this TPL are linked to this first -# :: which has the needed dependencies. +# NOTE: Above, we only need to link the first library +# tribits:::: against the upstream TPL libraries +# ::all_libs. The other imported targets +# tribits:::: for this TPL are linked to this first +# tribits:::: which has the needed dependencies. function(tribits_extpkg_get_libname_and_path_from_libentry diff --git a/cmake/tribits/core/package_arch/TribitsGeneralMacros.cmake b/cmake/tribits/core/package_arch/TribitsGeneralMacros.cmake index 9fc85539061e..0dc079655a34 100644 --- a/cmake/tribits/core/package_arch/TribitsGeneralMacros.cmake +++ b/cmake/tribits/core/package_arch/TribitsGeneralMacros.cmake @@ -42,6 +42,8 @@ include(AssertDefined) include(MessageWrapper) include(TribitsParseArgumentsHelpers) include(TribitsSortListAccordingToMasterList) +include(TribitsDeprecatedHelpers) +include(TribitsGetPackageEnableStatus) # Optionally start CMake code configure timing @@ -143,165 +145,6 @@ function(tribits_set_base_repo_dir BASE_DIR REPO_DIR BASE_REPO_DIR_OUT) endfunction() -# Get the list of explicitly enabled entries -# -# These is the list of entries in ${LISTVAR} for which: -# -# if (${ENABLED_PREFIX}_ENABLE_{ENTRY}) -# -# evaluates to true. -# -function(tribits_get_enabled_list LISTVAR ENABLED_PREFIX - ENABLED_LIST_OUT_OUT NUM_ENABLED_OUT_OUT - ) - set(ENABLED_LIST_OUT) - foreach(ENTITY ${${LISTVAR}}) - set(ENTITY_NAME ${ENABLED_PREFIX}_ENABLE_${ENTITY}) - assert_defined(${ENTITY_NAME}) - set(INCLUDE_ENTITY FALSE) - if (${ENTITY_NAME}) - list(APPEND ENABLED_LIST_OUT ${ENTITY}) - endif() - endforeach() - list(LENGTH ENABLED_LIST_OUT NUM_ENABLED_OUT) - set(${ENABLED_LIST_OUT_OUT} ${ENABLED_LIST_OUT} PARENT_SCOPE) - if (NUM_ENABLED_OUT_OUT) - set(${NUM_ENABLED_OUT_OUT} ${NUM_ENABLED_OUT} PARENT_SCOPE) - endif() -endfunction() - - -# Get the list non-disabled entries -# -# These is the list of entries in ${LISTVAR} for which: -# -# if ( -# (${ENABLED_PREFIX}_ENABLE_{ENTRY}) -# OR -# (${ENABLED_PREFIX}_ENABLE_{ENTRY} STREQUAL "" ) -# ) -# -# evaluates to true. -# -function(tribits_get_nondisabled_list LISTVAR ENABLED_PREFIX - NONDISABLED_LIST_OUT_OUT NUM_NONDISABLED_OUT_OUT - ) - set(NONDISABLED_LIST_OUT) - foreach(ENTITY ${${LISTVAR}}) - set(ENTITY_NAME ${ENABLED_PREFIX}_ENABLE_${ENTITY}) - assert_defined(${ENTITY_NAME}) - set(INCLUDE_ENTITY FALSE) - if (${ENTITY_NAME} OR ${ENTITY_NAME} STREQUAL "") - list(APPEND NONDISABLED_LIST_OUT ${ENTITY}) - endif() - endforeach() - list(LENGTH NONDISABLED_LIST_OUT NUM_NONDISABLED_OUT) - set(${NONDISABLED_LIST_OUT_OUT} ${NONDISABLED_LIST_OUT} PARENT_SCOPE) - if (NUM_NONDISABLED_OUT_OUT) - set(${NUM_NONDISABLED_OUT_OUT} ${NUM_NONDISABLED_OUT} PARENT_SCOPE) - endif() -endfunction() - - -# Get the list of explicitly disabled entries -# -# These is the list of entries in ${LISTVAR} for which: -# -# if ( -# (NOT ${ENABLED_PREFIX}_ENABLE_{ENTRY}) -# AND -# (NOT ${ENABLED_PREFIX}_ENABLE_{ENTRY} STREQUAL "" ) -# ) -# -# evaluates to true. -# -function(tribits_get_disabled_list LISTVAR ENABLED_PREFIX - DISABLED_LIST_OUT_OUT NUM_DISABLED_OUT_OUT - ) - set(DISABLED_LIST_OUT) - foreach(ENTITY ${${LISTVAR}}) - set(ENTITY_NAME ${ENABLED_PREFIX}_ENABLE_${ENTITY}) - assert_defined(${ENTITY_NAME}) - set(INCLUDE_ENTITY FALSE) - if ( (NOT ${ENTITY_NAME}) AND (NOT ${ENTITY_NAME} STREQUAL "") ) - list(APPEND DISABLED_LIST_OUT ${ENTITY}) - endif() - endforeach() - list(LENGTH DISABLED_LIST_OUT NUM_DISABLED_OUT) - set(${DISABLED_LIST_OUT_OUT} ${DISABLED_LIST_OUT} PARENT_SCOPE) - if (NUM_DISABLED_OUT_OUT) - set(${NUM_DISABLED_OUT_OUT} ${NUM_DISABLED_OUT} PARENT_SCOPE) - endif() -endfunction() - - -# Get the list of non-enabled entries -# -# These is the list of entries in ${LISTVAR} for which: -# -# if (NOT ${ENABLED_PREFIX}_ENABLE_{ENTRY}) -# -# evaluates to true. -# -function(tribits_get_nonenabled_list LISTVAR ENABLED_PREFIX - NONENABLED_LIST_OUT_OUT NUM_NONENABLED_OUT_OUT - ) - set(NONENABLED_LIST_OUT) - foreach(ENTITY ${${LISTVAR}}) - set(ENTITY_NAME ${ENABLED_PREFIX}_ENABLE_${ENTITY}) - assert_defined(${ENTITY_NAME}) - set(INCLUDE_ENTITY FALSE) - if (NOT ${ENTITY_NAME}) # Note that empty "" is also false! - list(APPEND NONENABLED_LIST_OUT ${ENTITY}) - endif() - endforeach() - list(LENGTH NONENABLED_LIST_OUT NUM_NONENABLED_OUT) - set(${NONENABLED_LIST_OUT_OUT} ${NONENABLED_LIST_OUT} PARENT_SCOPE) - if (NUM_NONENABLED_OUT_OUT) - set(${NUM_NONENABLED_OUT_OUT} ${NUM_NONENABLED_OUT} PARENT_SCOPE) - endif() -endfunction() - - -# Macro that sets up the basic lists of enabled packages and packages. -# -macro(tribits_set_up_enabled_lists_and_pkg_idx) - - # ${PROJECT_NAME}_ENABLED_PACKAGES - tribits_get_enabled_list( - ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES ${PROJECT_NAME} - ${PROJECT_NAME}_ENABLED_INTERNAL_TOPLEVEL_PACKAGES - ${PROJECT_NAME}_NUM_ENABLED_INTERNAL_TOPLEVEL_PACKAGES) - - # ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES - tribits_get_enabled_list( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} - ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES - ${PROJECT_NAME}_NUM_ENABLED_INTERNAL_PACKAGES) - - # ${PROJECT_NAME}_REVERSE_ENABLED_INTERNAL_PACKAGES - set(${PROJECT_NAME}_REVERSE_ENABLED_INTERNAL_PACKAGES - "${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}") - list(REVERSE ${PROJECT_NAME}_REVERSE_ENABLED_INTERNAL_PACKAGES) - - # ${PACKAGE_NAME}_PKG_IDX - set(PKG_IDX 0) - foreach(tribitsPackage ${${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES}) - set(${tribitsPackage}_PKG_IDX ${PKG_IDX}) - math(EXPR PKG_IDX "${PKG_IDX} + 1") - endforeach() - - # ${PROJECT_NAME}_ENABLED_TPLS - tribits_get_enabled_list( ${PROJECT_NAME}_DEFINED_TPLS TPL - ${PROJECT_NAME}_ENABLED_TPLS ${PROJECT_NAME}_NUM_ENABLED_TPLS) - - # ${PROJECT_NAME}_REVERSE_ENABLED_TPLS - set(${PROJECT_NAME}_REVERSE_ENABLED_TPLS - "${${PROJECT_NAME}_ENABLED_TPLS}") - list(REVERSE ${PROJECT_NAME}_REVERSE_ENABLED_TPLS) - -endmacro() - - # @FUNCTION: tribits_set_st_for_dev_mode() # # Function that allows packages to easily make a feature ``ST`` for @@ -337,47 +180,12 @@ endfunction() # For backward compatibility macro(tribits_set_ss_for_dev_mode OUTPUT_VAR) - message(WARNING - "WARNING: tribits_set_ss_for_dev_mode() is deprecated," - " use tribits_set_st_for_dev_mode() instead!") + tribits_deprecated_command(tribits_set_ss_for_dev_mode + MESSAGE "Use tribits_set_st_for_dev_mode() instead.") tribits_set_st_for_dev_mode(${OUTPUT_VAR}) endmacro() -# Function that extracts all of the required and optional -# items for a given class of package lists -# -function( tribits_gather_enabled_items PACKAGE_NAME LISTTYPE_PREFIX - LISTTYPE_POSTFIX GATHERED_ITEMS_LIST_OUT - ) - - #message("TRIBITS_GATHER_ENABLED_ITEMS: '${PACKAGE_NAME}' '${LISTTYPE_PREFIX}'" - # " '${LISTTYPE_POSTFIX}' '${GATHERED_ITEMS_LIST_OUT}'") - - set(GATHERED_ITEMS_LIST_TMP - ${${PACKAGE_NAME}_${LISTTYPE_PREFIX}_REQUIRED_DEP_${LISTTYPE_POSTFIX}} - ) - - #message("TRIBITS_GATHER_ENABLED_ITEMS:" - # " ${PACKAGE_NAME}_${LISTTYPE_PREFIX}_REQUIRED_DEP_${LISTTYPE_POSTFIX} = ${GATHERED_ITEMS_LIST_TMP}") - - foreach(ITEM - ${${PACKAGE_NAME}_${LISTTYPE_PREFIX}_OPTIONAL_DEP_${LISTTYPE_POSTFIX}} - ) - assert_defined(${PACKAGE_NAME}_ENABLE_${ITEM}) - if (${PACKAGE_NAME}_ENABLE_${ITEM}) - append_set(GATHERED_ITEMS_LIST_TMP ${ITEM}) - endif() - endforeach() - - #message("TRIBITS_GATHER_ENABLED_ITEMS:" - # " ${GATHERED_ITEMS_LIST_OUT} = ${GATHERED_ITEMS_LIST_TMP}") - - set(${GATHERED_ITEMS_LIST_OUT} ${GATHERED_ITEMS_LIST_TMP} PARENT_SCOPE) - -endfunction() - - # @FUNCTION: tribits_trace_file_processing() # # Print trace of file processing when diff --git a/cmake/tribits/core/package_arch/TribitsGetEnabledSublists.cmake b/cmake/tribits/core/package_arch/TribitsGetEnabledSublists.cmake new file mode 100644 index 000000000000..0444ba3dde25 --- /dev/null +++ b/cmake/tribits/core/package_arch/TribitsGetEnabledSublists.cmake @@ -0,0 +1,163 @@ +# @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 + +include(TribitsGetPackageEnableStatus) + + +# @FUNCTION: tribits_get_sublist_enabled() +# +# Get sub-list of enabled packages +# +# Usage:: +# +# tribits_get_sublist_enabled( +# ) +# +# On output, ```` contains the sublist of entries in +# ```` which evaluate to ``TRUE`` in an ``if ()`` statement. +# +function(tribits_get_sublist_enabled enableListName + enabledSublistNameOut numEnabledVarOut + ) + set(enabledSublist) + foreach(pkgName IN LISTS ${enableListName}) + tribits_get_package_enable_status(${pkgName} enableVal "") + if (enableVal) + list(APPEND enabledSublist ${pkgName}) + endif() + endforeach() + list(LENGTH enabledSublist numEnabled) + set(${enabledSublistNameOut} ${enabledSublist} PARENT_SCOPE) + if (numEnabledVarOut) + set(${numEnabledVarOut} ${numEnabled} PARENT_SCOPE) + endif() +endfunction() + + +# @FUNCTION: tribits_get_sublist_nondisabled() +# +# Get sub-list of non-disabled packages +# +# Usage:: +# +# tribits_get_sublist_nondisabled( +# ) +# +# On output, ```` contains the sublist of entries from +# ```` for which evaluate to ``TRUE`` or empty ``""`` in an +# ``if ()`` statement. +# +function(tribits_get_sublist_nondisabled enableListName + nondisabledListNameOut numNondisabledVarOut + ) + set(nondisabledList "") + foreach(pkgName IN LISTS ${enableListName}) + tribits_get_package_enable_status(${pkgName} enableVal "") + if (enableVal OR "${enableVal}" STREQUAL "") + list(APPEND nondisabledList ${pkgName}) + endif() + endforeach() + list(LENGTH nondisabledList numNondisabled) + set(${nondisabledListNameOut} ${nondisabledList} PARENT_SCOPE) + if (numNondisabledVarOut) + set(${numNondisabledVarOut} ${numNondisabled} PARENT_SCOPE) + endif() +endfunction() + + +# @FUNCTION: tribits_get_sublist_disabled() +# +# Get sub-list of disabled packages +# +# Usage:: +# +# tribits_get_sublist_disabled( +# ) +# +# On output, ```` contains the sublist of entries +# ```` which evaluate to ``FALSE`` and is not empty ``""`` in +# an ``if ()`` statement. +# +function(tribits_get_sublist_disabled enableListName + disabledSublistNameOut numDisabledVarOut + ) + set(disabledSublist "") + foreach(pkgName IN LISTS ${enableListName}) + tribits_get_package_enable_status(${pkgName} enableVal "") + if ((NOT enableVal) AND (NOT "${enableVal}" STREQUAL "")) + list(APPEND disabledSublist ${pkgName}) + endif() + endforeach() + list(LENGTH disabledSublist numDisabled) + set(${disabledSublistNameOut} ${disabledSublist} PARENT_SCOPE) + if (numDisabledVarOut) + set(${numDisabledVarOut} ${numDisabled} PARENT_SCOPE) + endif() +endfunction() + + +# @FUNCTION: tribits_get_sublist_nonenabled() +# +# Get sub-list of non-enabled entries +# +# Usage:: +# +# tribits_get_sublist_nonenabled( +# ) +# +# On output, ```` contains the subset of entries in +# ```` that evaluate to ``FALSE`` (which can also be empty +# ``""``) in an ``if ()`` statement. +# +function(tribits_get_sublist_nonenabled enableListName + nonenabledListNameOut numNonenabledVarOut + ) + set(nonenabledList "") + foreach(pkgName IN LISTS ${enableListName}) + tribits_get_package_enable_status(${pkgName} enableVal "") + if (NOT enableVal) + list(APPEND nonenabledList ${pkgName}) + endif() + endforeach() + list(LENGTH nonenabledList numNonenabled) + set(${nonenabledListNameOut} ${nonenabledList} PARENT_SCOPE) + if (numNonenabledVarOut) + set(${numNonenabledVarOut} ${numNonenabled} PARENT_SCOPE) + endif() +endfunction() diff --git a/cmake/tribits/core/package_arch/TribitsGetPackageEnableStatus.cmake b/cmake/tribits/core/package_arch/TribitsGetPackageEnableStatus.cmake new file mode 100644 index 000000000000..3fac736a78cc --- /dev/null +++ b/cmake/tribits/core/package_arch/TribitsGetPackageEnableStatus.cmake @@ -0,0 +1,134 @@ +# @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 + + +# @FUNCTION: tribits_get_package_enable_status() +# +# Function that determines if a given external or internal package's enable +# status (e.g. 'ON' or 'OFF') +# +# Usage:: +# +# tribits_get_package_enable_status( +# ) +# +# On return, if non-empty, the variable ```` will contain +# the actual value of ``${${PROJECT_NAME}_ENABLE_}`` or +# ``${TPL_ENABLE_}`` or will return empty "". If +# ``${packageName}_PACKAGE_BUILD_STATUS == "INTERNAL", then only the value of +# ``${PROJECT_NAME}_ENABLE_`` will be considered. +# +# On return, if non-empty, the variable ```` will be +# either ``${${PROJECT_NAME}_ENABLE_}`` or +# ``${TPL_ENABLE_}``, depending on which one is used to obtain +# the value ````. +# +# This works for both external packages/TPLs and internal packages. +# +function(tribits_get_package_enable_status packageName packageEnableOut + packageEnableVarNameOut + ) + tribits_get_package_enable_status_assert_args("${packageName}" + "${packageEnableOut}" "${packageEnableVarNameOut}") + tribits_assert_package_enable_status(${packageName}) + # Determine which variable, if any, to extract enable status from + set(packageEnableVarName "") + if (${packageName}_PACKAGE_BUILD_STATUS STREQUAL "INTERNAL") + set(packageEnableVarName ${PROJECT_NAME}_ENABLE_${packageName}) + elseif (${packageName}_PACKAGE_BUILD_STATUS STREQUAL "EXTERNAL") + if (NOT "${TPL_ENABLE_${packageName}}" STREQUAL "") + set(packageEnableVarName TPL_ENABLE_${packageName}) + elseif (NOT "${${PROJECT_NAME}_ENABLE_${packageName}}" STREQUAL "") + set(packageEnableVarName ${PROJECT_NAME}_ENABLE_${packageName}) + else() + # If neither is set, select the default var TPL name + set(packageEnableVarName TPL_ENABLE_${packageName}) + endif() + endif() + if (packageEnableVarName) + set(packageEnable ${${packageEnableVarName}}) + else() + set(packageEnable "") + endif() + # Set output args + if (packageEnableOut) + set(${packageEnableOut} ${packageEnable} PARENT_SCOPE) + endif() + if (packageEnableVarNameOut) + set(${packageEnableVarNameOut} ${packageEnableVarName} PARENT_SCOPE) + endif() +endfunction() + + +# @FUNCTION: tribits_assert_package_enable_status() +# +# Function that asserts that if both ``${PROJECT_NAME}_ENABLE_${packageName}`` +# and ``TPL_ENABLE_${packageName}`` are both set to non-empty, then they must +# be the same value or this is an error. +# +# Usage:: +# +# tribits_assert_package_enable_status() +# +function(tribits_assert_package_enable_status packageName) + if ( (NOT "${${PROJECT_NAME}_ENABLE_${packageName}}" STREQUAL "") + AND (NOT "${TPL_ENABLE_${packageName}}" STREQUAL "") + AND (NOT "${${PROJECT_NAME}_ENABLE_${packageName}}" STREQUAL + "${TPL_ENABLE_${packageName}}") + ) + message(SEND_ERROR "Error, ${PROJECT_NAME}_ENABLE_${packageName}=" + "'${${PROJECT_NAME}_ENABLE_${packageName}}' !=" + " TPL_ENABLE_${packageName} = '${TPL_ENABLE_${packageName}}'") + endif() +endfunction() +# ToDo: Create a cache var for the mode of message() above in case the user +# wants to disable the warning. + + +function(tribits_get_package_enable_status_assert_args packageName packageEnableOut + packageEnableVarNameOut + ) + if ("${packageName}" STREQUAL "") + message(FATAL_ERROR "Error, packageName='' is not allowed!") + endif() + if ("${packageEnableOut}" STREQUAL "" AND "${packageEnableVarNameOut}" STREQUAL "") + message(FATAL_ERROR "Error, both packageEnableOut='' and" + " packageEnableVarNameOut='' is not allowed!") + endif() +endfunction() diff --git a/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake b/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake index ac994b29a2e9..7f452f338b7a 100644 --- a/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake +++ b/cmake/tribits/core/package_arch/TribitsGlobalMacros.cmake @@ -51,9 +51,11 @@ include(TribitsReportInvalidTribitsUsage) include(TribitsReadAllProjectDepsFilesCreateDepsGraph) include(TribitsAdjustPackageEnables) include(TribitsGitRepoVersionInfo) +include(TribitsSetUpEnabledOnlyDependencies) # Standard TriBITS utilities includes include(TribitsAddOptionAndDefine) +include(TribitsAddEnumCacheVar) include(AdvancedOption) include(AdvancedSet) include(AppendStringVar) @@ -69,6 +71,7 @@ include(Split) include(TimingUtils) include(SetDefaultAndFromEnv) # Used by some call-back files include(TribitsFilepathHelpers) +include(TribitsDeprecatedHelpers) # Standard CMake includes include(CheckIncludeFileCXX) @@ -717,22 +720,49 @@ macro(tribits_define_global_options_and_define_extra_repos) "Determines if a variety of development mode checks are turned on by default or not." ) - advanced_set( ${PROJECT_NAME}_ASSERT_MISSING_PACKAGES - ${${PROJECT_NAME}_ENABLE_DEVELOPMENT_MODE} - CACHE BOOL - "Determines if asserts are performed on missing packages or not." ) + if ("${${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT}" STREQUAL "") + if (${PROJECT_NAME}_ENABLE_DEVELOPMENT_MODE) + set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT FATAL_ERROR) + else() + set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT IGNORE) + endif() + endif() + set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_ERROR_VALUES_LIST + "FATAL_ERROR" "SEND_ERROR" ) + set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_VALUES_LIST + ${${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_ERROR_VALUES_LIST} + "WARNING" "NOTICE" "IGNORE" "OFF" ) + tribits_add_enum_cache_var( ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES + DEFAULT_VAL ${${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT} + DOC_STRING + "Assert that all external and internal dependencies are defined in the project" + ALLOWED_STRINGS_LIST + ${${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_VALUES_LIST} + IS_ADVANCED ) + + if (NOT "${${PROJECT_NAME}_ASSERT_MISSING_PACKAGES}" STREQUAL "") + message(FATAL_ERROR "Error, ${PROJECT_NAME}_ASSERT_MISSING_PACKAGES=" + " '${${PROJECT_NAME}_ASSERT_MISSING_PACKAGES}' is set and is no" + " longer supported! Please set" + " ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES=FATAL_ERROR instead!" ) + endif() if ("${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT}" STREQUAL "") if (${PROJECT_NAME}_ENABLE_DEVELOPMENT_MODE) - set(${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT FATAL_ERROR) + set(${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT FATAL_ERROR) else() - set(${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT IGNORE) + set(${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT IGNORE) endif() endif() - advanced_set( ${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE - "${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT}" - CACHE BOOL - "Assert correct usage of TriBITS. Value values include 'FATAL_ERROR', 'SEND_ERROR', 'WARNING', and 'IGNORE'. Default '${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT}' " ) + set(${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_VALUES_LIST + "FATAL_ERROR" "SEND_ERROR" "WARNING" "IGNORE" "OFF") + tribits_add_enum_cache_var( ${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE + DEFAULT_VAL "${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_DEFAULT}" + DOC_STRING + "Assert correct usage of TriBITS" + ALLOWED_STRINGS_LIST + ${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE_VALUES_LIST} + IS_ADVANCED ) advanced_set( ${PROJECT_NAME}_WARN_ABOUT_MISSING_EXTERNAL_PACKAGES FALSE CACHE BOOL @@ -929,6 +959,17 @@ macro(tribits_define_global_options_and_define_extra_repos) CACHE BOOL "Set to 'ON' to see the machine load for advanced tests." ) + if ("${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_DEFAULT}" STREQUAL "") + set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_DEFAULT "DEPRECATION") + endif() + + tribits_add_enum_cache_var(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE + DEFAULT_VAL "${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_DEFAULT}" + DOC_STRING "Mode for dealing with usage of TriBITS deprecated functionality" + ALLOWED_STRINGS_LIST ${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_ALL_VALID_VALUES} + IS_ADVANCED + ) + mark_as_advanced(BUILD_TESTING) mark_as_advanced(CMAKE_BACKWARDS_COMPATIBILITY) mark_as_advanced(DART_TESTING_TIMEOUT) @@ -2279,14 +2320,12 @@ macro(tribits_setup_packaging_and_distribution) # K.2) Removing any packages or packages not enabled from the tarball if (${PROJECT_NAME}_EXCLUDE_DISABLED_SUBPACKAGES_FROM_DISTRIBUTION) - set(tribitsPackage ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) + set(tribitsPackageList ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) else() - set(tribitsPackage ${${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES}) + set(tribitsPackageList ${${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES}) endif() - tribits_get_nonenabled_list( - tribitsPackage ${PROJECT_NAME} - nonEnabledTribitsPackage "") + tribits_get_sublist_nonenabled(tribitsPackageList nonEnabledTribitsPackage "") foreach(TRIBITS_PACKAGE ${nonEnabledTribitsPackage}) @@ -2345,18 +2384,18 @@ macro(tribits_setup_packaging_and_distribution) # K.3) Set up install component dependencies - tribits_get_enabled_list( - ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES ${PROJECT_NAME} - ENABLED_PACKAGES NUM_ENABLED) - #message("ENABLED PACKAGES: ${ENABLED_PACKAGES} ${NUM_ENABLED}") - - foreach(PKG ${ENABLED_PACKAGES}) - if(NOT "${${PKG}_LIB_REQUIRED_DEP_PACKAGES}" STREQUAL "") - string(TOUPPER ${PKG} UPPER_PKG) - #message("${UPPER_PKG} depends on : ${${PKG}_LIB_REQUIRED_DEP_PACKAGES}") - set(CPACK_COMPONENT_${UPPER_PKG}_DEPENDS ${${PKG}_LIB_REQUIRED_DEP_PACKAGES}) + tribits_get_sublist_enabled( + ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES + enabledInternalToplevelPackages "") + + foreach(pkgName ${enabledInternalToplevelPackages}) + if(NOT "${${pkgName}_LIB_ENABLED_DEPENDENCIES}" STREQUAL "") + string(TOUPPER ${pkgName} upperPkgName) + set(CPACK_COMPONENT_${upperPkgName}_DEPENDS ${${pkgName}_LIB_ENABLED_DEPENDENCIES}) + # ToDo: The above needs to be changed to the list of *internal* enabled + # package dependencies! (But there are no tests for this currently and + # I am not sure who is using this.) endif() - #message("${PKG} depends on : ${${PKG}_LIB_REQUIRED_DEP_PACKAGES}") endforeach() # K.4) Resetting the name to avoid overwriting registry keys when installing diff --git a/cmake/tribits/core/package_arch/TribitsIncludeDirectories.cmake b/cmake/tribits/core/package_arch/TribitsIncludeDirectories.cmake index 3f90fc873d69..e288094953e2 100644 --- a/cmake/tribits/core/package_arch/TribitsIncludeDirectories.cmake +++ b/cmake/tribits/core/package_arch/TribitsIncludeDirectories.cmake @@ -38,18 +38,19 @@ # @HEADER include(CMakeParseArguments) +include(TribitsDeprecatedHelpers) # @MACRO: tribits_include_directories() # -# This function is to override the standard behavior of the built-in CMake -# ``include_directories()`` command. +# This function overrides the standard behavior of the built-in CMake +# ``include_directories()`` command for special behavior for installation +# testing. # # Usage:: # # tribits_include_directories( -# [REQUIRED_DURING_INSTALLATION_TESTING] ... -# ) +# [REQUIRED_DURING_INSTALLATION_TESTING] ... ) # # If specified, ``REQUIRED_DURING_INSTALLATION_TESTING`` can appear anywhere # in the argument list. @@ -61,10 +62,10 @@ include(CMakeParseArguments) # Testing`_). Normally we want the include directories to be handled as cmake # usually does. However during TriBITS installation testing we do not want # most of the include directories to be used as the majority of the files -# should come from the installation we are building against. There is an -# exception to this and that is when there are test only headers that are -# needed. For that case ``REQUIRED_DURING_INSTALLATION_TESTING`` must be -# passed in to ensure the include paths are added for installation testing. +# should come from the installation we are building against. The exception is +# when there are test only headers that are needed. For that case +# ``REQUIRED_DURING_INSTALLATION_TESTING`` must be passed in to ensure the +# include paths are added for installation testing. # macro(tribits_include_directories) @@ -80,16 +81,32 @@ macro(tribits_include_directories) ${ARGN} ) - if(NOT ${PROJECT_NAME}_ENABLE_INSTALLATION_TESTING OR PARSE_REQUIRED_DURING_INSTALLATION_TESTING) - _include_directories(${PARSE_UNPARSED_ARGUMENTS}) + if(NOT ${PROJECT_NAME}_ENABLE_INSTALLATION_TESTING + OR PARSE_REQUIRED_DURING_INSTALLATION_TESTING + ) + if (TRIBITS_HIDE_DEPRECATED_INCLUDE_DIRECTORIES_OVERRIDE) + include_directories(${PARSE_UNPARSED_ARGUMENTS}) + else() + _include_directories(${PARSE_UNPARSED_ARGUMENTS}) + endif() endif() endmacro() +if (NOT TRIBITS_HIDE_DEPRECATED_INCLUDE_DIRECTORIES_OVERRIDE) + # Deprecated. Use tribits_include_directories() instead! +# +# To hide this macro from even being defined, set +# ``TRIBITS_HIDE_DEPRECATED_INCLUDE_DIRECTORIES_OVERRIDE=TRUE``. +# macro(include_directories) - cmake_parse_arguments( + tribits_deprecated_command(include_directories + MESSAGE "Use tribits_include_directories() instead." + ) + + cmake_parse_arguments( #prefix PARSE #options @@ -101,12 +118,11 @@ macro(include_directories) ${ARGN} ) -# if (PARSE_REQUIRED_DURING_INSTALLATION_TESTING) -# message(WARNING "Warning: the override include_directories() is deprecated," -# " use tribits_include_directories() instead!") -# endif() - - if(NOT ${PROJECT_NAME}_ENABLE_INSTALLATION_TESTING OR PARSE_REQUIRED_DURING_INSTALLATION_TESTING) + if(NOT ${PROJECT_NAME}_ENABLE_INSTALLATION_TESTING + OR PARSE_REQUIRED_DURING_INSTALLATION_TESTING + ) _include_directories(${PARSE_UNPARSED_ARGUMENTS}) endif() endmacro() + +endif (NOT TRIBITS_HIDE_DEPRECATED_INCLUDE_DIRECTORIES_OVERRIDE) diff --git a/cmake/tribits/core/package_arch/TribitsListHelpers.cmake b/cmake/tribits/core/package_arch/TribitsListHelpers.cmake index 92184a2520e6..69ade415d655 100644 --- a/cmake/tribits/core/package_arch/TribitsListHelpers.cmake +++ b/cmake/tribits/core/package_arch/TribitsListHelpers.cmake @@ -39,6 +39,7 @@ include(TribitsHostType) +include(TribitsDeprecatedHelpers) # @@ -120,8 +121,8 @@ endmacro() macro( package_disable_on_platforms PACKAGE_NAME_IN_ ) - message(WARNING "package_disable_on_platforms() is deprecated!" - " Use tribits_disable_package_on_platforms() instead!") + tribits_deprecated_command(package_disable_on_platforms + MESSAGE "Use tribits_disable_package_on_platforms() instead!") tribits_disable_package_on_platforms(${PACKAGE_NAME_IN_} ${ARGN}) endmacro() @@ -136,19 +137,19 @@ function(tribits_update_ps_pt_ss_st THING_TYPE THING_NAME TESTGROUP_VAR) if (TESTGROUP_IN STREQUAL PS) if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message("-- " "WARNING: ${THING_TYPE} ${THING_NAME} TESTGROUP 'PS' is deprecated." + tribits_deprecated("${THING_TYPE} ${THING_NAME} TESTGROUP 'PS' is deprecated." " Use 'PT' instead!") endif() set(TESTGROUP_OUT PT) elseif (TESTGROUP_IN STREQUAL SS) if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message("-- " "WARNING: ${THING_TYPE} ${THING_NAME} TESTGROUP 'SS' is deprecated." + tribits_deprecated("${THING_TYPE} ${THING_NAME} TESTGROUP 'SS' is deprecated." " Use 'ST' instead!") endif() set(TESTGROUP_OUT ST) elseif (TESTGROUP_IN STREQUAL TS) if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message("-- " "WARNING: ${THING_TYPE} ${THING_NAME} TESTGROUP 'TS' is deprecated." + tribits_deprecated("${THING_TYPE} ${THING_NAME} TESTGROUP 'TS' is deprecated." " Use 'TT' instead!") endif() set(TESTGROUP_OUT TT) diff --git a/cmake/tribits/core/package_arch/TribitsPackageDependencies.cmake b/cmake/tribits/core/package_arch/TribitsPackageDependencies.cmake index 416b03d7fddf..0f4a956dd783 100644 --- a/cmake/tribits/core/package_arch/TribitsPackageDependencies.cmake +++ b/cmake/tribits/core/package_arch/TribitsPackageDependencies.cmake @@ -123,13 +123,14 @@ endmacro() # Takes the list ``_LIB_DEFINED_DEPENDENCIES`` and sets the # default entries of the non-cache var # ``_LIB_ENABLED_DEPENDENCIES``. However, if -# ``${_LIB_DEFINED_DEPENDENCIES}`` is non-empty when this macro -# is called, then it will not be changed. That allows the user to override -# the list of enabled TPL dependencies in the cache. This also sets the -# non-cache vars ``_ENABLE_=ON`` for each -# enabled package listed in ``_LIB_ENABLED_DEPENDENCIES`` and -# to ``OFF`` for each ```` listed in -# ``_LIB_ENABLED_DEPENDENCIES`` but not in +# ``${_LIB_ENABLED_DEPENDENCIES`` is non-empty when this +# macro is called, then it will not be changed. That allows the user to +# override the list of enabled TPL dependencies in the cache. This also sets +# the non-cache vars ``_ENABLE_=ON`` for +# each enabled package listed in +# ``_LIB_ENABLED_DEPENDENCIES`` and to ``OFF`` for each +# ```` listed in +# ``_LIB_DEFINED_DEPENDENCIES`` but not in # ``_LIB_ENABLED_DEPENDENCIES``. # macro(tribits_extpkg_setup_enabled_dependencies externalPkgName) @@ -149,7 +150,7 @@ macro(tribits_extpkg_setup_enabled_dependencies externalPkgName) endif() if ("${${externalPkgName}_LIB_ENABLED_DEPENDENCIES}" STREQUAL "") - # Only set of not already set as a cache var, for example + # Only set of not already set as a cache var, for example, by the user set(${externalPkgName}_LIB_ENABLED_DEPENDENCIES ${libEnabledDependencies}) endif() diff --git a/cmake/tribits/core/package_arch/TribitsPackageMacros.cmake b/cmake/tribits/core/package_arch/TribitsPackageMacros.cmake index 8a0475f6746e..a0c53f5129fe 100644 --- a/cmake/tribits/core/package_arch/TribitsPackageMacros.cmake +++ b/cmake/tribits/core/package_arch/TribitsPackageMacros.cmake @@ -545,10 +545,7 @@ endmacro() # up example directories any way one would like. # # Currently, all it does macro does is to call ``add_subdirectory()`` if -# ``${PACKAGE_NAME}_ENABLE_EXAMPLES`` or -# ``${PARENT_PACKAGE_NAME}_ENABLE_EXAMPLES`` are true. However, this macro may -# be extended in the future in order to modify behavior related to adding -# tests and examples in a uniform way. +# `${PACKAGE_NAME}_ENABLE_EXAMPLES`_ ``= TRUE``. # macro(tribits_add_example_directories) diff --git a/cmake/tribits/core/package_arch/TribitsPkgExportCacheVars.cmake b/cmake/tribits/core/package_arch/TribitsPkgExportCacheVars.cmake index 6fb85e0ef8de..9380cebe1dd9 100644 --- a/cmake/tribits/core/package_arch/TribitsPkgExportCacheVars.cmake +++ b/cmake/tribits/core/package_arch/TribitsPkgExportCacheVars.cmake @@ -122,7 +122,7 @@ function(tribits_pkg_append_set_commands_for_exported_vars packageName endforeach() endif() foreach(exportedCacheVar IN LISTS ${packageName}_PKG_VARS_TO_EXPORT) - tribits_assert_cache_and_local_vars_same_value(${exportedCacheVar}) + #tribits_assert_cache_and_local_vars_same_value(${exportedCacheVar}) string(APPEND configFileStr "set(${exportedCacheVar} \"${${exportedCacheVar}}\")\n") endforeach() diff --git a/cmake/tribits/core/package_arch/TribitsPrintDependencyInfo.cmake b/cmake/tribits/core/package_arch/TribitsPrintDependencyInfo.cmake index 143610266c51..2b96e2f74175 100644 --- a/cmake/tribits/core/package_arch/TribitsPrintDependencyInfo.cmake +++ b/cmake/tribits/core/package_arch/TribitsPrintDependencyInfo.cmake @@ -114,7 +114,7 @@ function(tribits_dump_package_dependencies_info) if (${PROJECT_NAME}_DUMP_PACKAGE_DEPENDENCIES) message("") - foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) + foreach(TRIBITS_PACKAGE ${${PROJECT_NAME}_DEFINED_PACKAGES}) tribits_print_package_dependencies(${TRIBITS_PACKAGE}) message("") endforeach() @@ -123,6 +123,9 @@ function(tribits_dump_package_dependencies_info) endfunction() +# Optionally print out a global project list var with spaces and +# unconditionally print out the number of items in that list +# function(tribits_print_project_list_var_and_num listVarSuffix) message("") if (${PROJECT_NAME}_DUMP_PACKAGE_DEPENDENCIES) @@ -132,4 +135,101 @@ function(tribits_print_project_list_var_and_num listVarSuffix) endfunction() +# Print out dependencies for a package +# +function(tribits_print_package_dependencies packageName) + + set(printedVar "") + + # Print deps vars + + if (printedVar) + message("") + endif() + + tribits_print_nonempty_package_deps_list(${packageName} LIB DEFINED printedVar) + tribits_print_nonempty_package_deps_list(${packageName} TEST DEFINED printedVar) + + if (${PROJECT_NAME}_DUMP_FORWARD_PACKAGE_DEPENDENCIES) + tribits_print_nonempty_package_forward_defined_deps_list(${packageName} LIB + printedVar) + tribits_print_nonempty_package_forward_defined_deps_list(${packageName} TEST + printedVar) + endif() + + if (NOT printedVar) + message("-- ${packageName}: No defined dependencies!") + endif() + +endfunction() + + +# Print out a dependency list including if each item is optional or required +# ('R' or 'O') +# +# Usage:: +# +# tribits_print_nonempty_package_deps_list( +# ) +# +# which prints out the list:: +# +# __DEFINED_DEPENDENCIES +# +# if it is non-empty. +# +function(tribits_print_nonempty_package_deps_list packageName + libOrTest definedOrEnabled printedListOut + ) + set(depsListName ${packageName}_${libOrTest}_${definedOrEnabled}_DEPENDENCIES) + if (NOT "${${depsListName}}" STREQUAL "") + set(lineStr "-- ${depsListName}:") + foreach (depPkg IN LISTS ${depsListName}) + string(APPEND lineStr " ${depPkg}") + if (${packageName}_${libOrTest}_DEP_REQUIRED_${depPkg}) + string(APPEND lineStr "[R]") + else() + string(APPEND lineStr "[O]") + endif() + endforeach() + message("${lineStr}") + set(${printedListOut} TRUE PARENT_SCOPE) + endif() +endfunction() + + +# Print out a forward dependency list including if each item is optional or +# required ('R' or 'O') +# +# Usage:: +# +# tribits_print_nonempty_package_forward_defined_deps_list( +# ) +# +# which prints out the list:: +# +# _FORWARD__DEFINED_DEPENDENCIES +# +# if it is non-empty. +# +function(tribits_print_nonempty_package_forward_defined_deps_list packageName + libOrTest printedListOut + ) + set(fwdDepsListName ${packageName}_FORWARD_${libOrTest}_DEFINED_DEPENDENCIES) + if (NOT "${${fwdDepsListName}}" STREQUAL "") + set(lineStr "-- ${fwdDepsListName}:") + foreach (fwdDepPkg IN LISTS ${fwdDepsListName}) + string(APPEND lineStr " ${fwdDepPkg}") + if (${fwdDepPkg}_${libOrTest}_DEP_REQUIRED_${packageName}) + string(APPEND lineStr "[R]") + else() + string(APPEND lineStr "[O]") + endif() + endforeach() + message("${lineStr}") + set(${printedListOut} TRUE PARENT_SCOPE) + endif() +endfunction() + + # LocalWords: TRIBITS diff --git a/cmake/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake b/cmake/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake index 547c9a9f60e9..b49d96372bfc 100644 --- a/cmake/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake +++ b/cmake/tribits/core/package_arch/TribitsPrintEnabledPackagesLists.cmake @@ -37,6 +37,8 @@ # ************************************************************************ # @HEADER +include(TribitsGetEnabledSublists) + # @FUNCTION: tribits_print_enables_before_adjust_package_enables() # @@ -107,20 +109,20 @@ function(tribits_print_internal_package_list_enable_status DOCSTRING ENABLED_FLAG INCLUDE_EMPTY ) if (ENABLED_FLAG AND NOT INCLUDE_EMPTY) - tribits_get_enabled_list( - ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} + tribits_get_sublist_enabled( + ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES internalPackagesEnableStatusList "") elseif (ENABLED_FLAG AND INCLUDE_EMPTY) - tribits_get_nondisabled_list( + tribits_get_sublist_nondisabled( ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} internalPackagesEnableStatusList "") elseif (NOT ENABLED_FLAG AND NOT INCLUDE_EMPTY) - tribits_get_disabled_list( - ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} + tribits_get_sublist_disabled( + ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES internalPackagesEnableStatusList "") else() # NOT ENABLED_FLAG AND INCLUDE_EMPTY - tribits_get_nonenabled_list( - ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME} + tribits_get_sublist_nonenabled( + ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES internalPackagesEnableStatusList "") endif() tribits_print_prefix_string_and_list("${DOCSTRING}" @@ -132,16 +134,16 @@ endfunction() # function(tribits_print_tpl_list_enable_status DOCSTRING ENABLED_FLAG INCLUDE_EMPTY) if (ENABLED_FLAG AND NOT INCLUDE_EMPTY) - tribits_get_enabled_list( ${PROJECT_NAME}_DEFINED_TPLS TPL + tribits_get_sublist_enabled( ${PROJECT_NAME}_DEFINED_TPLS tplsEnableStatusList "") elseif (ENABLED_FLAG AND INCLUDE_EMPTY) - tribits_get_nondisabled_list( ${PROJECT_NAME}_DEFINED_TPLS TPL + tribits_get_sublist_nondisabled( ${PROJECT_NAME}_DEFINED_TPLS tplsEnableStatusList "") elseif (NOT ENABLED_FLAG AND NOT INCLUDE_EMPTY) - tribits_get_disabled_list( ${PROJECT_NAME}_DEFINED_TPLS TPL + tribits_get_sublist_disabled( ${PROJECT_NAME}_DEFINED_TPLS tplsEnableStatusList "") else() # NOT ENABLED_FLAG AND INCLUDE_EMPTY - tribits_get_nonenabled_list( ${PROJECT_NAME}_DEFINED_TPLS TPL + tribits_get_sublist_nonenabled( ${PROJECT_NAME}_DEFINED_TPLS tplsEnableStatusList "") endif() tribits_print_prefix_string_and_list("${DOCSTRING}" "${tplsEnableStatusList}") @@ -155,16 +157,15 @@ function(tribits_print_packages_list_enable_status_from_var PACKAGES_LIST_VAR DOCSTRING ENABLED_FLAG INCLUDE_EMPTY ) if (ENABLED_FLAG AND NOT INCLUDE_EMPTY) - tribits_get_enabled_list(${PACKAGES_LIST_VAR} ${PROJECT_NAME} + tribits_get_sublist_enabled(${PACKAGES_LIST_VAR} enableStatusList "") elseif (ENABLED_FLAG AND INCLUDE_EMPTY) - tribits_get_nondisabled_list(${PACKAGES_LIST_VAR} ${PROJECT_NAME} - enableStatusList "") + tribits_get_sublist_nondisabled(${PACKAGES_LIST_VAR} enableStatusList "") elseif (NOT ENABLED_FLAG AND NOT INCLUDE_EMPTY) - tribits_get_disabled_list(${PACKAGES_LIST_VAR} ${PROJECT_NAME} + tribits_get_sublist_disabled(${PACKAGES_LIST_VAR} enableStatusList "") else() # NOT ENABLED_FLAG AND INCLUDE_EMPTY - tribits_get_nonenabled_list(${PACKAGES_LIST_VAR} ${PROJECT_NAME} + tribits_get_sublist_nonenabled(${PACKAGES_LIST_VAR} enableStatusList "") endif() tribits_print_prefix_string_and_list("${DOCSTRING}" "${enableStatusList}") diff --git a/cmake/tribits/core/package_arch/TribitsProcessEnabledTpl.cmake b/cmake/tribits/core/package_arch/TribitsProcessEnabledTpl.cmake index dcdde4ce6349..f6925f2081ff 100644 --- a/cmake/tribits/core/package_arch/TribitsProcessEnabledTpl.cmake +++ b/cmake/tribits/core/package_arch/TribitsProcessEnabledTpl.cmake @@ -57,9 +57,9 @@ function(tribits_process_enabled_tpl TPL_NAME) # Setup the processing string set(PROCESSING_MSG_STRING "Processing enabled external package/TPL: ${TPL_NAME} (") - if (TPL_${TPL_NAME}_ENABLING_PKG) + if (${TPL_NAME}_ENABLING_PKG) string(APPEND PROCESSING_MSG_STRING - "enabled by ${TPL_${TPL_NAME}_ENABLING_PKG}," ) + "enabled by ${${TPL_NAME}_ENABLING_PKG}," ) else() string(APPEND PROCESSING_MSG_STRING "enabled explicitly," ) @@ -121,14 +121,14 @@ function(tribits_process_enabled_tpl TPL_NAME) " which is pointed to in the file:\n" " ${${TPL_NAME}_TPLS_LIST_FILE}\n" ) - if (TPL_${TPL_NAME}_ENABLING_PKG) + if (${TPL_NAME}_ENABLING_PKG) message( "TIP: One way to get past the configure failure for the\n" "TPL '${TPL_NAME}' is to simply disable it with:\n" " -DTPL_ENABLE_${TPL_NAME}=OFF\n" "which will disable it and will recursively disable all of the\n" "downstream packages that have required dependencies on it, including\n" - "the package '${TPL_${TPL_NAME}_ENABLING_PKG}' which triggered its enable.\n" + "the package '${${TPL_NAME}_ENABLING_PKG}' which triggered its enable.\n" "When you reconfigure, just grep the cmake stdout for '${TPL_NAME}'\n" "and then follow the disables that occur as a result to see what impact\n" "this TPL disable has on the configuration of ${PROJECT_NAME}.\n" diff --git a/cmake/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake b/cmake/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake index 35a5d46b4864..d045fdedfaaa 100644 --- a/cmake/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake +++ b/cmake/tribits/core/package_arch/TribitsProcessPackagesAndDirsLists.cmake @@ -334,29 +334,32 @@ function(tribits_is_primary_meta_project_package PACKAGE_NAME_IN endfunction() -# Function that determines if it is okay to allow an implicit package enable -# based on its classification. +# Function that determines if it is okay to allow an implicit enable of an +# upstream package given the disable of a downstream package that depends on +# it. # -function(tribits_implicit_package_enable_is_allowed UPSTREAM_PACKAGE_NAME_IN - PACKAGE_NAME_IN IMPLICIT_PACKAGE_ENABLE_ALLOWED_OUT +function(tribits_implicit_package_enable_is_allowed upstreamPackageName + packageName implictPackageEnableAllowedOut ) - if (${PACKAGE_NAME_IN}_TESTGROUP STREQUAL PT) - set(IMPLICIT_PACKAGE_ENABLE_ALLOWED TRUE) - elseif (${PACKAGE_NAME_IN}_TESTGROUP STREQUAL ST - AND ${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE + if (${packageName}_PACKAGE_BUILD_STATUS STREQUAL "EXTERNAL") + set(implicitPackageEnableAllowed FALSE) + elseif (${packageName}_TESTGROUP STREQUAL "PT") + set(implicitPackageEnableAllowed TRUE) + elseif (${packageName}_TESTGROUP STREQUAL "ST" + AND ${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE ) - set(IMPLICIT_PACKAGE_ENABLE_ALLOWED TRUE) + set(implicitPackageEnableAllowed TRUE) else() - if (UPSTREAM_PACKAGE_NAME_IN) - message("-- " "NOTE: Not Setting ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME_IN}=ON" - " even though ${UPSTREAM_PACKAGE_NAME_IN} has an optional dependence on" - " ${PACKAGE_NAME_IN} because ${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE=OFF" ) + if (upstreamPackageName) + message("-- " "NOTE: Not Setting ${PROJECT_NAME}_ENABLE_${packageName}=ON" + " even though ${upstreamPackageName} has an optional dependence on" + " ${packageName} because ${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE=OFF" ) endif() - set(IMPLICIT_PACKAGE_ENABLE_ALLOWED FALSE) + set(implicitPackageEnableAllowed FALSE) endif() - set(${IMPLICIT_PACKAGE_ENABLE_ALLOWED_OUT} ${IMPLICIT_PACKAGE_ENABLE_ALLOWED} + set(${implictPackageEnableAllowedOut} "${implicitPackageEnableAllowed}" PARENT_SCOPE ) endfunction() @@ -378,7 +381,6 @@ endfunction() # * `${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES`_ # * `${PROJECT_NAME}_NUM_DEFINED_INTERNAL_TOPLEVEL_PACKAGES`_ # * ``${PROJECT_NAME}_LAST_DEFINED_INTERNAL_TOPLEVEL_PACKAGE_IDX`` -# * ``${PROJECT_NAME}_REVERSE_DEFINED_INTERNAL_TOPLEVEL_PACKAGES`` # # For each of the listed top-level (parent) packages ${PACKAGE_NAME}, it also # sets up constant variables defined in `TriBITS Package Top-Level Local @@ -386,12 +388,15 @@ endfunction() # # * `${PACKAGE_NAME}_SOURCE_DIR`_ # * `${PACKAGE_NAME}_REL_SOURCE_DIR`_ +# * `${PACKAGE_NAME}_PARENT_PACKAGE`_ (to empty "") +# * `${PACKAGE_NAME}_PARENT_REPOSITORY`_ (to empty "") # * `${PACKAGE_NAME}_TESTGROUP`_ +# * `${PACKAGE_NAME}_PACKAGE_BUILD_STATUS`_ (to ``INTERNAL``) # # and sets up some standard enable/disable vars with default values as defined -# in `TriBITS Package Cache Variables`_ like:: +# in `TriBITS Package Cache Variables`_ like: # -# ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME} +# * `${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}`_ # # NOTE: Set ``TRIBITS_PROCESS_PACKAGES_AND_DIRS_LISTS_VERBOSE=TRUE`` to see # really verbose debug output from this macro. @@ -541,11 +546,12 @@ macro(tribits_process_packages_and_dirs_lists REPOSITORY_NAME REPOSITORY_DIR) print_var(REPOSITORY_AND_PACKAGE_DIR) print_var(PACKAGE_ABS_DIR) print_var(PACKAGE_EXISTS) - print_var(${PROJECT_NAME}_ASSERT_MISSING_PACKAGES) + print_var(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES) print_var(${TRIBITS_PACKAGE}_ALLOW_MISSING_EXTERNAL_PACKAGE) endif() - if (${PROJECT_NAME}_ASSERT_MISSING_PACKAGES + if (${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES IN_LIST + ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_ERROR_VALUES_LIST AND NOT PACKAGE_EXISTS AND NOT ${TRIBITS_PACKAGE}_ALLOW_MISSING_EXTERNAL_PACKAGE ) @@ -558,15 +564,14 @@ macro(tribits_process_packages_and_dirs_lists REPOSITORY_NAME REPOSITORY_DIR) if (PACKAGE_EXISTS OR ${PROJECT_NAME}_IGNORE_PACKAGE_EXISTS_CHECK) list(APPEND ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES ${TRIBITS_PACKAGE}) - tribits_insert_standard_package_options(${TRIBITS_PACKAGE} - ${PACKAGE_TESTGROUP}) - set(${TRIBITS_PACKAGE}_PACKAGE_BUILD_STATUS INTERNAL) set(${TRIBITS_PACKAGE}_SOURCE_DIR "${PROJECT_SOURCE_DIR}/${REPOSITORY_AND_PACKAGE_DIR}") set(${TRIBITS_PACKAGE}_REL_SOURCE_DIR "${REPOSITORY_AND_PACKAGE_DIR}") set(${TRIBITS_PACKAGE}_PARENT_PACKAGE "") set(${TRIBITS_PACKAGE}_PARENT_REPOSITORY ${REPOSITORY_NAME}) + tribits_insert_standard_package_options(${TRIBITS_PACKAGE} ${PACKAGE_TESTGROUP}) + set(${TRIBITS_PACKAGE}_PACKAGE_BUILD_STATUS INTERNAL) else() if (${PROJECT_NAME}_VERBOSE_CONFIGURE) message( @@ -580,10 +585,14 @@ macro(tribits_process_packages_and_dirs_lists REPOSITORY_NAME REPOSITORY_DIR) # gets set to TRUE for some unit tests. Otherwise, in every legitimate # usage of this macro it is always FALSE. - if (TRIBITS_PROCESS_PACKAGES_AND_DIRS_LISTS_VERBOSE) + if (TRIBITS_PROCESS_PACKAGES_AND_DIRS_LISTS_VERBOSE + OR ${PROJECT_NAME}_VERBOSE_CONFIGURE + ) print_var(${TRIBITS_PACKAGE}_SOURCE_DIR) + print_var(${TRIBITS_PACKAGE}_REL_SOURCE_DIR) print_var(${TRIBITS_PACKAGE}_PARENT_PACKAGE) print_var(${TRIBITS_PACKAGE}_PARENT_REPOSITORY) + print_var(${TRIBITS_PACKAGE}_PACKAGE_BUILD_STATUS) endif() if (TRIBITS_PROCESS_PACKAGES_AND_DIRS_LISTS_VERBOSE) @@ -599,12 +608,6 @@ macro(tribits_process_packages_and_dirs_lists REPOSITORY_NAME REPOSITORY_DIR) math(EXPR ${PROJECT_NAME}_LAST_DEFINED_INTERNAL_TOPLEVEL_PACKAGE_IDX "${${PROJECT_NAME}_NUM_DEFINED_INTERNAL_TOPLEVEL_PACKAGES}-1") - # Create a reverse list for later use - - set(${PROJECT_NAME}_REVERSE_DEFINED_INTERNAL_TOPLEVEL_PACKAGES - ${${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES}) - list(REVERSE ${PROJECT_NAME}_REVERSE_DEFINED_INTERNAL_TOPLEVEL_PACKAGES) - else() set(${REPOSITORY_NAME}_NUM_DEFINED_INTERNAL_TOPLEVEL_PACKAGES 0) diff --git a/cmake/tribits/core/package_arch/TribitsProcessTplsLists.cmake b/cmake/tribits/core/package_arch/TribitsProcessTplsLists.cmake index 0a9c2ea486bd..611dcf3f73b2 100644 --- a/cmake/tribits/core/package_arch/TribitsProcessTplsLists.cmake +++ b/cmake/tribits/core/package_arch/TribitsProcessTplsLists.cmake @@ -138,6 +138,7 @@ endmacro() # * `${TPL_NAME}_TESTGROUP`_ # * `${TPL_NAME}_DEPENDENCIES_FILE`_ # * `${TPL_NAME}_TPLS_LIST_FILE`_ +# * `${TPL_NAME}_PACKAGE_BUILD_STATUS`_ (to ``EXTERNAL``) # # See `Function call tree for constructing package dependency graph`_ # @@ -216,10 +217,6 @@ macro(tribits_process_tpls_lists REPOSITORY_NAME REPOSITORY_DIR) list(APPEND ${PROJECT_NAME}_DEFINED_TPLS ${TPL_NAME}) endif() - # Set ${TPL_NAME}_PACKAGE_BUILD_STATUS - - set(${TPL_NAME}_PACKAGE_BUILD_STATUS EXTERNAL) - # Set ${TPL_NAME}_TESTGROUP if (TPL_TESTGROUP STREQUAL PT @@ -274,6 +271,10 @@ macro(tribits_process_tpls_lists REPOSITORY_NAME REPOSITORY_DIR) assert_defined(${REPOSITORY_NAME}_TPLS_FILE) set(${TPL_NAME}_TPLS_LIST_FILE ${${REPOSITORY_NAME}_TPLS_FILE}) + # Set ${TPL_NAME}_PACKAGE_BUILD_STATUS + + set(${TPL_NAME}_PACKAGE_BUILD_STATUS EXTERNAL) + # Print variables/properties for the TPL if (${PROJECT_NAME}_VERBOSE_CONFIGURE OR TRIBITS_PROCESS_TPLS_LISTS_VERBOSE) @@ -281,6 +282,7 @@ macro(tribits_process_tpls_lists REPOSITORY_NAME REPOSITORY_DIR) print_var(${TPL_NAME}_FINDMOD) print_var(${TPL_NAME}_DEPENDENCIES_FILE) print_var(${TPL_NAME}_TPLS_LIST_FILE) + print_var(${TPL_NAME}_PACKAGE_BUILD_STATUS) endif() # Set cache var TPL_ENABLE_${TPL_NAME} with default "" diff --git a/cmake/tribits/core/package_arch/TribitsProjectImpl.cmake b/cmake/tribits/core/package_arch/TribitsProjectImpl.cmake index fc9e30109206..892cecc6b6a3 100644 --- a/cmake/tribits/core/package_arch/TribitsProjectImpl.cmake +++ b/cmake/tribits/core/package_arch/TribitsProjectImpl.cmake @@ -117,7 +117,7 @@ macro(tribits_project_impl) # Since the version header file is now configured the root build # dir needs to be on the include path - include_directories(${CMAKE_CURRENT_BINARY_DIR}) + tribits_include_directories(${CMAKE_CURRENT_BINARY_DIR}) # # B) Set up user options and global variables that will be used throughout diff --git a/cmake/tribits/core/package_arch/TribitsReadAllProjectDepsFilesCreateDepsGraph.cmake b/cmake/tribits/core/package_arch/TribitsReadAllProjectDepsFilesCreateDepsGraph.cmake index 261d815f3e05..2b71d8288589 100644 --- a/cmake/tribits/core/package_arch/TribitsReadAllProjectDepsFilesCreateDepsGraph.cmake +++ b/cmake/tribits/core/package_arch/TribitsReadAllProjectDepsFilesCreateDepsGraph.cmake @@ -64,7 +64,6 @@ include(TimingUtils) # # * `Lists of external and internal packages`_ # * `Variables defining the package dependencies graph`_ -# (`Legacy list variables defining the package dependencies graph`_) # * `TriBITS Package Top-Level Local Variables`_ # * `TriBITS Subpackage Top-Level Local Variables`_ # * `TriBITS Package Cache Variables`_ @@ -238,14 +237,6 @@ macro(tribits_read_defined_external_and_internal_toplevel_packages_lists) # ${PROJECT_NAME}_NUM_DEFINED_TPLS list(LENGTH ${PROJECT_NAME}_DEFINED_TPLS ${PROJECT_NAME}_NUM_DEFINED_TPLS) - # ${PROJECT_NAME}_REVERSE_DEFINED_TPLS (ToDo: Remove the need for this #63) - if (${PROJECT_NAME}_DEFINED_TPLS) - set(${PROJECT_NAME}_REVERSE_DEFINED_TPLS ${${PROJECT_NAME}_DEFINED_TPLS}) - list(REVERSE ${PROJECT_NAME}_REVERSE_DEFINED_TPLS) - else() - set(${PROJECT_NAME}_REVERSE_DEFINED_TPLS) - endif() - # ${PROJECT_NAME}_DEFINED_TOPLEVEL_PACKAGES set(${PROJECT_NAME}_DEFINED_TOPLEVEL_PACKAGES ${${PROJECT_NAME}_DEFINED_TPLS} diff --git a/cmake/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake b/cmake/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake index c55673ee927b..9ec045e0099b 100644 --- a/cmake/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake +++ b/cmake/tribits/core/package_arch/TribitsReadDepsFilesCreateDepsGraph.cmake @@ -38,6 +38,7 @@ # @HEADER include(TribitsPackageDefineDependencies) +include(TribitsPackageDependencies) include(SetDefault) include(DualScopeSet) @@ -64,12 +65,12 @@ include(DualScopeSet) # # * `${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES`_ # -# as well creates the package dependency variables described in `Legacy list -# variables defining the package dependencies graph`_ that defines the -# directed acyclic dependency (DAG) package dependency graph (with navigation -# up and down the graph). +# as well creates the package dependency variables described in `Variables +# defining the package dependencies graph`_ that defines the directed acyclic +# dependency (DAG) package dependency graph (with navigation up and down the +# graph). # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_read_deps_files_create_deps_graph) @@ -91,20 +92,15 @@ endmacro() # Process any dependency logic at the repo level by loading # `/cmake/RepositoryDependenciesSetup.cmake`_ files. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_process_all_repository_deps_setup_files) - foreach(TIBITS_REPO ${${PROJECT_NAME}_ALL_REPOSITORIES}) + foreach(TIBITS_REPO IN LISTS ${PROJECT_NAME}_ALL_REPOSITORIES) tribits_get_repo_name_dir(${TIBITS_REPO} REPO_NAME REPO_DIR) tribits_set_base_repo_dir(${PROJECT_SOURCE_DIR} ${REPO_DIR} BASE_REPO_DIR) tribits_get_repo_name(${TIBITS_REPO} REPOSITORY_NAME) - #print_var(TIBITS_REPO) - #print_var(REPO_NAME) - #print_var(REPO_DIR) - #print_var(REPOSITORY_NAME) set(REPO_DEPENDENCIES_SETUP_FILE "${BASE_REPO_DIR}/cmake/RepositoryDependenciesSetup.cmake") - #print_var(REPO_DEPENDENCIES_SETUP_FILE) if (EXISTS ${REPO_DEPENDENCIES_SETUP_FILE}) tribits_trace_file_processing(REPOSITORY INCLUDE "${REPO_DEPENDENCIES_SETUP_FILE}") @@ -128,7 +124,7 @@ endmacro() # Process any dependency logic at the project level by loading the # `/cmake/ProjectDependenciesSetup.cmake`_ file # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_process_project_dependency_setup_file) set(PROJECT_DEPENDENCIES_SETUP_FILE @@ -170,33 +166,26 @@ endmacro() # # * `${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES`_ # -# as well creates the package dependency variables described in `Legacy list -# variables defining the package dependencies graph`_ that defines the -# directed acyclic dependency (DAG) package dependency graph (with navigation -# up and down the graph). +# as well creates the package dependency variables described in `Variables +# defining the package dependencies graph`_ that defines the directed acyclic +# dependency (DAG) package dependency graph (with navigation up and down the +# graph). # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_read_all_package_deps_files_create_deps_graph) - foreach(tribitsExternalPkg IN LISTS ${PROJECT_NAME}_DEFINED_TPLS) + foreach(tribitsExternalPkg IN LISTS ${PROJECT_NAME}_DEFINED_TPLS) tribits_read_external_package_deps_files_add_to_graph(${tribitsExternalPkg}) endforeach() set(${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES "") # Packages and subpackages - foreach(TRIBITS_PACKAGE IN LISTS ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES) + foreach(TRIBITS_PACKAGE IN LISTS ${PROJECT_NAME}_DEFINED_INTERNAL_TOPLEVEL_PACKAGES) tribits_read_toplevel_package_deps_files_add_to_graph(${TRIBITS_PACKAGE} ${${TRIBITS_PACKAGE}_REL_SOURCE_DIR}) endforeach() - # Create a reverse packages list for later use - set(${PROJECT_NAME}_REVERSE_DEFINED_INTERNAL_PACKAGES - ${${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES}) - if (${PROJECT_NAME}_REVERSE_DEFINED_INTERNAL_PACKAGES) - list(REVERSE ${PROJECT_NAME}_REVERSE_DEFINED_INTERNAL_PACKAGES) - endif() - list(LENGTH ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${PROJECT_NAME}_NUM_DEFINED_INTERNAL_PACKAGES) print_var(${PROJECT_NAME}_NUM_DEFINED_INTERNAL_PACKAGES) @@ -218,9 +207,13 @@ endmacro() # # _LIB_DEFINED_DEPENDENCIES # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_read_external_package_deps_files_add_to_graph tplName) + # Set up empty lists for forward dependencies + set(${tplName}_FORWARD_LIB_DEFINED_DEPENDENCIES "") + set(${tplName}_FORWARD_TEST_DEFINED_DEPENDENCIES "") + # Read in and process the external package/TPL dependency file if (IS_ABSOLUTE "${${tplName}_DEPENDENCIES_FILE}") set(absTplDepsFile "${${tplName}_DEPENDENCIES_FILE}") else() @@ -229,6 +222,10 @@ macro(tribits_read_external_package_deps_files_add_to_graph tplName) if (EXISTS "${absTplDepsFile}") tribits_trace_file_processing(TPL INCLUDE "${absTplDepsFile}") include(${absTplDepsFile}) + foreach(depPkg IN LISTS ${tplName}_LIB_DEFINED_DEPENDENCIES) + global_set(${tplName}_LIB_DEP_REQUIRED_${depPkg} TRUE) + endforeach() + tribits_append_forward_dep_packages(${tplName} LIB) endif() endmacro() @@ -242,21 +239,8 @@ endmacro() # Macro that reads in package dependencies for a top-level package from the # file `/cmake/Dependencies.cmake`_ and appends the forward # dependencies list vars for packages already read in for this package -# ````. -# -# Modifies the global variables:: -# -# ${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES -# ${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES -# ${PACKAGE_NAME}_TEST_REQUIRED_DEP_PACKAGES -# ${PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES -# _FORWARD_LIB_REQUIRED_DEP_PACKAGES -# _FORWARD_LIB_OPTIONAL_DEP_PACKAGES -# _FORWARD_TEST_REQUIRED_DEP_PACKAGES -# _FORWARD_TEST_OPTIONAL_DEP_PACKAGES -# -# (where ```` are upstream dependencies of this package -# ``${PACKAGE_NAME}``). +# ```` (see `Variables defining the package dependencies +# graph`_). # # It also appends the list variable: # @@ -266,11 +250,12 @@ endmacro() # order and then this top-level package is appended and dependencies are # created for them. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_read_toplevel_package_deps_files_add_to_graph PACKAGE_NAME) - # A) Get ready to read in the contents of this this pakages's Dependencies.cmake file + # A) Get ready to read in the contents of this package's Dependencies.cmake + # file tribits_prep_to_read_dependencies(${PACKAGE_NAME}) @@ -309,7 +294,7 @@ macro(tribits_read_toplevel_package_deps_files_add_to_graph PACKAGE_NAME) # Append the subpackages to the dependencies list if this top-level package set(SUBPACKAGE_IDX 0) - foreach(TRIBITS_SUBPACKAGE ${${PACKAGE_NAME}_SUBPACKAGES}) + foreach(TRIBITS_SUBPACKAGE IN LISTS ${PACKAGE_NAME}_SUBPACKAGES) set(SUBPACKAGE_FULLNAME ${PACKAGE_NAME}${TRIBITS_SUBPACKAGE}) list(GET ${PACKAGE_NAME}_SUBPACKAGE_OPTREQ ${SUBPACKAGE_IDX} SUBPACKAGE_OPTREQ) list(APPEND LIB_${SUBPACKAGE_OPTREQ}_DEP_PACKAGES ${SUBPACKAGE_FULLNAME}) @@ -342,49 +327,32 @@ endmacro() # # It also sets to empty the forward dependency list vars: # -# * `${PACKAGE_NAME}_FORWARD_LIB_DEP_PACKAGES`_ -# * `${PACKAGE_NAME}_FORWARD_TEST_DEP_PACKAGES`_ -# -# for each of the forward/downstream in `Variables defining the package -# dependencies graph`_. -# -# See `Function call tree for constructing package dependency graph`_ -# -# **__Legacy variables:__** +# * `${PACKAGE_NAME}_FORWARD_LIB_DEFINED_DEPENDENCIES`_ +# * `${PACKAGE_NAME}_FORWARD_TEST_DEFINED_DEPENDENCIES`_ # -# It also sets to empty the forward dependency list vars: -# -# _FORWARD_ +# for each of the forward/downstream package/dependency in `Variables defining +# the package dependencies graph`_. # -# for each of the forward/downstream in `Legacy list variables defining the -# package dependencies graph`_. +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_prep_to_read_dependencies PACKAGE_NAME_IN) # Initial vars that must be set in the Dependencies.cmake file - tribits_declare_undefined(LIB_REQUIRED_DEP_PACKAGES) tribits_declare_undefined(LIB_OPTIONAL_DEP_PACKAGES) tribits_declare_undefined(TEST_REQUIRED_DEP_PACKAGES) tribits_declare_undefined(TEST_OPTIONAL_DEP_PACKAGES) - tribits_declare_undefined(LIB_REQUIRED_DEP_TPLS "") - tribits_declare_undefined(LIB_OPTIONAL_DEP_TPLS "") - tribits_declare_undefined(TEST_REQUIRED_DEP_TPLS "") - tribits_declare_undefined(TEST_OPTIONAL_DEP_TPLS "") + tribits_declare_undefined(LIB_REQUIRED_DEP_TPLS) + tribits_declare_undefined(LIB_OPTIONAL_DEP_TPLS) + tribits_declare_undefined(TEST_REQUIRED_DEP_TPLS) + tribits_declare_undefined(TEST_OPTIONAL_DEP_TPLS) set(REGRESSION_EMAIL_LIST "") # Allow to be empty # Initialize other vars - - set(${PACKAGE_NAME_IN}_FORWARD_LIB_DEP_PACKAGES "") - set(${PACKAGE_NAME_IN}_FORWARD_TEST_DEP_PACKAGES "") - - # Legacy vars #63 - set(${PACKAGE_NAME_IN}_FORWARD_LIB_REQUIRED_DEP_PACKAGES "") - set(${PACKAGE_NAME_IN}_FORWARD_LIB_OPTIONAL_DEP_PACKAGES "") - set(${PACKAGE_NAME_IN}_FORWARD_TEST_REQUIRED_DEP_PACKAGES "") - set(${PACKAGE_NAME_IN}_FORWARD_TEST_OPTIONAL_DEP_PACKAGES "") + set(${PACKAGE_NAME_IN}_FORWARD_LIB_DEFINED_DEPENDENCIES "") + set(${PACKAGE_NAME_IN}_FORWARD_TEST_DEFINED_DEPENDENCIES "") endmacro() @@ -399,7 +367,7 @@ endmacro() # `tribits_package_define_dependencies()`_ in the file # `/cmake/Dependencies.cmake`_ have been set. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_assert_read_dependency_vars PACKAGE_NAME) @@ -424,7 +392,7 @@ endmacro() # # Saves off package dependency variables with variable suffix ``_``. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_save_off_dependency_vars POSTFIX) @@ -450,7 +418,7 @@ endmacro() # Read back the local package dependency vars from the saved-off vars with # suffix ``_``. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_read_back_dependencies_vars POSTFIX) @@ -473,46 +441,56 @@ endmacro() # # tribits_process_package_dependencies_lists() # -# Sets up the upstream and downstream/forward package dependency list -# variables for ```` described in `Legacy list variables defining -# the package dependencies graph`_. Note that the downstream/forward -# dependencies of upstream packages on this package ```` are -# built up incrementally. +# Sets up the upstream/backward and downstream/forward package dependency list +# variables for ```` described in `Variables defining the package +# dependencies graph`_. Note that the downstream/forward dependencies of +# upstream packages for this package ```` are built up +# incrementally. (The forward dependency list vars are initialized to empty +# in `tribits_prep_to_read_dependencies()`_.) # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # -macro(tribits_process_package_dependencies_lists PACKAGE_NAME) - - tribits_set_dep_packages(${PACKAGE_NAME} LIB REQUIRED) - tribits_set_dep_packages(${PACKAGE_NAME} LIB OPTIONAL) - tribits_set_dep_packages(${PACKAGE_NAME} TEST REQUIRED) - tribits_set_dep_packages(${PACKAGE_NAME} TEST OPTIONAL) - - set(${PACKAGE_NAME}_LIB_REQUIRED_DEP_TPLS ${LIB_REQUIRED_DEP_TPLS}) - set(${PACKAGE_NAME}_LIB_OPTIONAL_DEP_TPLS ${LIB_OPTIONAL_DEP_TPLS}) - set(${PACKAGE_NAME}_TEST_REQUIRED_DEP_TPLS ${TEST_REQUIRED_DEP_TPLS}) - set(${PACKAGE_NAME}_TEST_OPTIONAL_DEP_TPLS ${TEST_OPTIONAL_DEP_TPLS}) - - tribits_append_forward_dep_packages(${PACKAGE_NAME} LIB_REQUIRED_DEP_PACKAGES) - tribits_append_forward_dep_packages(${PACKAGE_NAME} LIB_OPTIONAL_DEP_PACKAGES) - tribits_append_forward_dep_packages(${PACKAGE_NAME} TEST_REQUIRED_DEP_PACKAGES) - tribits_append_forward_dep_packages(${PACKAGE_NAME} TEST_OPTIONAL_DEP_PACKAGES) +macro(tribits_process_package_dependencies_lists packageName) + + # Initialize backward dep vars + set(${packageName}_LIB_DEFINED_DEPENDENCIES "") + set(${packageName}_TEST_DEFINED_DEPENDENCIES "") + + # Fill the backward dependency vars + tribits_set_dep_packages(${packageName} LIB REQUIRED PACKAGES) + tribits_set_dep_packages(${packageName} LIB OPTIONAL PACKAGES) + tribits_set_dep_packages(${packageName} LIB REQUIRED TPLS) + tribits_set_dep_packages(${packageName} LIB OPTIONAL TPLS) + tribits_set_dep_packages(${packageName} TEST REQUIRED PACKAGES) + tribits_set_dep_packages(${packageName} TEST OPTIONAL PACKAGES) + tribits_set_dep_packages(${packageName} TEST REQUIRED TPLS) + tribits_set_dep_packages(${packageName} TEST OPTIONAL TPLS) + + # Fill forward deps lists #63 + tribits_append_forward_dep_packages(${packageName} LIB) + tribits_append_forward_dep_packages(${packageName} TEST) endmacro() -# @FUNCTION: tribits_set_dep_packages() +# @MACRO: tribits_set_dep_packages() +# +# Macro set up backward package dependency lists for a given package given the +# vars read in from the macro `tribits_package_define_dependencies()`_. # # Usage:: # -# tribits_set_dep_packages( LIB|TEST REQUIRED|OPTIONAL) +# tribits_set_dep_packages( ) +# +# where: +# +# * ````: ``LIB`` or ``TEST`` +# * ````: ``REQUIRED`` or ``OPTIONAL`` +# * ````: ``PACKAGES`` or ``TPLS`` # -# Function that helps to set up backward package dependency lists for a given -# package given the vars read in from the macro -# `tribits_package_define_dependencies()`_. # # Sets the upstream/backward dependency variables defined in the section -# `Legacy list variables defining the package dependencies graph`_. +# `Variables defining the package dependencies graph`_. # # This also handles the several types of issues: # @@ -523,124 +501,149 @@ endmacro() # `tribits_abort_on_missing_package()`_ or allow to be missing and disable # this package if this is a required dependency). # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # -function(tribits_set_dep_packages PACKAGE_NAME LIB_OR_TEST REQUIRED_OR_OPTIONAL) - - if (TRIBITS_SET_DEP_PACKAGES_DEBUG_DUMP) - message("\nTRIBITS_SET_DEP_PACKAGES: ${PACKAGE_NAME} ${LIB_OR_TEST} ${REQUIRED_OR_OPTIONAL})") - endif() +macro(tribits_set_dep_packages packageName testOrLib requiredOrOptional pkgsOrTpls) - set(LIST_TYPE ${LIB_OR_TEST}_${REQUIRED_OR_OPTIONAL}_DEP_PACKAGES) - set(PACKAGE_DEPS_LIST "") - set(PACKAGE_ENABLE_VAR ${PROJECT_NAME}_ENABLE_${PACKAGE_NAME}) + set(inputListType ${testOrLib}_${requiredOrOptional}_DEP_${pkgsOrTpls}) + set(packageEnableVar ${PROJECT_NAME}_ENABLE_${packageName}) - foreach(DEP_PKG ${${LIST_TYPE}}) - if (TRIBITS_SET_DEP_PACKAGES_DEBUG_DUMP) - print_var(DEP_PKG) - endif() - if (${DEP_PKG} STREQUAL ${PACKAGE_NAME}) - tribits_abort_on_self_dep("${PACKAGE_NAME}" "${LIST_TYPE}") - endif() - if (${DEP_PKG}_SOURCE_DIR) - set(DEP_PKG_DEFINED_AND_EXISTS TRUE) - else() - set(DEP_PKG_DEFINED_AND_EXISTS FALSE) - endif() - if (TRIBITS_SET_DEP_PACKAGES_DEBUG_DUMP) - print_var(DEP_PKG_DEFINED_AND_EXISTS) + foreach(depPkg IN LISTS ${inputListType}) + if (${depPkg} STREQUAL ${packageName}) + tribits_abort_on_self_dep("${packageName}" "${inputListType}") endif() - if (DEP_PKG_DEFINED_AND_EXISTS) - list(APPEND PACKAGE_DEPS_LIST ${DEP_PKG}) - else() - if (${PROJECT_NAME}_ASSERT_MISSING_PACKAGES - AND NOT ${DEP_PKG}_ALLOW_MISSING_EXTERNAL_PACKAGE - ) - tribits_abort_on_missing_package( - "${DEP_PKG}" "${PACKAGE_NAME}" "${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES") + tribits_is_pkg_defined(${depPkg} ${pkgsOrTpls} depPkgIsDefined) + if (depPkgIsDefined) + list(APPEND ${packageName}_${testOrLib}_DEFINED_DEPENDENCIES ${depPkg}) + if ("${requiredOrOptional}" STREQUAL "REQUIRED") + global_set(${packageName}_${testOrLib}_DEP_REQUIRED_${depPkg} TRUE) + elseif ("${requiredOrOptional}" STREQUAL "OPTIONAL") + global_set(${packageName}_${testOrLib}_DEP_REQUIRED_${depPkg} FALSE) else() - if (${DEP_PKG}_ALLOW_MISSING_EXTERNAL_PACKAGE) - if (${PROJECT_NAME}_WARN_ABOUT_MISSING_EXTERNAL_PACKAGES) - message_wrapper("NOTE: ${DEP_PKG} is being ignored since its directory" - " is missing and ${DEP_PKG}_ALLOW_MISSING_EXTERNAL_PACKAGE =" - " ${${DEP_PKG}_ALLOW_MISSING_EXTERNAL_PACKAGE}!") - endif() - if (REQUIRED_OR_OPTIONAL STREQUAL "REQUIRED") - message_wrapper("NOTE: Setting ${PACKAGE_ENABLE_VAR}=OFF because" - " package ${PACKAGE_NAME} has a required dependency on missing" - " package ${DEP_PKG}!") - dual_scope_set(${PACKAGE_ENABLE_VAR} OFF) - endif() - endif() - if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - message( - "\n***" - "\n*** NOTE: The package ${DEP_PKG} which is a dependent package of" - " ${PACKAGE_NAME} being ignored because ${DEP_PKG} is missing!" - "\n***\n" ) - endif() - # Must set enable vars for missing package to off so that logic in - # existing downstream packages that key off of these vars will still - # work. - dual_scope_set(${PROJECT_NAME}_ENABLE_${DEP_PKG} OFF) - dual_scope_set(${PACKAGE_NAME}_ENABLE_${DEP_PKG} OFF) + message(FATAL_ERROR + "Invalid value for requiredOrOptional='${requiredOrOptional}'!") endif() + else() + tribits_set_dep_packages__handle_undefined_pkg(${packageName} ${depPkg} + ${requiredOrOptional} ${pkgsOrTpls} ${packageEnableVar}) endif() endforeach() - #print_var(PACKAGE_DEPS_LIST) +endmacro() - global_set(${PACKAGE_NAME}_${LIST_TYPE} ${PACKAGE_DEPS_LIST}) +# Determine if a (internal or external) package is defined or not +# +function(tribits_is_pkg_defined depPkg pkgsOrTpls depPkgIsDefinedOut) + set(depPkgIsDefined FALSE) + if (pkgsOrTpls STREQUAL "PACKAGES") + if (${depPkg}_SOURCE_DIR) + set(depPkgIsDefined TRUE) + endif() + elseif(pkgsOrTpls STREQUAL "TPLS") + if (${depPkg}_FINDMOD) + set(depPkgIsDefined TRUE) + endif() + else() + message(FATAL_ERROR "Invalid value for pkgsOrTpls = '${pkgsOrTpls}'") + endif() + set(${depPkgIsDefinedOut} ${depPkgIsDefined} PARENT_SCOPE) endfunction() -# @FUNCTION: tribits_append_forward_dep_packages() +# Implementation macro for tribits_set_dep_packages() to deal with a package +# that is not defined by TriBITS. # -# Usage: tribits_append_forward_dep_packages( ) +# ToDo #63: This may need to be modified when dealing with TriBITS-compatible +# packages already installed out on the system. We may need a mode where we +# don't assert packages that are not defined but instead just assume they are +# TriBITS-compatible packages already installed. +# +macro(tribits_set_dep_packages__handle_undefined_pkg packageName depPkg + requiredOrOptional pkgsOrTpls packageEnableVar + ) + # Determine if it is allowed for this depPkg to not be defined + set(errorOutForUndefinedDepPkg TRUE) + if (${depPkg}_ALLOW_MISSING_EXTERNAL_PACKAGE) + set(errorOutForUndefinedDepPkg FALSE) + elseif (NOT ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES IN_LIST + ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_ERROR_VALUES_LIST + ) + set(errorOutForUndefinedDepPkg FALSE) + endif() + # Produce error or deal with allowed undefined ${depPkg} + if (errorOutForUndefinedDepPkg) + tribits_abort_on_missing_package("${depPkg}" "${packageName}") + else() + if (${depPkg}_ALLOW_MISSING_EXTERNAL_PACKAGE) + if (${PROJECT_NAME}_WARN_ABOUT_MISSING_EXTERNAL_PACKAGES) + message_wrapper("NOTE: ${depPkg} is being ignored since its directory" + " is missing and ${depPkg}_ALLOW_MISSING_EXTERNAL_PACKAGE =" + " ${${depPkg}_ALLOW_MISSING_EXTERNAL_PACKAGE}!") + endif() + if ("${requiredOrOptional}" STREQUAL "REQUIRED") + message_wrapper("NOTE: Setting ${packageEnableVar}=OFF because" + " package ${packageName} has a required dependency on missing" + " package ${depPkg}!") + set(${packageEnableVar} OFF) + endif() + endif() + # Must set enable vars for missing package to off so that logic in + # existing downstream packages that key off of these vars will still + # work. + set(${PROJECT_NAME}_ENABLE_${depPkg} OFF) + set(${packageName}_ENABLE_${depPkg} OFF) + endif() +endmacro() + + +# @MACRO: tribits_append_forward_dep_packages() # -# Function that helps to set up forward package dependency lists for an -# upstream package given that a downstream package declared a dependency on -# it. In particular, it appends the var:: +# Appends forward/downstream package dependency lists for the upstream +# dependent package list provided. +# +# Usage:: +# +# tribits_append_forward_dep_packages( ) +# +# In particular, it appends the var:: # # _FORWARD_ # -# for one of the vars listed in `Legacy list variables defining the package -# dependencies graph`_. +# for one of the vars listed in `Variables defining the package dependencies +# graph`_. # # This function is called multiple times to build up the forward package # dependencies for a given ```` by the downstream packages that # declare dependencies on it. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # -function(tribits_append_forward_dep_packages PACKAGE_NAME LIST_TYPE) - - set(DEP_PKG_LIST_NAME "${PACKAGE_NAME}_${LIST_TYPE}") +macro(tribits_append_forward_dep_packages packageName libOrTest) - assert_defined(${PROJECT_NAME}_ASSERT_MISSING_PACKAGES) - foreach(DEP_PKG ${${DEP_PKG_LIST_NAME}}) - set(FWD_DEP_PKG_LIST_NAME "${DEP_PKG}_FORWARD_${LIST_TYPE}") - if (NOT DEFINED ${FWD_DEP_PKG_LIST_NAME}) - if (${PROJECT_NAME}_ASSERT_MISSING_PACKAGES) - tribits_abort_on_missing_package(${DEP_PKG} ${PACKAGE_NAME} ${DEP_PKG_LIST_NAME}) + foreach(depPkg IN LISTS ${packageName}_${libOrTest}_DEFINED_DEPENDENCIES) + set(fwdDepPkgListName ${depPkg}_FORWARD_${libOrTest}_DEFINED_DEPENDENCIES) + if (DEFINED ${fwdDepPkgListName}) + list(APPEND ${fwdDepPkgListName} ${packageName}) + else() + if (${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES IN_LIST + ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_ERROR_VALUES_LIST + ) + tribits_abort_on_missing_package(${depPkg} ${packageName}) else() if (${PROJECT_NAME}_VERBOSE_CONFIGURE) message( "\n***" - "\n*** NOTE: The package ${DEP_PKG} has forward dependent package" - " ${PACKAGE_NAME}, but that dependency is being ignored because the package" - " ${DEP_PKG} is missing!" + "\n*** NOTE: The package ${depPkg} has forward dependent package" + " ${packageName}, but that dependency is being ignored because the package" + " ${depPkg} is missing!" "\n***\n" ) endif() endif() - else() - set(${FWD_DEP_PKG_LIST_NAME} ${${FWD_DEP_PKG_LIST_NAME}} ${PACKAGE_NAME} - PARENT_SCOPE) endif() endforeach() -endfunction() +endmacro() # @MACRO: tribits_set_package_regression_email_list() @@ -652,9 +655,9 @@ endfunction() # Macro that sets a pacakge's regression email address # ``${PACKAGE_NAME}_REGRESSION_EMAIL_LIST`` as described in ???. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # -macro(tribits_set_package_regression_email_list PACKAGE_NAME) +macro(tribits_set_package_regression_email_list PACKAGE_NAME) # Lower-case package name To be used with auto email naming based on base email address string(TOLOWER "${PACKAGE_NAME}" LPACKAGE) @@ -663,7 +666,6 @@ macro(tribits_set_package_regression_email_list PACKAGE_NAME) endif() tribits_get_repo_name(${${PACKAGE_NAME}_PARENT_REPOSITORY} REPOSITORY_NAME) - #print_var(REPOSITORY_NAME) if(${REPOSITORY_NAME}_REPOSITORY_OVERRIDE_PACKAGE_EMAIL_LIST) set(${PACKAGE_NAME}_REGRESSION_EMAIL_LIST @@ -697,25 +699,28 @@ endmacro() # # Usage:: # -# tribits_abort_on_missing_package( ) +# tribits_abort_on_missing_package( ) # # Function that creates error message about missing/misspelled package. This # error message also suggests that the package might be defining an upstream # dependency on a downstream dependency (i.e. a circular dependency). # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # -function(tribits_abort_on_missing_package DEP_PKG PACKAGE_NAME DEP_PKG_LIST_NAME) +function(tribits_abort_on_missing_package depPkg packageName) multiline_set(ERRMSG - "Error, the package '${DEP_PKG}' is listed as a dependency of the package" - " '${PACKAGE_NAME}' is in the list '${DEP_PKG_LIST_NAME}' but the package" - " '${DEP_PKG}' is either not defined or is listed later in the package order." + "Error, the package '${depPkg}' is listed as a dependency of the package" + " '${packageName}' but the package '${depPkg}' is either not defined or" + " is listed later in the package order." " This may also be an attempt to create a circular dependency between" - " the packages '${DEP_PKG}' and '${PACKAGE_NAME}' (which is not allowed)." - " Check the spelling of '${DEP_PKG}' or see how it is listed in" + " the packages '${depPkg}' and '${packageName}' (which is not allowed)." + " Check the spelling of '${depPkg}' or see how it is listed in" " a call to tribits_repository_define_packages() in relation to" - " '${PACKAGE_NAME}'.") - message(FATAL_ERROR ${ERRMSG}) + " '${packageName}'." + " To ignore/disable the undefined package '${depPkg}', set the cache" + " variable ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES=IGNORE." + ) + message(${${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES} "${ERRMSG}") endfunction() @@ -728,7 +733,7 @@ endfunction() # Prints a fatal error message for an attempt for a self dependency # declaration and which list it comes from. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # function(tribits_abort_on_self_dep PACKAGE_NAME DEP_PKG_LIST_NAME) multiline_set(ERRMSG @@ -747,14 +752,15 @@ endfunction() # # Usage:: # -# tribits_parse_subpackages_append_packages_add_options() +# tribits_parse_subpackages_append_packages_add_options() # # Macro that parses the read-in variable # ``SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS`` set by the macro # `tribits_package_define_dependencies()`_ , adds subpackages to the list of # defined packages, and defines user cache var options for those subpackages. # -# This sets the list variables for the parent package ````:: +# This sets the list variables for the parent package +# ````:: # # _SUBPACKAGES # _SUBPACKAGE_DIRS @@ -767,108 +773,102 @@ endfunction() # _PARENT_PACKAGE # _PARENT_REPOSITORY # -# And it appends for each subpackage to variable: +# And it appends each subpackage to the list variable: # # * `${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES`_ # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # -macro(tribits_parse_subpackages_append_packages_add_options - PACKAGE_NAME - ) +macro(tribits_parse_subpackages_append_packages_add_options parentPackageName) - # Structure of SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS + # Fields in the list var SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS set(SPDC_SP_NAME_OFFSET 0) set(SPDC_SP_DIR_OFFSET 1) set(SPDC_SP_CLASSIFICATION_OFFSET 2) set(SPDC_SP_OPTREQ_OFFSET 3) - set(SPDC_NUM_FIELDS 4) + set(SPDC_NUM_FIELDS 4) # Number of the above files - set(${PACKAGE_NAME}_SUBPACKAGES "") - set(${PACKAGE_NAME}_SUBPACKAGE_DIRS "") - set(${PACKAGE_NAME}_SUBPACKAGE_OPTREQ "") + set(${parentPackageName}_SUBPACKAGES "") + set(${parentPackageName}_SUBPACKAGE_DIRS "") + set(${parentPackageName}_SUBPACKAGE_OPTREQ "") if (SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS) - list(LENGTH SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS SPDC_TOTAL_LENGTH) - math(EXPR NUM_SUBPACKAGES "${SPDC_TOTAL_LENGTH}/${SPDC_NUM_FIELDS}") - math(EXPR SUBPACKAGES_LAST_IDX "${NUM_SUBPACKAGES}-1") - - foreach(SUBPACKAGE_IDX RANGE ${SUBPACKAGES_LAST_IDX}) + list(LENGTH SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS SPDC_TOTAL_LENGTH) + math(EXPR numSubpackages "${SPDC_TOTAL_LENGTH}/${SPDC_NUM_FIELDS}") + math(EXPR subpackagesLastIdx "${numSubpackages}-1") - #message("") - #print_var(SUBPACKAGE_IDX) + foreach(SUBPACKAGE_IDX RANGE ${subpackagesLastIdx}) - # SUBPACKAGE_NAME - math(EXPR SUBPACKAGE_NAME_IDX + # subpkgName + math(EXPR subpkgNameIdx "${SUBPACKAGE_IDX}*${SPDC_NUM_FIELDS}+${SPDC_SP_NAME_OFFSET}") - list(GET SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS ${SUBPACKAGE_NAME_IDX} - SUBPACKAGE_NAME ) + list(GET SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS ${subpkgNameIdx} subpkgName) - set(SUBPACKAGE_FULLNAME ${PACKAGE_NAME}${SUBPACKAGE_NAME}) + # subpkgFullname + set(subpkgFullname ${parentPackageName}${subpkgName}) - # SUBPACKAGE_DIR - math(EXPR SUBPACKAGE_DIR_IDX + # subpkgDir + math(EXPR subpkgDirIdx "${SUBPACKAGE_IDX}*${SPDC_NUM_FIELDS}+${SPDC_SP_DIR_OFFSET}") - list(GET SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS ${SUBPACKAGE_DIR_IDX} - SUBPACKAGE_DIR ) + list(GET SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS ${subpkgDirIdx} subpkgDir) - # SUBPACKAGE_CLASSIFICATION - math(EXPR SUBPACKAGE_CLASSIFICATION_IDX + # subpkgClassification + math(EXPR subpkgClassificationIdx "${SUBPACKAGE_IDX}*${SPDC_NUM_FIELDS}+${SPDC_SP_CLASSIFICATION_OFFSET}") - list(GET SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS ${SUBPACKAGE_CLASSIFICATION_IDX} - SUBPACKAGE_CLASSIFICATION ) + list(GET SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS ${subpkgClassificationIdx} + subpkgClassification ) # ToDo: Parse out TESTGROUP and MATURITYLEVEL (Trilinos #6042) - set(SUBPACKAGE_TESTGROUP ${SUBPACKAGE_CLASSIFICATION}) + set(subpkgTestgroup ${subpkgClassification}) - tribits_update_ps_pt_ss_st(Subpackage ${SUBPACKAGE_FULLNAME} SUBPACKAGE_TESTGROUP) + tribits_update_ps_pt_ss_st(Subpackage ${subpkgFullname} subpkgTestgroup) - # SUBPACKAGE_OPTREQ - math(EXPR SUBPACKAGE_OPTREQ_IDX + # subpkgOptreq + math(EXPR subpkgOptreqIdx "${SUBPACKAGE_IDX}*${SPDC_NUM_FIELDS}+${SPDC_SP_OPTREQ_OFFSET}") - list(GET SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS ${SUBPACKAGE_OPTREQ_IDX} - SUBPACKAGE_OPTREQ ) + list(GET SUBPACKAGES_DIRS_CLASSIFICATIONS_OPTREQS ${subpkgOptreqIdx} + subpkgOptreq ) # Determine if this subpackage exists - set(SUBPACKAGE_FULL_SOURCE_DIR - ${PROJECT_SOURCE_DIR}/${${PACKAGE_NAME}_REL_SOURCE_DIR}/${SUBPACKAGE_DIR}) - if (EXISTS ${SUBPACKAGE_FULL_SOURCE_DIR}) - set(SUBPACKAGE_EXISTS TRUE) + set(subpkgFullSrcDir + "${PROJECT_SOURCE_DIR}/${${parentPackageName}_REL_SOURCE_DIR}/${subpkgDir}") + if (EXISTS "${subpkgFullSrcDir}") + set(subpkgExists TRUE) else() - set(SUBPACKAGE_EXISTS FALSE) + set(subpkgExists FALSE) endif() - if (NOT SUBPACKAGE_EXISTS AND ${PROJECT_NAME}_ASSERT_MISSING_PACKAGES) - message(SEND_ERROR "ERROR: Subpackage dir '${SUBPACKAGE_FULL_SOURCE_DIR}'" - " is missing!") + if (NOT subpkgExists AND ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES IN_LIST + ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_ERROR_VALUES_LIST + ) + message(SEND_ERROR "ERROR: Subpackage dir '${subpkgFullSrcDir}' is missing!") endif() # Append to lists and global variables - if (SUBPACKAGE_EXISTS) + if (subpkgExists) - list(APPEND ${PACKAGE_NAME}_SUBPACKAGES ${SUBPACKAGE_NAME}) - list(APPEND ${PACKAGE_NAME}_SUBPACKAGE_DIRS ${SUBPACKAGE_DIR}) - list(APPEND ${PACKAGE_NAME}_SUBPACKAGE_OPTREQ ${SUBPACKAGE_OPTREQ}) - list(APPEND ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${SUBPACKAGE_FULLNAME}) - set(${SUBPACKAGE_FULLNAME}_SOURCE_DIR "${SUBPACKAGE_FULL_SOURCE_DIR}") - set(${SUBPACKAGE_FULLNAME}_REL_SOURCE_DIR - "${${PACKAGE_NAME}_REL_SOURCE_DIR}/${SUBPACKAGE_DIR}") - set(${SUBPACKAGE_FULLNAME}_PARENT_PACKAGE ${PACKAGE_NAME}) - set(${SUBPACKAGE_FULLNAME}_PARENT_REPOSITORY - ${${PACKAGE_NAME}_PARENT_REPOSITORY}) + list(APPEND ${parentPackageName}_SUBPACKAGES ${subpkgName}) + list(APPEND ${parentPackageName}_SUBPACKAGE_DIRS ${subpkgDir}) + list(APPEND ${parentPackageName}_SUBPACKAGE_OPTREQ ${subpkgOptreq}) + list(APPEND ${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES ${subpkgFullname}) + set(${subpkgFullname}_SOURCE_DIR "${subpkgFullSrcDir}") + set(${subpkgFullname}_REL_SOURCE_DIR + "${${parentPackageName}_REL_SOURCE_DIR}/${subpkgDir}") + set(${subpkgFullname}_PARENT_PACKAGE ${parentPackageName}) + set(${subpkgFullname}_PARENT_REPOSITORY + ${${parentPackageName}_PARENT_REPOSITORY}) if (${PROJECT_NAME}_VERBOSE_CONFIGURE) - print_var(${SUBPACKAGE_FULLNAME}_PARENT_PACKAGE) - print_var(${SUBPACKAGE_FULLNAME}_PARENT_REPOSITORY) + print_var(${subpkgFullname}_PARENT_PACKAGE) + print_var(${subpkgFullname}_PARENT_REPOSITORY) endif() - set(${SUBPACKAGE_FULLNAME}_PACKAGE_BUILD_STATUS INTERNAL) + set(${subpkgFullname}_PACKAGE_BUILD_STATUS INTERNAL) # Set up the input options for this subpackage - tribits_insert_standard_package_options(${SUBPACKAGE_FULLNAME} - ${SUBPACKAGE_TESTGROUP}) + tribits_insert_standard_package_options(${subpkgFullname} ${subpkgTestgroup}) endif() @@ -876,9 +876,6 @@ macro(tribits_parse_subpackages_append_packages_add_options endif() - #print_var(${PACKAGE_NAME}_SUBPACKAGES) - #print_var(${PACKAGE_NAME}_SUBPACKAGE_OPTREQ) - endmacro() @@ -891,16 +888,12 @@ endmacro() # Read in subpackages dependencies files and add to dependencies graph # variables. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_read_package_subpackage_deps_files_add_to_graph PACKAGE_NAME) - #message("TRIBITS_READ_PACKAGE_SUBPACKAGE_DEPS_FILES_ADD_TO_GRAPH: ${PACKAGE_NAME}") - - #print_var(${PROJECT_NAME}_DEFINED_INTERNAL_PACKAGES) - set(SUBPACKAGE_IDX 0) - foreach(TRIBITS_SUBPACKAGE ${${PACKAGE_NAME}_SUBPACKAGES}) + foreach(TRIBITS_SUBPACKAGE IN LISTS ${PACKAGE_NAME}_SUBPACKAGES) list(GET ${PACKAGE_NAME}_SUBPACKAGE_DIRS ${SUBPACKAGE_IDX} SUBPACKAGE_DIR) tribits_read_subpackage_deps_file_add_to_graph(${TRIBITS_PACKAGE} ${TRIBITS_SUBPACKAGE} ${SUBPACKAGE_DIR}) @@ -921,14 +914,12 @@ endmacro() # `//cmake/Dependencies.cmake`_ and sets up the # dependency structure for it. # -# See `Function call tree for constructing package dependency graph`_ +# See `Function call tree for constructing package dependency graph`_. # macro(tribits_read_subpackage_deps_file_add_to_graph PACKAGE_NAME SUBPACKAGE_NAME SUBPACKAGE_DIR ) - #message("TRIBITS_READ_SUBPACKAGE_DEPS_FILE_ADD_TO_GRAPH: ${PACKAGE_NAME} ${SUBPACKAGE_NAME} ${SUBPACKAGE_DIR}") - set(SUBPACKAGE_FULLNAME ${PACKAGE_NAME}${SUBPACKAGE_NAME}) # @@ -958,7 +949,9 @@ macro(tribits_read_subpackage_deps_file_add_to_graph PACKAGE_NAME set(SUBPACKAGE_EXISTS FALSE) endif() - if (SUBPACKAGE_EXISTS OR ${PROJECT_NAME}_ASSERT_MISSING_PACKAGES) + if (SUBPACKAGE_EXISTS OR ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES IN_LIST + ${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_ERROR_VALUES_LIST + ) tribits_trace_file_processing(PACKAGE INCLUDE "${SUBPAKCAGE_DEPENDENCIES_FILE}") include(${SUBPAKCAGE_DEPENDENCIES_FILE}) diff --git a/cmake/tribits/core/package_arch/TribitsReportInvalidTribitsUsage.cmake b/cmake/tribits/core/package_arch/TribitsReportInvalidTribitsUsage.cmake index 442a4928fbcd..0a40deaa928e 100644 --- a/cmake/tribits/core/package_arch/TribitsReportInvalidTribitsUsage.cmake +++ b/cmake/tribits/core/package_arch/TribitsReportInvalidTribitsUsage.cmake @@ -53,6 +53,7 @@ include(MessageWrapper) # * FATAL_ERROR: Calls message(FATAL_ERROR "") # * SEND_ERROR: Calls message(SEND_ERROR "") # * WARNING: Calls message(WARNING "") +# * NOTICE: Calls message(NOTICE "") # * IGNORE: Does not call message() at all and is silent # # If '${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE}' is empty on call, then @@ -60,24 +61,14 @@ include(MessageWrapper) # function(tribits_report_invalid_tribits_usage) if ("${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE}" STREQUAL "") - set(${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE FATAL_ERROR) + set(${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE FATAL_ERROR) endif() - set(PRINT_ERR_MSG) - if (${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE STREQUAL "FATAL_ERROR") - set(PRINT_ERR_MSG FATAL_ERROR) - elseif (${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE STREQUAL "SEND_ERROR") - set(PRINT_ERR_MSG SEND_ERROR) - elseif (${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE STREQUAL "WARNING") - set(PRINT_ERR_MSG WARNING) - elseif (${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE STREQUAL "IGNORE") - set(PRINT_ERR_MSG) - else() - message_wrapper(FATAL_ERROR "Error, invalid value for" - " ${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE =" - " '${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE}'!" - " Value values include 'FATAL_ERROR', 'SEND_ERROR', 'WARNING', and 'IGNORE'!") + set(printErrMsgMode ${${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE}) + set(ignoreValues "IGNORE" "OFF") + if(${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE IN_LIST ignoreValues) + set(printErrMsgMode "") endif() - if (PRINT_ERR_MSG) - message_wrapper(${PRINT_ERR_MSG} ${ARGN}) + if (printErrMsgMode) + message_wrapper(${printErrMsgMode} ${ARGN}) endif() endfunction() diff --git a/cmake/tribits/core/package_arch/TribitsSetAndIncDirs.cmake b/cmake/tribits/core/package_arch/TribitsSetAndIncDirs.cmake new file mode 100644 index 000000000000..55991e4fdb63 --- /dev/null +++ b/cmake/tribits/core/package_arch/TribitsSetAndIncDirs.cmake @@ -0,0 +1,66 @@ +# @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 + + +# @MACRO: tribits_set_and_inc_dirs() +# +# Set a variable to an include directory and call +# `tribits_include_directories()`_ (removes boiler-plate code). +# +# Usage: +# +# tribits_set_and_inc_dirs( ) +# +# On output, this sets ```` to ```` in the local scope +# and calls ``tribits_include_directories()``. +# +macro(tribits_set_and_inc_dirs dirVarName includeDir) + set(${dirVarName} ${includeDir}) + tribits_include_directories(${${dirVarName}}) +endmacro() + + +# Deprecated! Use tribits_set_and_inc_dirs() instead! +# +macro(set_and_inc_dirs DIR_VAR_NAME INCLUDE_DIR) + tribits_deprecated_command(set_and_inc_dirs + MESSAGE "Use tribits_set_and_inc_dirs() instead." ) + set(${DIR_VAR_NAME} ${INCLUDE_DIR}) + tribits_include_directories(${${DIR_VAR_NAME}}) +endmacro() diff --git a/cmake/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake b/cmake/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake new file mode 100644 index 000000000000..9e5900114bc0 --- /dev/null +++ b/cmake/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake @@ -0,0 +1,237 @@ +# @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 + +include(TribitsDeprecatedHelpers) + + +# Function that creates enable-only dependency data-structures +# +# For each enabled package ``, this function sets up the global list +# var:: +# +# _FULL_ENABLED_DEP_PACKAGES +# +# If ``${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES`` is +# set, then ``_FULL_ENABLED_DEP_PACKAGES`` will only be sets for +# those packages. Otherwise, ``_FULL_ENABLED_DEP_PACKAGES`` will be +# set for all packages listed in `${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES`_. +# +# NOTE: The modern TriBITS implementation does not need this full list of +# dependencies for each package. Only the function +# `tribits_find_most_recent_file_timestamp()` needs this. (Therefore, this +# could not be striped out of TriBITS because there are still some projects +# that use this function.) +# +function(tribits_set_up_enabled_only_dependencies) + + set(GENERATE_EXPORT_DEPENDENCIES ${${PROJECT_NAME}_GENERATE_EXPORT_FILE_DEPENDENCIES}) + if ("${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES}" STREQUAL "" + AND NOT + "${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES}" STREQUAL "" + ) + tribits_deprecated( + "The cache var" + " ${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES" + "='${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES}'" + " is deprecated! Please instead set" + " ${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES" + "='${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES}'") + set(${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES + ${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES} ) + endif() + + # Determine lastExportTribitsPackage if not to generate any of these full + # dependency lists + set(lastExportTribitsPackage "") + if (GENERATE_EXPORT_DEPENDENCIES + AND ${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES + ) + # Find the last enabled package for which an export file is requested. + set(LAST_PKG_IDX -1) + set(LAST_PKG) + foreach(tribitsPkg IN LISTS + ${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_PACKAGES + ) + set(PKG_IDX ${${tribitsPkg}_PKG_IDX}) + if (NOT "${PKG_IDX}" STREQUAL "") + # The listed package is enabled so we will consider it + if (PKG_IDX GREATER ${LAST_PKG_IDX}) + set(LAST_PKG_IDX ${PKG_IDX}) + set(LAST_PKG ${tribitsPkg}) + endif() + endif() + endforeach() + if (LAST_PKG) + # At least one listed package was enabled + set(lastExportTribitsPackage ${LAST_PKG}) + else() + # None of the listed packages were enabled so don't bother generating + # any export dependencies + set(GENERATE_EXPORT_DEPENDENCIES FALSE) + endif() + + endif() + + if (GENERATE_EXPORT_DEPENDENCIES) + + if (lastExportTribitsPackage) + message("\nSetting up export dependencies up through ${lastExportTribitsPackage} ...\n") + else() + message("\nSetting up export dependencies for all enabled packages ...\n") + endif() + + foreach(tribitsPackage IN LISTS ${PROJECT_NAME}_ENABLED_INTERNAL_PACKAGES) + tribits_package_set_full_enabled_dep_packages(${tribitsPackage}) + if (${PROJECT_NAME}_DUMP_PACKAGE_DEPENDENCIES) + set(printedVar FALSE) + print_nonempty_var_with_spaces(${tribitsPackage}_FULL_ENABLED_DEP_PACKAGES + printedVar) + if (NOT printedVar) + message("-- ${tribitsPackage}: No library dependencies!") + endif() + endif() + if ("${lastExportTribitsPackage}" STREQUAL "${tribitsPackage}") + break() + endif() + endforeach() + + endif() + +endfunction() + + +# Function that sets up the full package dependencies for the given *internal* +# enabled package ``${packageName}``, including all of its indirect upstream +# *internal* package dependencies. +# +# After running, this function sets the internal cache var: +# +# * ``${packageName}_FULL_ENABLED_DEP_PACKAGES`` +# +# NOTE: This function must be called for all of the upstream internal packages +# before calling it for this package. +# +# NOTE: The complexity of this function is O(^2) due to the +# sorting algorithm. That is why it would be good to get rid of this function +# at some point (or refactor it to have a better complexity). +# +function(tribits_package_set_full_enabled_dep_packages packageName) + + tribits_package_build_unsorted_full_enabled_dep_packages(${packageName} + packageFullDepsList) + + tribits_package_sort_full_enabled_dep_packages(packageFullDepsList + orderedPackageFullDepsList) + + global_set(${packageName}_FULL_ENABLED_DEP_PACKAGES ${orderedPackageFullDepsList}) + +endfunction() + + +# Helper function that builds the full list of internal upstream dep packages +# (with no duplicates) for a given internal package. +# +function(tribits_package_build_unsorted_full_enabled_dep_packages packageName + packageFullDepsListOut + ) + + set(packageFullDepsList "") + foreach(depPkg IN LISTS ${packageName}_LIB_DEFINED_DEPENDENCIES) + if ((${depPkg}_PACKAGE_BUILD_STATUS STREQUAL "INTERNAL") + AND ((${packageName}_LIB_DEP_REQUIRED AND ${PROJECT_NAME}_ENABLE_${depPkg}) + OR ((NOT ${packageName}_LIB_DEP_REQUIRED) AND ${packageName}_ENABLE_${depPkg})) + ) + list(APPEND packageFullDepsList ${depPkg}) + endif() + endforeach() + + if(packageFullDepsList) + list(REMOVE_DUPLICATES packageFullDepsList) + + foreach(DEP_PACKAGE IN LISTS packageFullDepsList) + list(APPEND packageFullDepsList ${${DEP_PACKAGE}_FULL_ENABLED_DEP_PACKAGES}) + endforeach() + + list(REMOVE_DUPLICATES packageFullDepsList) + endif() + + set(${packageFullDepsListOut} ${packageFullDepsList} PARENT_SCOPE) + +endfunction() + + +# Helper function to sort the full set of upstream dep packages for a given +# internal package. +# +function(tribits_package_sort_full_enabled_dep_packages packageFullDepsListName + orderedPackageFullDepsListOut + ) + + set(orderedPackageFullDepsList "") + + foreach(depPkg IN LISTS ${packageFullDepsListName}) + + set(depPkgIdx ${${depPkg}_PKG_IDX}) + + set(sortedIndex 0) + set(insertedDepPkg FALSE) + + foreach(sortedPackage IN LISTS orderedPackageFullDepsList) + + set(sortedPackageIdx ${${sortedPackage}_PKG_IDX}) + + if (${depPkgIdx} GREATER ${sortedPackageIdx}) + list(INSERT orderedPackageFullDepsList ${sortedIndex} ${depPkg}) + set(insertedDepPkg TRUE) + break() + endif() + + math(EXPR sortedIndex ${sortedIndex}+1) + + endforeach() + + if(NOT insertedDepPkg) + list(APPEND orderedPackageFullDepsList ${depPkg}) + endif() + + endforeach() + + set(${orderedPackageFullDepsListOut} ${orderedPackageFullDepsList} PARENT_SCOPE) + +endfunction() diff --git a/cmake/tribits/core/package_arch/TribitsSystemDataStructuresMacrosFunctions.rst b/cmake/tribits/core/package_arch/TribitsSystemDataStructuresMacrosFunctions.rst index 3e5a4e3718b1..f4661403fabd 100644 --- a/cmake/tribits/core/package_arch/TribitsSystemDataStructuresMacrosFunctions.rst +++ b/cmake/tribits/core/package_arch/TribitsSystemDataStructuresMacrosFunctions.rst @@ -295,14 +295,9 @@ the dependencies for each external package/TPL and internal package: The list of all **defined direct** required and optional upstream external package/TPL and internal package dependencies, regardless if they are - enabled or not. (Note, this is currently the concatenation of the lists - `${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES`_, - `${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES`_, - ``${PACKAGE_NAME}_LIB_REQUIRED_DEP_TPLS``, and - ``${PACKAGE_NAME}_LIB_OPTIONAL_DEP_TPLS``. With the completion of #63, - the ``XXX_TPLS`` lists will be removed.) To determine if a given direct - upstream package ```` in this list is enabled or not for this - package ``${PACKAGE_NAME}``, check the value of + enabled or not. To determine if a given direct upstream package + ```` in this list is enabled or not for this package + ``${PACKAGE_NAME}``, check the value of ``${PACKAGE_NAME}_ENABLE_``. NOTE: The variables ``${PACKAGE_NAME}_ENABLE_`` will be set even for required upstream packages to allow for uniform loops involving required and optional @@ -338,13 +333,8 @@ the dependencies for each external package/TPL and internal package: This list of all **define direct** extra package test required and optional upstream external package/TPL and internal package dependencies. - (Currently, this is a concatenation of the lists - `${PACKAGE_NAME}_TEST_REQUIRED_DEP_PACKAGES`_, - `${PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES`_, - ``${PACKAGE_NAME}_TEST_REQUIRED_DEP_TPLS``, and - ``${PACKAGE_NAME}_TEST_OPTIONAL_DEP_TPLS``. With the completion of #63, - the ``XXX_TPLS`` lists will be removed.) This list is set regardless if - the package ``${PACKAGE_NAME}`` is enabled or not. + This list is set regardless if the package ``${PACKAGE_NAME}`` is enabled + or not. .. _${PACKAGE_NAME}_TEST_ENABLED_DEPENDENCIES: @@ -390,17 +380,17 @@ Given the above upstream dependency list variables, the following derived list variables are then constructed which provide navigation from a package to its downstream/forward dependent packages: - .. _${PACKAGE_NAME}_FORWARD_LIB_DEP_PACKAGES: + .. _${PACKAGE_NAME}_FORWARD_LIB_DEFINED_DEPENDENCIES: - ``${PACKAGE_NAME}_FORWARD_LIB_DEP_PACKAGES`` + ``${PACKAGE_NAME}_FORWARD_LIB_DEFINED_DEPENDENCIES`` For a given package ``${PACKAGE_NAME}``, lists the names of all of the forward packages ```` that list this package in their ``_LIB_DEFINED_PACKAGES`` variables. - .. _${PACKAGE_NAME}_FORWARD_TEST_DEP_PACKAGES: + .. _${PACKAGE_NAME}_FORWARD_TEST_DEFINED_DEPENDENCIES: - ``${PACKAGE_NAME}_FORWARD_TEST_DEP_PACKAGES`` + ``${PACKAGE_NAME}_FORWARD_TEST_DEFINED_DEPENDENCIES`` For a given package ``${PACKAGE_NAME}``, lists the names of all of the forward packages ```` that list this package in their @@ -452,6 +442,7 @@ or:: -D _ROOT= .. _${PACKAGE_NAME}_PACKAGE_BUILD_STATUS: +.. _${TPL_NAME}_PACKAGE_BUILD_STATUS: The final status of whether a package is treated as an internal package or an external package is provided by the variable:: @@ -522,86 +513,6 @@ information about a given internal package: variable defined for them. -Legacy list variables defining the package dependencies graph -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -The following top-level non-cache variables are defined after reading in each -top-level package and subpackage ``Dependencies.cmake`` files and they are -used to define the basic dependencies that exist between packages in a project -to support the enable and disable logic described in section `Package -Dependencies and Enable/Disable Logic`_. These variables taken together -constitute a bidirectional acyclic graph (DAG) data-structure for package -dependencies. - -The following lists variables define the **direct** dependencies from a -package ``${PACKAGE_NAME}`` to its upstream packages which are directly set in -a package's `/cmake/Dependencies.cmake`_ file. (These lists -should **not** contain any *indirect* dependencies as the dependency system -already handles these automatically.) - - .. _${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES: - - ``${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES`` - - List of *direct* package dependencies that are required for the libraries - and non-test executables built by ``${PACKAGE_NAME}``. - - .. _${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES: - - ``${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES`` - - List of *direct* package dependencies that are only optional for the - libraries and non-test executables built by ``${PACKAGE_NAME}``. - - .. _${PACKAGE_NAME}_TEST_REQUIRED_DEP_PACKAGES: - - ``${PACKAGE_NAME}_TEST_REQUIRED_DEP_PACKAGES`` - - List of *direct* package dependencies that are required for the - tests/examples built by ``${PACKAGE_NAME}``. This list should **not** - contain any of the packages already listed in - ``${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES``. - - .. _${PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES: - - ``${PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES``` - - List of *direct* package dependencies that are optional for the - tests/examples built by ``${PACKAGE_NAME}``. This list should **not** - contain any of the packages listed in - ``${PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES``, - ``${PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES``, or - ``${PACKAGE_NAME}_TEST_REQUIRED_DEP_PACKAGES``. - -Given the above upstream dependency list variables, the following derived list -variables are then constructed which provide navigation from a package to its -downstream/forward dependent packages: - - ``${PACKAGE_NAME}_FORWARD_LIB_REQUIRED_DEP_PACKAGES`` - - For a given package ``${PACKAGE_NAME}``, lists the names of all of the - forward packages ``${FORWARD_PACKAGE_NAME}`` that list this package in - their ``${FORWARD_PACKAGE_NAME}_LIB_REQUIRED_DEP_PACKAGES`` variables. - - ``${PACKAGE_NAME}_FORWARD_LIB_OPTIONAL_DEP_PACKAGES`` - - For a given package ``${PACKAGE_NAME}``, lists the names of all of the - forward packages ``${FORWARD_PACKAGE_NAME}`` that list this package in - their ``${FORWARD_PACKAGE_NAME}_LIB_OPTIONAL_DEP_PACKAGES`` variables. - - ``${PACKAGE_NAME}_FORWARD_TEST_REQUIRED_DEP_PACKAGES`` - - For a given package ``${PACKAGE_NAME}``, lists the names of all of the - forward packages ``${FORWARD_PACKAGE_NAME}`` that list this package in - their ``${FORWARD_PACKAGE_NAME}_TEST_REQUIRED_DEP_PACKAGES`` variables. - - ``${PACKAGE_NAME}_FORWARD_TEST_OPTIONAL_DEP_PACKAGES`` - - For a given package ``${PACKAGE_NAME}``, lists the names of all of the - forward packages ``${FORWARD_PACKAGE_NAME}`` that list this package in - their ``${FORWARD_PACKAGE_NAME}_TEST_OPTIONAL_DEP_PACKAGES`` variables. - - Function call tree for constructing package dependency graph ------------------------------------------------------------ diff --git a/cmake/tribits/core/package_arch/TribitsTestCategories.cmake b/cmake/tribits/core/package_arch/TribitsTestCategories.cmake index c0058c9c7cd8..acd55cee153d 100644 --- a/cmake/tribits/core/package_arch/TribitsTestCategories.cmake +++ b/cmake/tribits/core/package_arch/TribitsTestCategories.cmake @@ -40,6 +40,7 @@ include(FindListElement) include(MessageWrapper) include(Join) +include(TribitsDeprecatedHelpers) # Define the valid categories that will be recognized in the CATEGORIES keyword @@ -97,7 +98,7 @@ function(tribits_filter_and_assert_categories CATEGORIES_VAR_INOUT) set(CATEGORIES_OUT) foreach(CATEGORY ${${CATEGORIES_VAR_INOUT}}) if (CATEGORY STREQUAL "WEEKLY") - message_wrapper(WARNING "Warning: The test category 'WEEKLY' is deprecated" + tribits_deprecated("The test category 'WEEKLY' is deprecated" " and is replaced with 'HEAVY'. Please change to use 'HEAVY' instead.") list(APPEND CATEGORIES_OUT "HEAVY") else() diff --git a/cmake/tribits/core/package_arch/TribitsTplDeclareLibraries.cmake b/cmake/tribits/core/package_arch/TribitsTplDeclareLibraries.cmake index 16e8bae9e60e..aa808d8e8fc8 100644 --- a/cmake/tribits/core/package_arch/TribitsTplDeclareLibraries.cmake +++ b/cmake/tribits/core/package_arch/TribitsTplDeclareLibraries.cmake @@ -38,11 +38,12 @@ # @HEADER include(TribitsTplFindIncludeDirsAndLibraries) +include(TribitsDeprecatedHelpers) function(tribits_tpl_declare_libraries TPL_NAME) - message(WARNING - "WARNING: tribits_tpl_declare_libraries() is deprecated, instead use" - " tribits_tpl_find_include_dirs_and_libraries()!" + tribits_deprecated_command(tribits_tpl_declare_libraries + MESSAGE + "Use tribits_tpl_find_include_dirs_and_libraries() instead." " Make this change in the file:\n" " ${${TPL_NAME}_FINDMOD}\n" "which is pointed to by the file:\n" diff --git a/cmake/tribits/core/package_arch/TribitsWriteClientExportFiles.cmake b/cmake/tribits/core/package_arch/TribitsWriteClientExportFiles.cmake index 1f31b6ec0c01..7ef8f2666bd4 100644 --- a/cmake/tribits/core/package_arch/TribitsWriteClientExportFiles.cmake +++ b/cmake/tribits/core/package_arch/TribitsWriteClientExportFiles.cmake @@ -178,125 +178,11 @@ function(tribits_write_flexible_package_client_export_files) print_var(EXPORT_FILE_VAR_PREFIX) endif() - # - # B) Get the set of upstream packages for this package that are enabled, - # libraries, library dirs, and include dirs - # - - set(FULL_PACKAGE_SET "") - set(FULL_LIBRARY_SET "") - - - if (TRIBITS_WRITE_FLEXIBLE_PACKAGE_CLIENT_EXPORT_FILES_DEBUG_DUMP) - print_var(${PACKAGE_NAME}_FULL_ENABLED_DEP_PACKAGES) - endif() - - foreach(TRIBITS_PACKAGE ${${PACKAGE_NAME}_FULL_ENABLED_DEP_PACKAGES}) - - if (TRIBITS_WRITE_FLEXIBLE_PACKAGE_CLIENT_EXPORT_FILES_DEBUG_DUMP) - print_var(TRIBITS_PACKAGE) - if (${PROJECT_NAME}_ENABLE_${TRIBITS_PACKAGE}) - print_var(${TRIBITS_PACKAGE}_HAS_NATIVE_LIBRARIES_TO_INSTALL) - endif() - endif() - - set(APPEND_THE_PACKAGE TRUE) - set(APPEND_THE_PACKAGE_LIBS TRUE) - - if (NOT ${TRIBITS_PACKAGE}_HAS_NATIVE_LIBRARIES_TO_INSTALL) - set(APPEND_THE_PACKAGE_LIBS FALSE) - endif() - - if (APPEND_THE_PACKAGE) - list(APPEND FULL_PACKAGE_SET ${TRIBITS_PACKAGE}) - if (APPEND_THE_PACKAGE_LIBS) - append_set(FULL_LIBRARY_SET ${${TRIBITS_PACKAGE}_LIBRARIES}) - else() - if (TRIBITS_WRITE_FLEXIBLE_PACKAGE_CLIENT_EXPORT_FILES_DEBUG_DUMP) - message("-- " "Skipping adding the package libs!") - endif() - endif() - else() - if (TRIBITS_WRITE_FLEXIBLE_PACKAGE_CLIENT_EXPORT_FILES_DEBUG_DUMP) - message("-- " "Skipping adding the package!") - endif() - endif() - - if (TRIBITS_WRITE_FLEXIBLE_PACKAGE_CLIENT_EXPORT_FILES_DEBUG_DUMP) - print_var(FULL_PACKAGE_SET) - print_var(FULL_LIBRARY_SET) - endif() - - endforeach() - - # Must prepend the current package and its libraries itself so that we get - # its TPLs libraries. However, if the current package has no native - # libraries (yet), then there is no point in listing the package or its - # TPLs. Why would a package list TPLs (with actual libraries) if itself - # does not have libraries to export? Note, this does not affect internal - # tests and examples which could have TPLs but no native libraries. - if (${PACKAGE_NAME}_LIBRARIES AND ${PACKAGE_NAME}_HAS_NATIVE_LIBRARIES_TO_INSTALL) - prepend_set(FULL_PACKAGE_SET ${PACKAGE_NAME}) - prepend_set(FULL_LIBRARY_SET ${${PACKAGE_NAME}_LIBRARIES}) - endif() - - if (TRIBITS_WRITE_FLEXIBLE_PACKAGE_CLIENT_EXPORT_FILES_DEBUG_DUMP) - message("-- " "*** Final sets of packages, libs, include dirs, and lib dirs:") - print_var(FULL_PACKAGE_SET) - print_var(FULL_LIBRARY_SET) - endif() - - # - # C) Get the set of TPLs for this package that are enabled - # - - # C.1) Get the set of enabled TPLs - - set(FULL_TPL_SET "") - foreach(TRIBITS_PACKAGE ${FULL_PACKAGE_SET}) - list(APPEND FULL_TPL_SET ${${TRIBITS_PACKAGE}_LIB_REQUIRED_DEP_TPLS}) - set(OPTIONAL_TPLS ${${TRIBITS_PACKAGE}_LIB_OPTIONAL_DEP_TPLS}) - foreach(TPL ${OPTIONAL_TPLS}) - # Only add if support for the optional TPL is enabled in this - # package. Don't just check if the TPL is enabled! - if(${TRIBITS_PACKAGE}_ENABLE_${TPL}) - list(APPEND FULL_TPL_SET ${TPL}) - endif() - endforeach() - endforeach() - if (TRIBITS_WRITE_FLEXIBLE_PACKAGE_CLIENT_EXPORT_FILES_DEBUG_DUMP) - print_var(FULL_TPL_SET) - endif() - - # C.2) Sort the TPLs according to the master TPL list - - #We will use the complete list of supported tpls for the project - #to help us create a properly ordered list of tpls. - if (FULL_TPL_SET) - set(ORDERED_FULL_TPL_SET ${FULL_TPL_SET}) - tribits_sort_list_according_to_master_list("${${PROJECT_NAME}_REVERSE_DEFINED_TPLS}" - ORDERED_FULL_TPL_SET) - endif() - - if (TRIBITS_WRITE_FLEXIBLE_PACKAGE_CLIENT_EXPORT_FILES_DEBUG_DUMP) - print_var(ORDERED_FULL_TPL_SET) - endif() - - # - # D) Get the libraries, library dirs, and the include dirs for the - # upstream enabled TPLs - # - - set(${PACKAGE_NAME}_TPL_LIBRARIES "") - foreach(TPL ${ORDERED_FULL_TPL_SET}) - list(APPEND ${PACKAGE_NAME}_TPL_LIBRARIES ${TPL}::all_libs) - endforeach() - # Generate a note discouraging editing of the Config.cmake file set(DISCOURAGE_EDITING "Do not edit: This file was generated automatically by CMake.") # - # E) Deal with the library rpath issues with shared libs + # B) Deal with the library rpath issues with shared libs # # Write the specification of the rpath if necessary. This is only needed if @@ -309,14 +195,14 @@ function(tribits_write_flexible_package_client_export_files) endif() # - # F) Create the contents of the Config.cmake file for the build tree + # C) Create the contents of the Config.cmake file for the build tree # tribits_generate_package_config_file_for_build_tree(${PACKAGE_NAME} EXPORT_FILE_VAR_PREFIX ${EXPORT_FILE_VAR_PREFIX}) # - # G) Create Config_install.cmake file for the install tree + # D) Create Config_install.cmake file for the install tree # tribits_generate_package_config_file_for_install_tree(${PACKAGE_NAME} @@ -787,28 +673,6 @@ function(tribits_write_project_client_export_files) # Custom code in configuration file. set(PROJECT_CONFIG_CODE "") - # # Export targets from the build tree. - # if(FULL_LIBRARY_SET) - # list(SORT FULL_LIBRARY_SET) - # list(REMOVE_DUPLICATES FULL_LIBRARY_SET) - # set(FULL_LIBRARY_TARGET_SET) - # foreach(LIB_ELE ${FULL_LIBRARY_SET}) - # if (TARGET ${LIB_ELE}) - # list(APPEND FULL_LIBRARY_TARGET_SET ${LIB_ELE}) - # endif() - # endforeach() - # export(TARGETS ${FULL_LIBRARY_TARGET_SET} FILE - # "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake") - # # Import the targets in applications. - # set(PROJECT_CONFIG_CODE "${PROJECT_CONFIG_CODE} - ## Import ${PROJECT_NAME} targets - #if(NOT ${PROJECT_NAME}_TARGETS_IMPORTED) - # set(${PROJECT_NAME}_TARGETS_IMPORTED 1) - # include(\"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake\") - #endif() - #") - # endif() - # Appending the logic to include each package's config file. set(LOAD_CODE "# Load configurations from enabled packages") foreach(TRIBITS_PACKAGE ${FULL_PACKAGE_SET}) @@ -916,7 +780,6 @@ include(\"${${TRIBITS_PACKAGE}_BINARY_DIR}/${TRIBITS_PACKAGE}Config.cmake\")") endfunction() - macro(tribits_set_compiler_var_for_config_file LANG FOR_DIR) if (NOT "${CMAKE_${LANG}_COMPILER_FOR_CONFIG_FILE_${FOR_DIR}}" STREQUAL "") set(CMAKE_${LANG}_COMPILER_FOR_CONFIG_FILE diff --git a/cmake/tribits/core/utils/AppendStringVar.cmake b/cmake/tribits/core/utils/AppendStringVar.cmake index 9b4e553a1494..dbd0c1fb5d1b 100644 --- a/cmake/tribits/core/utils/AppendStringVar.cmake +++ b/cmake/tribits/core/utils/AppendStringVar.cmake @@ -39,6 +39,7 @@ include(ConcatStrings) include(PrintVar) +include(TribitsDeprecatedHelpers) # @FUNCTION: append_string_var() @@ -60,6 +61,8 @@ include(PrintVar) # string(APPEND "" "" ...) # function(append_string_var STRING_VAR_OUT) + tribits_deprecated_command(append_string_var + MESSAGE "Use string(APPEND) instead.") #message("APPEND_STRING_VAR: ${STRING_VAR_OUT} {${ARGN}}") concat_strings( STRING_VAR "${${STRING_VAR_OUT}}" ${ARGN} ) #print_var( STRING_VAR ) diff --git a/cmake/tribits/core/utils/CMakeOverrides.cmake b/cmake/tribits/core/utils/CMakeOverrides.cmake deleted file mode 100644 index 1c95ecfdb703..000000000000 --- a/cmake/tribits/core/utils/CMakeOverrides.cmake +++ /dev/null @@ -1,117 +0,0 @@ -# @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 - -include(CMakeParseArguments) - -# -# FUNCTION: tribits_include_directories() -# - -# This function is to override the standard behavior of include_directories -# for a TriBITS package. - -# Usage:: -# -# tribits_include_directories( -# [REQUIRED_DURING_INSTALLATION_TESTING] ... -# ) -# -# If specified, ``REQUIRED_DURING_INSTALLATION_TESTING`` can appear anywhere -# in the argument list. -# -# This function allows overriding the default behavior for installation -# testing, to ensure that include directories will not be inadvertently added -# to the build lines for tests during installation testing. Normally we want -# the include directories to be handled as cmake usually does. However during -# TriBITS installation testing we do not want most of the include directories -# to be used as the majority of the files should come from the installation we -# are building against. There is an exception to this and that is when there -# are test only headers that are needed. For that case we allow people to set -# ``REQUIRED_DURING_INSTALLATION_TESTING`` to tell us that this include -# directory does need to be set for instaltion testing. -# -function(tribits_include_directories) - cmake_parse_arguments( - #prefix - PARSE - #Options - "REQUIRED_DURING_INSTALLATION_TESTING" - #one_value_keywords - "" - #multi_value_keywords - "" - ${ARGN} - ) - - tribits_check_for_unparsed_arguments() - - if(NOT ${PROJECT_NAME}_ENABLE_INSTALLATION_TESTING OR PARSE_REQUIRED_DURING_INSTALLATION_TESTING) - _include_directories(${PARSE_DEFAULT_ARGS}) - endif() -endfunction() - -#This function is to override the standard behavior of include_directories. -# We are overriding the default behavior for installation testing, this allows -#us to ensure that include directories will not be inadvertently added to the -#build lines for tests during installation testing. Normally we want the include -#directories to be handled as cmake usually does.However during installation -#testing we do not want most of the include directories to be used as the majority -#of the files should come from the installation we are building against. There is -#an exception to this and that is when there are test only headers that are needed. -#For that case we allow people to set "REQUIRED_DURING_INSTALLATION_TESTING" to -#tell us that this include directory does need to be set for instaltion testing. -function(include_directories) - cmake_parse_arguments( - #prefix - PARSE - #Options - "REQUIRED_DURING_INSTALLATION_TESTING" - #one_value_keywords - "" - #multi_value_keywords - "" - ${ARGN} - ) - - tribits_check_for_unparsed_arguments() - - if(NOT ${PROJECT_NAME}_ENABLE_INSTALLATION_TESTING OR PARSE_REQUIRED_DURING_INSTALLATION_TESTING) - _include_directories(${PARSE_DEFAULT_ARGS}) - endif() -endfunction() diff --git a/cmake/tribits/core/utils/ParseVariableArguments.cmake b/cmake/tribits/core/utils/ParseVariableArguments.cmake index 92e1b060fd15..da2e58ad2099 100644 --- a/cmake/tribits/core/utils/ParseVariableArguments.cmake +++ b/cmake/tribits/core/utils/ParseVariableArguments.cmake @@ -37,14 +37,12 @@ # ************************************************************************ # @HEADER -# Set up to use cmake_parse_arguments() function! -include(CMakeParseArguments) -# NOTE: For CMake versions 3.5.0 and above, this module is empty so the -# natively implemented function cmake_parse_arguments() will get used! +include(TribitsDeprecatedHelpers) + macro(parse_arguments_deprecated_warning) - message(DEPRECATION "parse_arguments() is deprecated and should not be used." - " Instead use cmake_parse_arguments()") + tribits_deprecated_command(parse_arguments + MESSAGE "Use cmake_parse_arguments() instead.") endmacro() parse_arguments_deprecated_warning() diff --git a/cmake/tribits/core/utils/TribitsAddEnumCacheVar.cmake b/cmake/tribits/core/utils/TribitsAddEnumCacheVar.cmake new file mode 100644 index 000000000000..2ee30b7ed9d4 --- /dev/null +++ b/cmake/tribits/core/utils/TribitsAddEnumCacheVar.cmake @@ -0,0 +1,89 @@ +# @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 + +include(TribitsParseArgumentsHelpers) + + +# @FUNCTION: tribits_add_enum_cache_var() +# +# Set up a string cache variable that must match a fixed set of values +# (i.e. an enum) and assert that it matches those values. +# +# Usage:: +# +# tribits_add_enum_cache_var( +# DEFAULT_VAL +# DOC_STRING "" +# ALLOWED_STRINGS_LIST "" "" ... +# [IS_ADVANCED] +# ) +# +# On output, ```` will be set to the list of paths +# +function(tribits_add_enum_cache_var cacheVarName defaultVal docString + isAdvanced allowedStringsListName + ) + # Parse input arguments + set(argOneValArgKeywords DEFAULT_VAL DOC_STRING) + set(argMultiValArgKeywords ALLOWED_STRINGS_LIST) + cmake_parse_arguments(PARSE_ARGV 1 PREFIX + "IS_ADVANCED" # options + "" # one_value_keywords + "${argOneValArgKeywords};${argMultiValArgKeywords}" # multi_value_keywords + ) + tribits_check_for_unparsed_arguments(PREFIX) + tribits_assert_parse_arg_one_value(PREFIX ${argOneValArgKeywords}) + tribits_assert_parse_arg_one_or_more_values(PREFIX ${argMultiValArgKeywords}) + # Human readable list of allowed values: '', '', ... + string(REPLACE ";" "', '" validStringValuesListStr "'${PREFIX_ALLOWED_STRINGS_LIST}'") + # Set cache var + set(${cacheVarName} ${PREFIX_DEFAULT_VAL} CACHE STRING + "${PREFIX_DOC_STRING}. Valid values: ${validStringValuesListStr} (default '${PREFIX_DEFAULT_VAL}')") + if (PREFIX_IS_ADVANCED) + mark_as_advanced(${cacheVarName}) + endif() + set_property(CACHE ${cacheVarName} PROPERTY STRINGS + ${PREFIX_ALLOWED_STRINGS_LIST} ) + # Assert in list of allowed strings + if (NOT ${cacheVarName} IN_LIST PREFIX_ALLOWED_STRINGS_LIST) + message(FATAL_ERROR "Error, the cache var ${cacheVarName} with value" + " '${${cacheVarName}}' is not in the list of allowed values:" + " ${validStringValuesListStr} (default '${PREFIX_DEFAULT_VAL}')" ) + endif() +endfunction() diff --git a/cmake/tribits/core/utils/SetAndIncDirs.cmake b/cmake/tribits/core/utils/TribitsCreateReverseList.cmake similarity index 80% rename from cmake/tribits/core/utils/SetAndIncDirs.cmake rename to cmake/tribits/core/utils/TribitsCreateReverseList.cmake index 80d4f688c40b..2f84d8c4781d 100644 --- a/cmake/tribits/core/utils/SetAndIncDirs.cmake +++ b/cmake/tribits/core/utils/TribitsCreateReverseList.cmake @@ -38,19 +38,15 @@ # @HEADER -# @MACRO: set_and_inc_dirs() +# @MACRO: tribits_create_reverse_list() # -# Set a variable to an include directory and call ``include_directories()`` -# (removes boiler-plate code). +# Create a reverse list var in one shot. # -# Usage: +# Usage:: # -# set_and_inc_dirs( ) +# tribits_create_reverse_list( ) # -# On output, this sets ```` to ```` in the local scope -# and calls ``include_directories()``. -# -macro(set_and_inc_dirs DIR_VAR_NAME INCLUDE_DIR) - set(${DIR_VAR_NAME} ${INCLUDE_DIR}) - include_directories(${${DIR_VAR_NAME}}) +macro(tribits_create_reverse_list oldListName newListName) + set(${newListName} ${${oldListName}}) + list(REVERSE ${newListName}) endmacro() diff --git a/cmake/tribits/core/utils/TribitsDeprecatedHelpers.cmake b/cmake/tribits/core/utils/TribitsDeprecatedHelpers.cmake new file mode 100644 index 000000000000..0ae57138e050 --- /dev/null +++ b/cmake/tribits/core/utils/TribitsDeprecatedHelpers.cmake @@ -0,0 +1,121 @@ +# @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 + +include(MessageWrapper) +include(TribitsParseArgumentsHelpers) + + +set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_VALUES_THAT_CALL_MESSAGE + DEPRECATION AUTHOR_WARNING SEND_ERROR FATAL_ERROR ) +set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_VALUES_THAT_DONT_CALL_MESSAGE + IGNORE ) +set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_ALL_VALID_VALUES + ${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_VALUES_THAT_CALL_MESSAGE} + ${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_VALUES_THAT_DONT_CALL_MESSAGE} ) + + +# @FUNCTION: tribits_deprecated() +# +# Notify the user that some TriBITS functionality is deprecated. +# +# Usage:: +# +# tribits_deprecated() +# +# Depending on the value of the cache variable +# `TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE`_, this can do one of several +# things: +# +# - ``DEPRECATION`` or empty string (or variable not defined): Issue a CMake +# ``DEPRECATION`` message and continue. +# - ``AUTHOR_WARNING``: Issue a CMake ``AUTHOR_WARNING`` message and continue. +# - ``SEND_ERROR``: Issue a CMake ``SEND_ERROR`` message and continue. +# - ``FATAL_ERROR``: Issue a CMake ``FATAL_ERROR`` message and exit. +# - ``IGNORE``: Issue no message and continue. +# +function(tribits_deprecated) + cmake_parse_arguments(PARSE_ARGV 0 FWD "" "" "") + + if ("${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE}" STREQUAL "") + set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE DEPRECATION) + endif() + + if ("${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE}" IN_LIST TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_VALUES_THAT_CALL_MESSAGE) + message_wrapper("${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE}" + ${FWD_UNPARSED_ARGUMENTS} + "\n\nNOTE: To Make these warnings go away, set -D" + " TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE=IGNORE (see the build reference guide).") + elseif (NOT "${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE}" IN_LIST + TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_ALL_VALID_VALUES + ) + message_wrapper(FATAL_ERROR "Invalid value for" + " TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE=" + "'${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE}'") + endif() +endfunction() + + +# @FUNCTION: tribits_deprecated_command() +# +# Notify the user that a TriBITS function or macro is deprecated. This should +# be the first command called at the top of any deprecated function or macro. +# +# Usage:: +# +# tribits_deprecated_command( +# [MESSAGE ] +# ) +# +function(tribits_deprecated_command name) + # Parse input arguments + set(argMultiValArgKeywords MESSAGE) + cmake_parse_arguments(PARSE_ARGV 1 PREFIX + "" # options + "" # one_value_keywords + "${argMultiValArgKeywords}" # multi_value_keywords + ) + tribits_check_for_unparsed_arguments(PREFIX) + + set(deprecationMessage "TriBITS command '${name}' is deprecated.") + if (NOT "${PREFIX_MESSAGE}" STREQUAL "") + string(APPEND deprecationMessage "\n\n${PREFIX_MESSAGE}") + endif() + + tribits_deprecated("${deprecationMessage}") +endfunction() diff --git a/cmake/tribits/ctest_driver/TribitsCTestDriverCoreHelpers.cmake b/cmake/tribits/ctest_driver/TribitsCTestDriverCoreHelpers.cmake index c6135cb88c70..837ddf05e5f8 100644 --- a/cmake/tribits/ctest_driver/TribitsCTestDriverCoreHelpers.cmake +++ b/cmake/tribits/ctest_driver/TribitsCTestDriverCoreHelpers.cmake @@ -249,8 +249,8 @@ macro(tribits_setup_packages) # Second, the extra repos do not even exist in the "driver" source # tree. - set(${PROJECT_NAME}_ASSERT_MISSING_PACKAGES FALSE) - set(${PROJECT_NAME}_OUTPUT_DEPENDENCY_FILES FALSE) + set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES OFF) + set(${PROJECT_NAME}_OUTPUT_DEPENDENCY_FILES FALSE) if (CTEST_GENERATE_OUTER_DEPS_XML_OUTPUT_FILE) set(${PROJECT_NAME}_DEPS_XML_OUTPUT_FILE "${PROJECT_BINARY_DIR}/${${PROJECT_NAME}_PACKAGE_DEPS_XML_FILE_NAME}") diff --git a/cmake/tribits/doc/build_ref/TribitsBuildReferenceBody.rst b/cmake/tribits/doc/build_ref/TribitsBuildReferenceBody.rst index 9abf82ed5cd2..07f0570a2b6f 100644 --- a/cmake/tribits/doc/build_ref/TribitsBuildReferenceBody.rst +++ b/cmake/tribits/doc/build_ref/TribitsBuildReferenceBody.rst @@ -427,18 +427,12 @@ To find this output, look for the line:: and the dependencies are listed below this for each package in the form:: - -- _LIB_REQUIRED_DEP_TPLS: ... - -- _LIB_OPTIONAL_DEP_TPLS: ... - -- _LIB_REQUIRED_DEP_PACKAGES: <[PKG1> ... - -- _LIB_OPTIONAL_DEP_PACKAGES: ... - -- _TEST_REQUIRED_DEP_TPLS: ... - -- _TEST_OPTIONAL_DEP_TPLS: ... - -- _TEST_REQUIRED_DEP_PACKAGES: <[PKG5> ... - -- _TEST_OPTIONAL_DEP_PACKAGES: ... - + -- _LIB_DEFINED_DEPENDENCIES: [O] <[PKG1>[R] ... + -- _TEST_DEFINED_DEPENDENCIES: [R] <[PKG8>[R] ... + (Dependencies that don't exist are left out of the output. For example, if -there are no ``_LIB_OPTIONAL_DEP_PACKAGES`` dependencies, then that line -is not printed.) +there are no extra test dependencies, then ``_TEST_DEFINED_DEPENDENCIES`` +will not be printed.) To also see the direct forward/downstream dependencies for each package, also include:: @@ -459,8 +453,8 @@ Enable a set of packages .. __ENABLE_TESTS: -To enable an package ```` (and optionally also its tests -and examples), configure with:: +To enable a package ```` (and optionally also its tests and +examples), configure with:: -D _ENABLE_=ON \ -D _ENABLE_ALL_OPTIONAL_PACKAGES=ON \ @@ -471,15 +465,19 @@ as all packages that ```` can use. All of the package's optional "can use" upstream dependent packages are enabled with ``-D_ENABLE_ALL_OPTIONAL_PACKAGES=ON``. However, ``-D_ENABLE_TESTS=ON`` will only enable tests and examples for -```` (or any other packages specifically enabled). +```` (and any other packages explicitly enabled). -If a TriBITS package ```` has subpackages (e.g. ````, -````, etc.), then enabling the package is equivalent to setting:: +If a TriBITS package ```` has subpackages (e.g. subpackages +````, ````, ...), then enabling the package is equivalent to enabling +all of the required **and optional** subpackagses:: -D _ENABLE_=ON \ -D _ENABLE_=ON \ ... +(In this case, the parent package's optional subpackages are enabled +regardless the value of ``_ENABLE_ALL_OPTIONAL_PACKAGES``.) + However, a TriBITS subpackage will only be enabled if it is not already disabled either explicitly or implicitly. @@ -494,9 +492,6 @@ statement in an input ```*.cmake`` options files. However, setting ``-DXXX_ENABLE_YYY=TRUE`` and ``-DXXX_ENABLE_YYY=FALSE`` is allowed and will be interpreted correctly.. -NOTE: Setting ``_ENABLE_TESTS=ON`` also causes -``_ENABLE_EXAMPLES=ON`` to be set by default as well. - Enable or disable tests for specific packages +++++++++++++++++++++++++++++++++++++++++++++ @@ -517,7 +512,8 @@ packages. If one wants to enable a package along with the enable of other packages, but not the test suite for that package, then one can use a "exclude-list" -appraoch to disable the tests for that package by configuring with:: +appraoch to disable the tests for that package by configuring with, for +example:: -D _ENABLE_=ON \ -D _ENABLE_=ON \ @@ -527,12 +523,12 @@ appraoch to disable the tests for that package by configuring with:: The above will enable the package test suites for ```` and ```` but **not** for ```` (or any other -packages that might get implicitly enabled). One might use this if one wants -to build and install package ```` but does not want to -build and run the test suite for that package. +packages that might get implicitly enabled). One might use this approch if +one wants to build and install package ```` but does not +want to build and run the test suite for that package. Alternatively, one can use an "include-list" appraoch to enable packages and -only enable tests for specific packages. For example, configuring with:: +only enable tests for specific packages, for example, configuring with:: -D _ENABLE_=ON \ -D _ENABLE_TESTS=ON \ @@ -558,7 +554,7 @@ Enable to test all effects of changing a given package(s) .. __ENABLE_ALL_FORWARD_DEP_PACKAGES: -To enable an package ```` to test it and all of its +To enable a package ```` to test it and all of its down-stream packages, configure with:: -D _ENABLE_=ON \ @@ -568,8 +564,9 @@ down-stream packages, configure with:: The above set of arguments will result in package ```` and all packages that depend on ```` to be enabled and have all of their tests turned on. Tests will not be enabled in packages that do not -depend on ```` in this case. This speeds up and robustifies -pre-push testing. +depend (at least implicitly) on ```` in this case. This +speeds up and robustifies testing for changes in specific packages (like in +per-merge testing in a continuous integration process). NOTE: setting ``_ENABLE_ALL_FORWARD_DEP_PACKAGES=ON`` also automatically sets and overrides `_ENABLE_ALL_OPTIONAL_PACKAGES`_ to @@ -580,7 +577,7 @@ packages for testing purposes unless you are enabling all optional packages.) Enable all packages (and optionally all tests) ++++++++++++++++++++++++++++++++++++++++++++++ -To enable all defined packages and subpackages add the configure option:: +To enable all defined packages, add the configure option:: -D _ENABLE_ALL_PACKAGES=ON \ @@ -589,13 +586,12 @@ packages, add the configure option:: -D _ENABLE_TESTS=ON \ -Specific packages can be disabled (i.e. "black-listed") by adding +Specific packages can be disabled (i.e. "exclude-listed") by adding ``_ENABLE_=OFF``. This will also disable all packages that depend on ````. Note, all examples are also enabled by default when setting -``_ENABLE_TESTS=ON`` (and so examples are considered a subset of the -tests). +``_ENABLE_TESTS=ON``. By default, setting ``_ENABLE_ALL_PACKAGES=ON`` only enables primary tested (PT) packages and code. To have this also enable all secondary tested @@ -613,50 +609,58 @@ details. Disable a package and all its dependencies ++++++++++++++++++++++++++++++++++++++++++ -To disable an package and all of the packages that depend on it, add the -configure options:: +To disable a package and all of the packages that depend on it, add the +configure option:: -D _ENABLE_=OFF For example:: - -D _ENABLE_=ON \ + -D _ENABLE_=ON \ -D _ENABLE_ALL_OPTIONAL_PACKAGES=ON \ - -D _ENABLE_=ON \ + -D _ENABLE_=OFF \ -will enable ```` and all of the packages that it depends on except -for ```` and all of its forward dependencies. +will enable ```` and all of the packages that it depends on +except for ```` and all of its forward dependencies. -If a TriBITS package ```` has subpackages (e.g. ````, -````, etc.), then disabling the package is equivalent to setting:: +If a TriBITS package ```` has subpackages (e.g. a parent +package with subpackages ````, ````, ...), then disabling the parent +package is equivalent to disabling all of the required and optional +subpackages:: -D _ENABLE_=OFF \ -D _ENABLE_=OFF \ ... -The disable of the subpackage is this case will override any enables. +The disable of the subpackages in this case will override any enables. + +.. __DISABLE_ENABLED_FORWARD_DEP_PACKAGES: If a disabled package is a required dependency of some explicitly enabled -downstream package, then the configure will error out if -``_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=OFF``. Otherwise, a WARNING -will be printed and the downstream package will be disabled and configuration -will continue. +downstream package, then the configure will error out if:: + + -D _DISABLE_ENABLED_FORWARD_DEP_PACKAGES=OFF \ + +is set. Otherwise, if ``_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=ON``, +a ``NOTE`` will be printed and the downstream package will be disabled and +configuration will continue. Remove all package enables in the cache +++++++++++++++++++++++++++++++++++++++ To wipe the set of package enables in the ``CMakeCache.txt`` file so they can -be reset again from scratch, configure with:: +be reset again from scratch, re-configure with:: - $ ./-do-confiugre -D _UNENABLE_ENABLED_PACKAGES=TRUE + $ cmake -D _UNENABLE_ENABLED_PACKAGES=TRUE . This option will set to empty '' all package enables, leaving all other cache variables as they are. You can then reconfigure with a new set of package enables for a different set of packages. This allows you to avoid more -expensive configure time checks and to preserve other cache variables that you -have set and don't want to loose. For example, one would want to do this to -avoid compiler and TPL checks. +expensive configure time checks (like the standard CMake compiler checks) and +to preserve other cache variables that you have set and don't want to loose. +For example, one would want to do this to avoid more expensive compiler and +TPL checks. Selecting compiler and linker options @@ -1595,27 +1599,70 @@ NOTE: Newer versions of CMake may automatically determine when these options need to be turned on so watch for that in looking at the build lines. +External Packages/Third-Party Library (TPL) support +--------------------------------------------------- + +A set of external packages/third-party libraries (TPL) can be enabled and +disabled and the locations of those can be specified at configure time (if +they are not found in the default path). + + Enabling support for an optional Third-Party Library (TPL) ----------------------------------------------------------- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -To enable a given TPL, set:: +To enable a given external packages/TPL, set:: -D TPL_ENABLE_=ON where ```` = ``BLAS``, ``LAPACK`` ``Boost``, ``Netcdf``, etc. +(Requires TPLs for enabled package will automatically be enabled.) The full list of TPLs that is defined and can be enabled is shown by doing a configure with CMake and then grepping the configure output for ``Final set of -.* TPLs``. The set of TPL names listed in ``'Final set of enabled external packages/TPLs'`` and -``'Final set of non-enabled external packages/TPLs'`` gives the full list of TPLs that can be -enabled (or disabled). +.* TPLs``. The set of TPL names listed in ``'Final set of enabled external +packages/TPLs'`` and ``'Final set of non-enabled external packages/TPLs'`` +gives the full list of TPLs that can be enabled (or disabled). + +Optional package-specific support for a TPL can be turned off by setting:: + + -D _ENABLE_=OFF + +This gives the user full control over what TPLs are supported by which package +independent of whether the TPL is enabled or not. + +Support for an optional TPL can also be turned on implicitly by setting:: + + -D _ENABLE_=ON + +where ```` is a TriBITS package that has an optional +dependency on ````. That will result in setting +``TPL_ENABLE_=ON`` internally (but not set in the cache) if +``TPL_ENABLE_=OFF`` is not already set. + + +Specifying the location of the parts of an enabled external package/TPL ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Once an external package/TPL is enabled, the parts of that TPL must be found. +For many external packages/TPLs, this will be done automatically by searching +the environment paths. + +Some external packages/TPLs are specified with a call to +``find_package()`` (see CMake documentation for +``find_package()``). Many other external packages/TPLs use a legacy TriBITS +system that locates the parts using the CMake commands ``find_file()`` and +``find_library()`` as described below. + +Every defined external package/TPL uses a specification provided in a +``FindTPL.cmake`` module file. This file describes how the package +is found in a way that provides modern CMake IMPORTED targets (including the +``::all_libs`` target) that is used by the downstream packages. Some TPLs require only libraries (e.g. Fortran libraries like BLAS or LAPACK), some TPL require only include directories, and some TPLs require both. -Each TPL specification is defined in a ``FindTPL.cmake`` module file. -The job of each of these of these module files is to set the CMake cache -variables: +For ``FindTPL.cmake`` files using the legacy TriBITS TPL system, a +TPL is fully specified through the following cache variables: * ``TPL__INCLUDE_DIRS:PATH``: List of paths to header files for the TPL (if the TPL supplies header files). @@ -1623,8 +1670,8 @@ variables: * ``TPL__LIBRARIES:PATH``: List of (absolute) paths to libraries, ordered as they will be on the link line (of the TPL supplies libraries). -These variables are the only variables that are actually used in the CMake -build system. Therefore, one can set these two variables as CMake cache +These variables are the only variables are used to create IMPORTED CMake +targets for the TPL. One can set these two variables as CMake cache variables, for ``SomeTPL`` for example, with:: -D TPL_SomeTPL_INCLUDE_DIRS="${LIB_BASE}/include/a;${LIB_BASE}/include/b" \ @@ -1634,7 +1681,7 @@ Using this approach, one can be guaranteed that these libraries and these include directories and will used in the compile and link lines for the packages that depend on this TPL ``SomeTPL``. -**WARNING:** When specifying ``TPL__INCLUDE_DIRS`` and/or +**NOTE:** When specifying ``TPL__INCLUDE_DIRS`` and/or ``TPL__LIBRARIES``, the build system will use these without question. It will **not** check for the existence of these directories or files so make sure that these files and directories exist before these are used in the @@ -1642,29 +1689,31 @@ compiles and links. (This can actually be a feature in rare cases the libraries and header files don't actually get created until after the configure step is complete but before the build step.) -**WARNING:** It is **not recommended** to specify the TPLs libraries as just a set -of link options as, for example:: +**NOTE:** It is generally *not recommended* to specify the TPLs libraries as +just a set of link options as, for example:: TPL_SomeTPL_LIBRARIES="-L/some/dir;-llib1;-llib2;..." -This is not compatible with proper CMake usage and it not guaranteed to be -supported for all use cases or all platforms. (CMake really wants to have -full library paths when linking.) +But this is supported as long as this link line contains only link library +directories and library names. (Link options that are not order-sensitive are +also supported like ``-mkl``.) When the variables ``TPL__INCLUDE_DIRS`` and ``TPL__LIBRARIES`` are not specified, then most ``FindTPL.cmake`` modules use a default find operation. Some will -call ``find_package()`` internally by default and some may implement -the default find in some other way. To know for sure, see the documentation -for the specific TPL (e.g. looking in the ``FindTPL.cmake`` file to -be sure). NOTE: if a given ``FindTPL.cmake`` would use -``find_package()`` by default, this can be disabled by configuring -with:: +call ``find_package()`` internally by default and some may +implement the default find in some other way. To know for sure, see the +documentation for the specific external package/TPL (e.g. looking in the +``FindTPL.cmake`` file to be sure). NOTE: if a given +``FindTPL.cmake`` will use ``find_package()`` by +default, this can be disabled by configuring with:: -D_ALLOW_PACKAGE_PREFIND=OFF -Most TPLs, however, use a standard system for finding include directories -and/or libraries based on the function +(Not all ``FindTPL.cmake`` files support this option.) + +Many ``FindTPL.cmake`` files, use the legacy TriBITS TPL system for +finding include directories and/or libraries based on the function `tribits_tpl_find_include_dirs_and_libraries()`_. These simple standard ``FindTPL.cmake`` modules specify a set of header files and/or libraries that must be found. The directories where these header files and @@ -1684,9 +1733,9 @@ library files are looked for are specified using the CMake cache variables: files will be searched for using ``find_library()``, for each library, in order. -Most ``FindTPL.cmake`` modules will define a default set of libraries -to look for and therefore ``_LIBRARY_NAMES`` can typically be left -off. +Most of these ``FindTPL.cmake`` modules will define a default set of +libraries to look for and therefore ``_LIBRARY_NAMES`` can typically +be left off. Therefore, to find the same set of libraries for ``SimpleTPL`` shown above, one would specify:: @@ -1698,30 +1747,14 @@ override that using:: -D SomeTPL_LIBRARY_NAMES="lib1;lib2" -Therefore, this is in fact the preferred way to specify the libraries for a -TPL. +Therefore, this is in fact the preferred way to specify the libraries for +these legacy TriBITS TPLs. In order to allow a TPL that normally requires one or more libraries to ignore the libraries, one can set ``_LIBRARY_NAMES`` to empty, for example:: -D _LIBRARY_NAMES="" -Optional package-specific support for a TPL can be turned off by setting:: - - -D _ENABLE_=OFF - -This gives the user full control over what TPLs are supported by which package -independent of whether the TPL is enabled or not. - -Support for an optional TPL can also be turned on implicitly by setting:: - - -D _ENABLE_=ON - -where ```` is a TriBITS package that has an optional -dependency on ````. That will result in setting -``TPL_ENABLE_=ON`` internally (but not set in the cache) if -``TPL_ENABLE_=OFF`` is not already set. - If all the parts of a TPL are not found on an initial configure, the configure will error out with a helpful error message. In that case, one can change the variables ``_INCLUDE_DIRS``, ``_LIBRARY_NAMES``, and/or @@ -1731,14 +1764,6 @@ a complete configure from scratch which saves time. Or, one can avoid the find operations by directly setting ``TPL__INCLUDE_DIRS`` and ``TPL__LIBRARIES`` as described above. -**WARNING:** The cmake cache variable ``TPL__LIBRARY_DIRS`` does -**not** control where libraries are found. Instead, this variable is set -during the find processes and is not actually used in the CMake build system -at all. - -In summary, this gives the user complete and direct control in specifying -exactly what is used in the build process. - **TPL Example 1: Standard BLAS Library** Suppose one wants to find the standard BLAS library ``blas`` in the @@ -1842,7 +1867,7 @@ libraries in the right order by configuring with:: Adjusting upstream dependencies for a Third-Party Library (TPL) ---------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Some TPLs have dependencies on one or more upstream TPLs. These dependencies must be specified correctly for the compile and links to work correctly. The @@ -1857,34 +1882,38 @@ the upstream TPLs are enabled), set:: A dependency on an upstream TPL ```` will be set if the an upstream TPL ```` is actually enabled. -If any of the specified TPLs are listed after ```` in the -``TPLsList.cmake`` file or are not enabled, then a configure-time error will -occur. +If any of the specified dependent TPLs ```` are listed after +```` in the ``TPLsList.cmake`` file (or are not listed at all), then +a configure-time error will occur. To take complete control over what dependencies an TPL has, set:: -D _LIB_ENABLED_DEPENDENCIES=";;..." If the upstream TPLs listed here are not defined upstream and enabled TPLs, -then an error will occur. +then a configure-time error will occur. Disabling support for a Third-Party Library (TPL) --------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++ Disabling a TPL explicitly can be done using:: -D TPL_ENABLE_=OFF +This will result in the disabling of any direct or indirect downstream +packages that have a required dependency on ```` as described in +`Disable a package and all its dependencies`_. + NOTE: If a disabled TPL is a required dependency of some explicitly enabled downstream package, then the configure will error out if -_DISABLE_ENABLED_FORWARD_DEP_PACKAGES=OFF. Otherwise, a WARNING will -be printed and the downstream package will be disabled and configuration will -continue. +`_DISABLE_ENABLED_FORWARD_DEP_PACKAGES`_ ``= OFF``. Otherwise, a +NOTE will be printed and the downstream package will be disabled and +configuration will continue. Disabling tentatively enabled TPLs ----------------------------------- +++++++++++++++++++++++++++++++++++ To disable a tentatively enabled TPL, set:: @@ -1908,7 +1937,7 @@ also want to explicitly disable the TPL as shown above. Require all TPL libraries be found ----------------------------------- +++++++++++++++++++++++++++++++++++ By default, some TPLs don't require that all of the libraries listed in ``_LIBRARY_NAMES`` be found. To change this behavior so that all @@ -1920,7 +1949,7 @@ This makes the configure process catch more mistakes with the env. Disable warnings from TPL header files --------------------------------------- +++++++++++++++++++++++++++++++++++++++ To disable warnings coming from included TPL header files for C and C++ code, set:: @@ -1939,9 +1968,8 @@ project is pulling in module files from TPLs. xSDK Configuration Options -------------------------- -The configure of will adhere to the xSDK configuration standard -(todo: put in reference to final document) simply by setting the CMake cache -variable:: +The configure of will adhere to the `xSDK Community Package +Policies`_ simply by setting the CMake cache variable:: -D USE_XSDK_DEFAULTS=TRUE @@ -2061,6 +2089,26 @@ This will override the global behavior set by ````. +Adjusting CMake DEPRECATION warnings +------------------------------------ + +By default, deprecated TriBITS features being used in the project's CMake +files will result in CMake deprecation warning messages (issued by calling +``message(DEPRECATION ...)`` internally). The handling of these deprecation +warnings can be changed by setting the CMake cache variable +``TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE``. For example, to remove all +deprecation warnings, set:: + + -D TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE=IGNORE + +Other valid values include: + +* ``DEPRECATION``: Issue a CMake ``DEPRECATION`` message and continue (default). +* ``AUTHOR_WARNING``: Issue a CMake ``AUTHOR_WARNING`` message and continue. +* ``SEND_ERROR``: Issue a CMake ``SEND_ERROR`` message and continue. +* ``FATAL_ERROR``: Issue a CMake ``FATAL_ERROR`` message and exit. + + Disabling deprecated code ------------------------- @@ -2887,13 +2935,19 @@ package directories. In development mode, the failure to find a package directory is usually a programming error (i.e. a miss-spelled package directory name). But in a tarball release of the project, package directories may be purposefully missing (see `Creating a tarball of the source tree`_) and -must be ignored. When building from a reduced source tarball created from the +must be ignored. + +When building from a reduced source tarball created from the development sources, set:: - -D _ASSERT_MISSING_PACKAGES=OFF + -D _ASSERT_DEFINED_DEPENDENCIES=OFF + +or to ``IGNORE``. (valid values include ``FATAL_ERROR``, ``SEND_ERROR``, +``WARNING``, ``NOTICE``, ``IGNORE`` and ``OFF``) Setting this ``OFF`` will cause the TriBITS CMake configure to simply ignore -any missing packages and turn off all dependencies on these missing packages. +any undefined packages and turn off all dependencies on these missing +packages. Another type of checking is for optional inserted/external packages (e.g. packages who's source can optionally be included and is flagged with @@ -2904,27 +2958,29 @@ printed by configuring with:: -D _WARN_ABOUT_MISSING_EXTERNAL_PACKAGES=TRUE -These warnings (starting with 'NOTE', not 'WARNING' that would otherwise -trigger warnings in CDash) about missing inserted/external packages will print -regardless of the setting for ``_ASSERT_MISSING_PACKAGES``. +These warnings starting with 'NOTE' (not starting with 'WARNING' that would +otherwise trigger warnings in CDash) about missing inserted/external packages +will print regardless of the setting for +``_ASSERT_DEFINED_DEPENDENCIES``. Finally, ``_ENABLE_DEVELOPMENT_MODE=ON`` results in a number of checks for invalid usage of TriBITS in the project's ``CMakeLists.txt`` files -and will abort configure with a fatal error on the first check failure. This -is appropriate for development mode when a project is clean of all such -invalid usage patterns but there are times when it makes sense to report these -check failures in different ways (such as when upgrading TriBITS in a project -that has some invalid usage patterns that just happen work but may be +and will, by default, abort configure with a fatal error on the first failed +check. This is appropriate for development mode when a project is clean of all +such invalid usage patterns but there are times when it makes sense to report +these check failures in different ways (such as when upgrading TriBITS in a +project that has some invalid usage patterns that just happen work but may be disallowed in future versions of TriBITS). To change how these invalid usage checks are handled, set:: -D _ASSERT_CORRECT_TRIBITS_USAGE= -where ```` can be 'FATAL_ERROR', 'SEND_ERROR', 'WARNING', or -'IGNORE'. +where ```` can be ``FATAL_ERROR``, ``SEND_ERROR``, ``WARNING``, +``IGNORE`` or ``OFF`` (where ``IGNORE`` or ``OFF`` avoids any error reporting +or warnings). For ``_ENABLE_DEVELOPMENT_MODE=OFF``, the default for -``_ASSERT_CORRECT_TRIBITS_USAGE`` is actually set to ``IGNORE``. +``_ASSERT_CORRECT_TRIBITS_USAGE`` is set to ``IGNORE``. Building (Makefile generator) @@ -4048,10 +4104,10 @@ generators on your system). NOTE: When configuring from an untarred source tree that has missing packages, one must configure with:: - -D _ASSERT_MISSING_PACKAGES=OFF + -D _ASSERT_DEFINED_DEPENDENCIES=OFF Otherwise, TriBITS will error out complaining about missing packages. (Note -that ``_ASSERT_MISSING_PACKAGES`` will default to ```OFF``` in +that ``_ASSERT_DEFINED_DEPENDENCIES`` will default to ```OFF``` in release mode, i.e. ``_ENABLE_DEVELOPMENT_MODE==OFF``.) @@ -4302,4 +4358,6 @@ dashboard``. .. _TriBITS TribitsExampleApp Tests: https://github.com/TriBITSPub/TriBITS/blob/master/test/core/ExamplesUnitTests/TribitsExampleApp_Tests.cmake +.. _xSDK Community Package Policies: https://doi.org/10.6084/m9.figshare.4495136 + .. LocalWords: templated instantiation Makefiles CMake diff --git a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableAllPackages.txt b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableAllPackages.txt index 07c2c9d87e59..da111da02420 100644 --- a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableAllPackages.txt +++ b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableAllPackages.txt @@ -8,10 +8,13 @@ Enabling all packages that are not currently disabled because of \ -- Setting Trilinos_ENABLE_ThyraEpetra=ON -- Setting Trilinos_ENABLE_Thyra=ON -Enabling all remaining required TPLs for current set of enabled packages ... +Enabling all required (and optional since Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES=ON) upstream packages for current set of enabled packages +(Trilinos_ENABLE_SECONDARY_TESTED_CODE=OFF) ... --- Setting TPL_ENABLE_BLAS=ON because it is required by the enabled package Teuchos --- Setting TPL_ENABLE_LAPACK=ON because it is required by the enabled package Teuchos +-- NOTE: Not Setting Trilinos_ENABLE_ThyraGoodStuff=ON even though Thyra has an optional dependence on ThyraGoodStuff because Trilinos_ENABLE_SECONDARY_TESTED_CODE=OFF +-- NOTE: Not Setting Trilinos_ENABLE_ThyraEpetraExt=ON even though Thyra has an optional dependence on ThyraEpetraExt because Trilinos_ENABLE_SECONDARY_TESTED_CODE=OFF +-- Setting TPL_ENABLE_BLAS=ON because Epetra has a required dependence on BLAS +-- Setting TPL_ENABLE_LAPACK=ON because Epetra has a required dependence on LAPACK Final set of enabled top-level packages: Teuchos RTOp Epetra Thyra 4 Final set of enabled packages: Teuchos RTOp Epetra ThyraCoreLibs ThyraEpetra Thyra 6 diff --git a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyraEpetra_EnableTests.txt b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyraEpetra_EnableTests.txt index 9ad431f62a25..0d3f79b5ccd8 100644 --- a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyraEpetra_EnableTests.txt +++ b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyraEpetra_EnableTests.txt @@ -21,11 +21,8 @@ Enabling all required (and optional since Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES= -- Setting Trilinos_ENABLE_ThyraCoreLibs=ON because ThyraEpetra has a required dependence on ThyraCoreLibs -- Setting Trilinos_ENABLE_Teuchos=ON because ThyraCoreLibs has a required dependence on Teuchos -- Setting Trilinos_ENABLE_RTOp=ON because ThyraCoreLibs has a required dependence on RTOp - -Enabling all remaining required TPLs for current set of enabled packages ... - --- Setting TPL_ENABLE_BLAS=ON because it is required by the enabled package Teuchos --- Setting TPL_ENABLE_LAPACK=ON because it is required by the enabled package Teuchos +-- Setting TPL_ENABLE_BLAS=ON because Epetra has a required dependence on BLAS +-- Setting TPL_ENABLE_LAPACK=ON because Epetra has a required dependence on LAPACK Enabling the shell of non-enabled parent packages (mostly for show) that have at least one subpackage enabled ... diff --git a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests.txt b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests.txt index 46e1cdc7ae5c..c66d07690338 100644 --- a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests.txt +++ b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests.txt @@ -40,17 +40,14 @@ Enabling all required (and optional since Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES= -- Setting Trilinos_ENABLE_Epetra=ON because ThyraEpetra has a required dependence on Epetra -- Setting Trilinos_ENABLE_Teuchos=ON because ThyraCoreLibs has a required dependence on Teuchos -- Setting Trilinos_ENABLE_RTOp=ON because ThyraCoreLibs has a required dependence on RTOp +-- Setting TPL_ENABLE_BLAS=ON because Epetra has a required dependence on BLAS +-- Setting TPL_ENABLE_LAPACK=ON because Epetra has a required dependence on LAPACK Enabling all optional intra-package enables _ENABLE_ that are not currently disabled if both sets of packages are enabled ... -- Setting Thyra_ENABLE_ThyraEpetra=ON since Trilinos_ENABLE_Thyra=ON AND Trilinos_ENABLE_ThyraEpetra=ON -Enabling all remaining required TPLs for current set of enabled packages ... - --- Setting TPL_ENABLE_BLAS=ON because it is required by the enabled package Teuchos --- Setting TPL_ENABLE_LAPACK=ON because it is required by the enabled package Teuchos - Final set of enabled top-level packages: Teuchos RTOp Epetra Thyra 4 Final set of enabled packages: Teuchos RTOp Epetra ThyraCoreLibs ThyraEpetra Thyra 6 Final set of non-enabled top-level packages: Triutils EpetraExt 2 diff --git a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST.txt b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST.txt index 00efe417fd24..3aa2f7a337f0 100644 --- a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST.txt +++ b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST.txt @@ -40,27 +40,38 @@ Enabling all required (and optional since Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES= -- Setting Trilinos_ENABLE_Teuchos=ON because ThyraCoreLibs has a required dependence on Teuchos -- Setting Trilinos_ENABLE_RTOp=ON because ThyraCoreLibs has a required dependence on RTOp -- Setting Trilinos_ENABLE_Triutils=ON because EpetraExt has an optional dependence on Triutils +-- Setting TPL_ENABLE_BLAS=ON because Epetra has a required dependence on BLAS +-- Setting TPL_ENABLE_LAPACK=ON because Epetra has a required dependence on LAPACK Enabling all optional intra-package enables _ENABLE_ that are \ not currently disabled if both sets of packages are enabled ... --- Setting EpetraExt_ENABLE_Triutils=ON since Trilinos_ENABLE_EpetraExt=ON \ - AND Trilinos_ENABLE_Triutils=ON --- Setting Thyra_ENABLE_ThyraGoodStuff=ON since Trilinos_ENABLE_Thyra=ON \ - AND Trilinos_ENABLE_ThyraGoodStuff=ON --- Setting Thyra_ENABLE_ThyraEpetra=ON since Trilinos_ENABLE_Thyra=ON \ - AND Trilinos_ENABLE_ThyraEpetra=ON --- Setting Thyra_ENABLE_ThyraEpetraExt=ON since Trilinos_ENABLE_Thyra=ON \ - AND Trilinos_ENABLE_ThyraEpetraExt=ON - -Enabling all remaining required TPLs for current set of enabled packages ... - --- Setting TPL_ENABLE_BLAS=ON because it is required by the enabled package Teuchos --- Setting TPL_ENABLE_LAPACK=ON because it is required by the enabled package Teuchos - -Enabling all optional package TPL support _ENABLE_ not currently disabled for enabled TPLs ... - --- Setting Teuchos_ENABLE_Boost=ON since TPL_ENABLE_Boost=ON +-- Setting Teuchos_ENABLE_BLAS=ON since Trilinos_ENABLE_Teuchos=ON AND TPL_ENABLE_BLAS=ON +-- Setting Teuchos_ENABLE_LAPACK=ON since Trilinos_ENABLE_Teuchos=ON AND TPL_ENABLE_LAPACK=ON +-- Setting Teuchos_ENABLE_Boost=ON since Trilinos_ENABLE_Teuchos=ON AND TPL_ENABLE_Boost=ON +-- NOT setting Teuchos_ENABLE_MPI=ON since MPI is NOT enabled at this point! +-- Setting RTOp_ENABLE_Teuchos=ON since Trilinos_ENABLE_RTOp=ON AND Trilinos_ENABLE_Teuchos=ON +-- Setting Epetra_ENABLE_BLAS=ON since Trilinos_ENABLE_Epetra=ON AND TPL_ENABLE_BLAS=ON +-- Setting Epetra_ENABLE_LAPACK=ON since Trilinos_ENABLE_Epetra=ON AND TPL_ENABLE_LAPACK=ON +-- NOT setting Epetra_ENABLE_MPI=ON since MPI is NOT enabled at this point! +-- Setting Triutils_ENABLE_Epetra=ON since Trilinos_ENABLE_Triutils=ON AND Trilinos_ENABLE_Epetra=ON +-- Setting EpetraExt_ENABLE_Teuchos=ON since Trilinos_ENABLE_EpetraExt=ON AND Trilinos_ENABLE_Teuchos=ON +-- Setting EpetraExt_ENABLE_Epetra=ON since Trilinos_ENABLE_EpetraExt=ON AND Trilinos_ENABLE_Epetra=ON +-- Setting EpetraExt_ENABLE_Triutils=ON since Trilinos_ENABLE_EpetraExt=ON AND Trilinos_ENABLE_Triutils=ON +-- NOT setting EpetraExt_ENABLE_UMFPACK=ON since UMFPACK is NOT enabled at this point! +-- NOT setting EpetraExt_ENABLE_AMD=ON since AMD is NOT enabled at this point! +-- NOT setting EpetraExt_ENABLE_PETSC=ON since PETSC is NOT enabled at this point! +-- Setting ThyraCoreLibs_ENABLE_Teuchos=ON since Trilinos_ENABLE_ThyraCoreLibs=ON AND Trilinos_ENABLE_Teuchos=ON +-- Setting ThyraCoreLibs_ENABLE_RTOp=ON since Trilinos_ENABLE_ThyraCoreLibs=ON AND Trilinos_ENABLE_RTOp=ON +-- Setting ThyraGoodStuff_ENABLE_ThyraCoreLibs=ON since Trilinos_ENABLE_ThyraGoodStuff=ON AND Trilinos_ENABLE_ThyraCoreLibs=ON +-- Setting ThyraEpetra_ENABLE_Epetra=ON since Trilinos_ENABLE_ThyraEpetra=ON AND Trilinos_ENABLE_Epetra=ON +-- Setting ThyraEpetra_ENABLE_ThyraCoreLibs=ON since Trilinos_ENABLE_ThyraEpetra=ON AND Trilinos_ENABLE_ThyraCoreLibs=ON +-- Setting ThyraEpetraExt_ENABLE_ThyraEpetra=ON since Trilinos_ENABLE_ThyraEpetraExt=ON AND Trilinos_ENABLE_ThyraEpetra=ON +-- Setting ThyraEpetraExt_ENABLE_EpetraExt=ON since Trilinos_ENABLE_ThyraEpetraExt=ON AND Trilinos_ENABLE_EpetraExt=ON +-- Setting Thyra_ENABLE_ThyraCoreLibs=ON since Trilinos_ENABLE_Thyra=ON AND Trilinos_ENABLE_ThyraCoreLibs=ON +-- Setting Thyra_ENABLE_ThyraGoodStuff=ON since Trilinos_ENABLE_Thyra=ON AND Trilinos_ENABLE_ThyraGoodStuff=ON +-- Setting Thyra_ENABLE_ThyraEpetra=ON since Trilinos_ENABLE_Thyra=ON AND Trilinos_ENABLE_ThyraEpetra=ON +-- Setting Thyra_ENABLE_ThyraEpetraExt=ON since Trilinos_ENABLE_Thyra=ON AND Trilinos_ENABLE_ThyraEpetraExt=ON Final set of enabled top-level packages: Teuchos RTOp Epetra Triutils EpetraExt Thyra 6 Final set of enabled packages: Teuchos RTOp Epetra Triutils EpetraExt ThyraCoreLibs \ diff --git a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST_RequiredOnly.txt b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST_RequiredOnly.txt index 3647d4d81d82..268535389cf3 100644 --- a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST_RequiredOnly.txt +++ b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/EnableThyra_EnableTests_EnableBoost_ST_RequiredOnly.txt @@ -47,25 +47,37 @@ Enabling all required upstream packages for current set of \ dependence on Teuchos -- Setting Trilinos_ENABLE_RTOp=ON because ThyraCoreLibs has a required \ dependence on RTOp +-- Setting TPL_ENABLE_BLAS=ON because Epetra has a required dependence on BLAS +-- Setting TPL_ENABLE_LAPACK=ON because Epetra has a required dependence on LAPACK Enabling all optional intra-package enables _ENABLE_ \ that are not currently disabled if both sets of packages are enabled ... --- Setting Thyra_ENABLE_ThyraGoodStuff=ON since Trilinos_ENABLE_Thyra=ON \ - AND Trilinos_ENABLE_ThyraGoodStuff=ON --- Setting Thyra_ENABLE_ThyraEpetra=ON since Trilinos_ENABLE_Thyra=ON \ - AND Trilinos_ENABLE_ThyraEpetra=ON --- Setting Thyra_ENABLE_ThyraEpetraExt=ON since Trilinos_ENABLE_Thyra=ON \ - AND Trilinos_ENABLE_ThyraEpetraExt=ON - -Enabling all remaining required TPLs for current set of enabled packages ... - --- Setting TPL_ENABLE_BLAS=ON because it is required by the enabled package Teuchos --- Setting TPL_ENABLE_LAPACK=ON because it is required by the enabled package Teuchos - -Enabling all optional package TPL support _ENABLE_ not currently disabled for enabled TPLs ... - --- Setting Teuchos_ENABLE_Boost=ON since TPL_ENABLE_Boost=ON +-- Setting Teuchos_ENABLE_BLAS=ON since Trilinos_ENABLE_Teuchos=ON AND TPL_ENABLE_BLAS=ON +-- Setting Teuchos_ENABLE_LAPACK=ON since Trilinos_ENABLE_Teuchos=ON AND TPL_ENABLE_LAPACK=ON +-- Setting Teuchos_ENABLE_Boost=ON since Trilinos_ENABLE_Teuchos=ON AND TPL_ENABLE_Boost=ON +-- NOT setting Teuchos_ENABLE_MPI=ON since MPI is NOT enabled at this point! +-- Setting RTOp_ENABLE_Teuchos=ON since Trilinos_ENABLE_RTOp=ON AND Trilinos_ENABLE_Teuchos=ON +-- Setting Epetra_ENABLE_BLAS=ON since Trilinos_ENABLE_Epetra=ON AND TPL_ENABLE_BLAS=ON +-- Setting Epetra_ENABLE_LAPACK=ON since Trilinos_ENABLE_Epetra=ON AND TPL_ENABLE_LAPACK=ON +-- NOT setting Epetra_ENABLE_MPI=ON since MPI is NOT enabled at this point! +-- Setting EpetraExt_ENABLE_Teuchos=ON since Trilinos_ENABLE_EpetraExt=ON AND Trilinos_ENABLE_Teuchos=ON +-- Setting EpetraExt_ENABLE_Epetra=ON since Trilinos_ENABLE_EpetraExt=ON AND Trilinos_ENABLE_Epetra=ON +-- NOT setting EpetraExt_ENABLE_Triutils=ON since Triutils is NOT enabled at this point! +-- NOT setting EpetraExt_ENABLE_UMFPACK=ON since UMFPACK is NOT enabled at this point! +-- NOT setting EpetraExt_ENABLE_AMD=ON since AMD is NOT enabled at this point! +-- NOT setting EpetraExt_ENABLE_PETSC=ON since PETSC is NOT enabled at this point! +-- Setting ThyraCoreLibs_ENABLE_Teuchos=ON since Trilinos_ENABLE_ThyraCoreLibs=ON AND Trilinos_ENABLE_Teuchos=ON +-- Setting ThyraCoreLibs_ENABLE_RTOp=ON since Trilinos_ENABLE_ThyraCoreLibs=ON AND Trilinos_ENABLE_RTOp=ON +-- Setting ThyraGoodStuff_ENABLE_ThyraCoreLibs=ON since Trilinos_ENABLE_ThyraGoodStuff=ON AND Trilinos_ENABLE_ThyraCoreLibs=ON +-- Setting ThyraEpetra_ENABLE_Epetra=ON since Trilinos_ENABLE_ThyraEpetra=ON AND Trilinos_ENABLE_Epetra=ON +-- Setting ThyraEpetra_ENABLE_ThyraCoreLibs=ON since Trilinos_ENABLE_ThyraEpetra=ON AND Trilinos_ENABLE_ThyraCoreLibs=ON +-- Setting ThyraEpetraExt_ENABLE_ThyraEpetra=ON since Trilinos_ENABLE_ThyraEpetraExt=ON AND Trilinos_ENABLE_ThyraEpetra=ON +-- Setting ThyraEpetraExt_ENABLE_EpetraExt=ON since Trilinos_ENABLE_ThyraEpetraExt=ON AND Trilinos_ENABLE_EpetraExt=ON +-- Setting Thyra_ENABLE_ThyraCoreLibs=ON since Trilinos_ENABLE_Thyra=ON AND Trilinos_ENABLE_ThyraCoreLibs=ON +-- Setting Thyra_ENABLE_ThyraGoodStuff=ON since Trilinos_ENABLE_Thyra=ON AND Trilinos_ENABLE_ThyraGoodStuff=ON +-- Setting Thyra_ENABLE_ThyraEpetra=ON since Trilinos_ENABLE_Thyra=ON AND Trilinos_ENABLE_ThyraEpetra=ON +-- Setting Thyra_ENABLE_ThyraEpetraExt=ON since Trilinos_ENABLE_Thyra=ON AND Trilinos_ENABLE_ThyraEpetraExt=ON Final set of enabled top-level packages: Teuchos RTOp Epetra EpetraExt Thyra 5 Final set of enabled packages: Teuchos RTOp Epetra EpetraExt ThyraCoreLibs ThyraGoodStuff ThyraEpetra ThyraEpetraExt Thyra 9 diff --git a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt index 3d636a3b981a..51dbaaa44879 100644 --- a/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt +++ b/cmake/tribits/doc/guides/ReducedMockTrilinosOutput/ExpectedDependencies.txt @@ -15,73 +15,96 @@ Package dependencies information: -- Trilinos_DEFINED_PACKAGES: MPI BLAS LAPACK Boost UMFPACK AMD PETSC Teuchos RTOp Epetra Triutils EpetraExt ThyraCoreLibs ThyraGoodStuff ThyraCrazyStuff ThyraEpetra ThyraEpetraExt Thyra -- Trilinos_NUM_DEFINED_PACKAGES='18' --- Teuchos_LIB_REQUIRED_DEP_TPLS: BLAS LAPACK --- Teuchos_LIB_OPTIONAL_DEP_TPLS: Boost MPI +-- MPI_FORWARD_LIB_DEFINED_DEPENDENCIES: Teuchos[O] Epetra[O] --- RTOp_LIB_REQUIRED_DEP_PACKAGES: Teuchos +-- BLAS_FORWARD_LIB_DEFINED_DEPENDENCIES: LAPACK[R] Teuchos[R] Epetra[R] --- Epetra_LIB_REQUIRED_DEP_TPLS: BLAS LAPACK --- Epetra_LIB_OPTIONAL_DEP_TPLS: MPI +-- LAPACK_LIB_DEFINED_DEPENDENCIES: BLAS[R] +-- LAPACK_FORWARD_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Epetra[R] --- Triutils_LIB_REQUIRED_DEP_PACKAGES: Epetra +-- Boost_FORWARD_LIB_DEFINED_DEPENDENCIES: Teuchos[O] --- EpetraExt_LIB_REQUIRED_DEP_PACKAGES: Teuchos Epetra --- EpetraExt_LIB_OPTIONAL_DEP_PACKAGES: Triutils --- EpetraExt_LIB_OPTIONAL_DEP_TPLS: UMFPACK AMD PETSC +-- UMFPACK_FORWARD_LIB_DEFINED_DEPENDENCIES: EpetraExt[O] --- ThyraCoreLibs_LIB_REQUIRED_DEP_PACKAGES: Teuchos RTOp +-- AMD_FORWARD_LIB_DEFINED_DEPENDENCIES: EpetraExt[O] --- ThyraGoodStuff_LIB_REQUIRED_DEP_PACKAGES: ThyraCoreLibs +-- PETSC_FORWARD_LIB_DEFINED_DEPENDENCIES: EpetraExt[O] --- ThyraCrazyStuff_LIB_REQUIRED_DEP_PACKAGES: ThyraGoodStuff +-- Teuchos_LIB_DEFINED_DEPENDENCIES: BLAS[R] LAPACK[R] Boost[O] MPI[O] +-- Teuchos_FORWARD_LIB_DEFINED_DEPENDENCIES: RTOp[R] EpetraExt[R] ThyraCoreLibs[R] --- ThyraEpetra_LIB_REQUIRED_DEP_PACKAGES: Epetra ThyraCoreLibs +-- RTOp_LIB_DEFINED_DEPENDENCIES: Teuchos[R] +-- RTOp_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs[R] --- ThyraEpetraExt_LIB_REQUIRED_DEP_PACKAGES: ThyraEpetra EpetraExt +-- Epetra_LIB_DEFINED_DEPENDENCIES: BLAS[R] LAPACK[R] MPI[O] +-- Epetra_FORWARD_LIB_DEFINED_DEPENDENCIES: Triutils[R] EpetraExt[R] ThyraEpetra[R] --- Thyra_LIB_REQUIRED_DEP_PACKAGES: ThyraCoreLibs --- Thyra_LIB_OPTIONAL_DEP_PACKAGES: ThyraGoodStuff ThyraCrazyStuff ThyraEpetra ThyraEpetraExt +-- Triutils_LIB_DEFINED_DEPENDENCIES: Epetra[R] +-- Triutils_FORWARD_LIB_DEFINED_DEPENDENCIES: EpetraExt[O] -Dumping direct dependencies for each package ... +-- EpetraExt_LIB_DEFINED_DEPENDENCIES: Teuchos[R] Epetra[R] Triutils[O] UMFPACK[O] AMD[O] PETSC[O] +-- EpetraExt_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraEpetraExt[R] --- MPI_LIB_DEFINED_DEPENDENCIES: +-- ThyraCoreLibs_LIB_DEFINED_DEPENDENCIES: Teuchos[R] RTOp[R] +-- ThyraCoreLibs_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraGoodStuff[R] ThyraEpetra[R] Thyra[R] --- BLAS_LIB_DEFINED_DEPENDENCIES: +-- ThyraGoodStuff_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs[R] +-- ThyraGoodStuff_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraCrazyStuff[R] Thyra[O] --- LAPACK_LIB_DEFINED_DEPENDENCIES: +-- ThyraCrazyStuff_LIB_DEFINED_DEPENDENCIES: ThyraGoodStuff[R] +-- ThyraCrazyStuff_FORWARD_LIB_DEFINED_DEPENDENCIES: Thyra[O] --- Boost_LIB_DEFINED_DEPENDENCIES: +-- ThyraEpetra_LIB_DEFINED_DEPENDENCIES: Epetra[R] ThyraCoreLibs[R] +-- ThyraEpetra_FORWARD_LIB_DEFINED_DEPENDENCIES: ThyraEpetraExt[R] Thyra[O] --- UMFPACK_LIB_DEFINED_DEPENDENCIES: +-- ThyraEpetraExt_LIB_DEFINED_DEPENDENCIES: ThyraEpetra[R] EpetraExt[R] +-- ThyraEpetraExt_FORWARD_LIB_DEFINED_DEPENDENCIES: Thyra[O] --- AMD_LIB_DEFINED_DEPENDENCIES: +-- Thyra_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs[R] ThyraGoodStuff[O] ThyraCrazyStuff[O] ThyraEpetra[O] ThyraEpetraExt[O] --- PETSC_LIB_DEFINED_DEPENDENCIES: +Dumping direct enabled dependencies for each package ... --- Teuchos_LIB_ENABLED_DEPENDENCIES: BLAS LAPACK --- Teuchos_LIB_DEFINED_DEPENDENCIES: BLAS LAPACK Boost MPI +-- MPI: No enabled dependencies! --- RTOp_LIB_ENABLED_DEPENDENCIES: Teuchos --- RTOp_LIB_DEFINED_DEPENDENCIES: Teuchos +-- BLAS: No enabled dependencies! --- Epetra_LIB_ENABLED_DEPENDENCIES: BLAS LAPACK --- Epetra_LIB_DEFINED_DEPENDENCIES: BLAS LAPACK MPI +-- LAPACK_LIB_ENABLED_DEPENDENCIES: BLAS[R] --- Triutils_LIB_DEFINED_DEPENDENCIES: Epetra +-- Boost: No enabled dependencies! --- EpetraExt_LIB_DEFINED_DEPENDENCIES: Teuchos Epetra Triutils UMFPACK AMD PETSC +-- UMFPACK: No enabled dependencies! --- ThyraCoreLibs_LIB_ENABLED_DEPENDENCIES: Teuchos RTOp --- ThyraCoreLibs_LIB_DEFINED_DEPENDENCIES: Teuchos RTOp +-- AMD: No enabled dependencies! --- ThyraGoodStuff_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs +-- PETSC: No enabled dependencies! --- ThyraCrazyStuff_LIB_DEFINED_DEPENDENCIES: ThyraGoodStuff +-- Teuchos_LIB_ENABLED_DEPENDENCIES: BLAS[R] LAPACK[R] --- ThyraEpetra_LIB_ENABLED_DEPENDENCIES: Epetra ThyraCoreLibs --- ThyraEpetra_LIB_DEFINED_DEPENDENCIES: Epetra ThyraCoreLibs +-- RTOp_LIB_ENABLED_DEPENDENCIES: Teuchos[R] --- ThyraEpetraExt_LIB_DEFINED_DEPENDENCIES: ThyraEpetra EpetraExt +-- Epetra_LIB_ENABLED_DEPENDENCIES: BLAS[R] LAPACK[R] --- Thyra_LIB_ENABLED_DEPENDENCIES: ThyraCoreLibs ThyraEpetra --- Thyra_LIB_DEFINED_DEPENDENCIES: ThyraCoreLibs ThyraGoodStuff ThyraCrazyStuff ThyraEpetra ThyraEpetraExt +-- Triutils: No enabled dependencies! + +-- EpetraExt: No enabled dependencies! + +-- ThyraCoreLibs_LIB_ENABLED_DEPENDENCIES: Teuchos[R] RTOp[R] + +-- ThyraGoodStuff: No enabled dependencies! + +-- ThyraCrazyStuff: No enabled dependencies! + +-- ThyraEpetra_LIB_ENABLED_DEPENDENCIES: Epetra[R] ThyraCoreLibs[R] + +-- ThyraEpetraExt: No enabled dependencies! + +-- Thyra_LIB_ENABLED_DEPENDENCIES: ThyraCoreLibs[R] ThyraEpetra[O] + +Setting up export dependencies for all enabled packages ... + +-- Teuchos: No library dependencies! +-- RTOp_FULL_ENABLED_DEP_PACKAGES: Teuchos +-- Epetra: No library dependencies! +-- ThyraCoreLibs_FULL_ENABLED_DEP_PACKAGES: RTOp Teuchos +-- ThyraEpetra_FULL_ENABLED_DEP_PACKAGES: ThyraCoreLibs Epetra RTOp Teuchos +-- Thyra_FULL_ENABLED_DEP_PACKAGES: ThyraEpetra ThyraCoreLibs Epetra RTOp Teuchos diff --git a/cmake/tribits/doc/guides/TribitsCoreDetailedReference.rst b/cmake/tribits/doc/guides/TribitsCoreDetailedReference.rst index 50a99b926381..2cc0fb95e97d 100644 --- a/cmake/tribits/doc/guides/TribitsCoreDetailedReference.rst +++ b/cmake/tribits/doc/guides/TribitsCoreDetailedReference.rst @@ -61,6 +61,7 @@ The global project-level TriBITS options for which defaults can be provided by a given TriBITS project are: * `${PROJECT_NAME}_ASSERT_CORRECT_TRIBITS_USAGE`_ +* `${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES`_ * `${PROJECT_NAME}_C_Standard`_ * `${PROJECT_NAME}_CHECK_FOR_UNPARSED_ARGUMENTS`_ * `${PROJECT_NAME}_CONFIGURE_OPTIONS_FILE_APPEND`_ @@ -97,6 +98,7 @@ a given TriBITS project are: * `CMAKE_INSTALL_RPATH_USE_LINK_PATH`_ * `MPI_EXEC_MAX_NUMPROCS`_ * `PythonInterp_FIND_VERSION`_ +* `TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE`_ These options are described below. @@ -120,6 +122,25 @@ These options are described below. in the project's base `/ProjectName.cmake`_ file. + +.. _${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES: + +**${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES** + + To set ``${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES`` a different default, + set:: + + set(${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES_DEFAULT ) + + in the project's base `/ProjectName.cmake`_ file, where + ```` can be ``FATAL_ERROR``, ``SEND_ERROR``, ``WARNING``, + ``NOTICE`` or ``IGNORE`` + + Otherwise, the default is ``WARNING`` when + ``${PROJECT_NAME}_ENABLE_DEVELOPMENT_MODE`` is ``ON`` and if ``IGNORE`` if + ``${PROJECT_NAME}_ENABLE_DEVELOPMENT_MODE`` is ``OFF``. + + .. _${PROJECT_NAME}_C_Standard: **${PROJECT_NAME}_C_Standard** @@ -349,11 +370,12 @@ These options are described below. to ``OFF`` when creating a release (see `Project and Repository Versioning and Release Mode`_). When ``${PROJECT_NAME}_ENABLE_DEVELOPMENT_MODE`` is ``ON``, several other variables are given defaults appropriate for - development mode. For example, ``${PROJECT_NAME}_ASSERT_MISSING_PACKAGES`` - is set to ``ON`` by default in development mode but is set to ``OFF`` by - default in release mode. In addition, strong compiler warnings are enabled - by default in development mode but are disabled by default in release mode. - This variable also affects the behavior of `tribits_set_st_for_dev_mode()`_. + development mode. For example, + ``${PROJECT_NAME}_ASSERT_DEFINED_DEPENDENCIES`` is set to ``FATAL_ERROR`` by + default in development mode but is set to ``IGNORE`` by default in release + mode. In addition, strong compiler warnings are enabled by default in + development mode but are disabled by default in release mode. This variable + also affects the behavior of `tribits_set_st_for_dev_mode()`_. .. _${PROJECT_NAME}_ENABLE_Fortran: @@ -841,6 +863,19 @@ These options are described below. -D PythonInterp_FIND_VERSION="3.6.2" +.. _TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE: + +**TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE** + + Determines how the function `tribits_deprecated()`_ behaves. To change the + default behavor, such as call ``message(FATAL_ERROR ...)``, set:: + + set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_DEFAULT FATAL_ERROR) + + in the project's `/ProjectName.cmake`_ file, or + `/CMakeLists.txt`_ file, or on the individual package basis in + its `/CMakeLists.txt`_ file. + TriBITS Macros and Functions ---------------------------- diff --git a/cmake/tribits/doc/guides/TribitsGuidesBody.rst b/cmake/tribits/doc/guides/TribitsGuidesBody.rst index f6ab1b1b733f..876566808da4 100644 --- a/cmake/tribits/doc/guides/TribitsGuidesBody.rst +++ b/cmake/tribits/doc/guides/TribitsGuidesBody.rst @@ -1780,6 +1780,8 @@ defined: the package is in relation to other packages. NOTE: This variable is **only** defined if the package is actually enabled! + .. _${PACKAGE_NAME}_PARENT_REPOSITORY: + ``${PACKAGE_NAME}_PARENT_REPOSITORY`` The name of the package's parent repository. This can be used by a @@ -2161,8 +2163,8 @@ version will be used all of the downstream packages that uses it. Also, by defining a TriBITS TPL, automatic enable/disable logic will be applied as described in `Package Dependencies and Enable/Disable Logic`_. For example, if an external package/TPL is explicitly disabled, all of the downstream -packages that depend on it will be automatically disabled as well (see `TPL -disable triggers auto-disables of downstream dependencies`_). +packages that depend on it will be automatically disabled as well (see +`Package disable triggers auto-disables of downstream dependencies`_). .. _Globally unique TriBITS TPL names: @@ -3361,21 +3363,20 @@ system are: 6) `EX TPLs given default unset enable/disable state`_ 7) `Required TPLs are auto-enabled for enabled packages`_ 8) `Optional TPLs only enabled explicitly by the user`_ -9) `TPL disable triggers auto-disables of downstream dependencies`_ -10) `Disables trump enables where there is a conflict`_ -11) `Enable/disable of parent package is enable/disable for subpackages`_ -12) `Enable/disable of parent package tests/examples is enable/disable for subpackages tests/examples`_ -13) `Subpackage enable does not auto-enable the parent package`_ -14) `Support for optional package/TPL is enabled by default`_ -15) `Support for optional package can be explicitly disabled`_ -16) `Explicit enable of optional package/TPL support auto-enables package/TPL`_ -17) `ST packages only auto-enabled if ST code is enabled`_ -18) `_ENABLE_ALL_FORWARD_DEP_PACKAGES enables downstream packages/tests`_ -19) `_ENABLE_ALL_PACKAGES enables all PT (cond. ST) packages`_ -20) `_ENABLE_TESTS only enables explicitly enabled package tests`_ -21) `If no packages are enabled, nothing will get built`_ -22) `TriBITS prints all enables and disables to stdout`_ -23) `TriBITS auto-enables/disables done using non-cache local variables`_ +9) `Disables trump enables where there is a conflict`_ +10) `Enable/disable of parent package is enable/disable for subpackages`_ +11) `Enable/disable of parent package tests/examples is enable/disable for subpackages tests/examples`_ +12) `Subpackage enable does not auto-enable the parent package`_ +13) `Support for optional package/TPL is enabled by default`_ +14) `Support for optional package can be explicitly disabled`_ +15) `Explicit enable of optional package/TPL support auto-enables package/TPL`_ +16) `ST packages only auto-enabled if ST code is enabled`_ +17) `_ENABLE_ALL_FORWARD_DEP_PACKAGES enables downstream packages/tests`_ +18) `_ENABLE_ALL_PACKAGES enables all PT (cond. ST) packages`_ +19) `_ENABLE_TESTS only enables explicitly enabled package tests`_ +20) `If no packages are enabled, nothing will get built`_ +21) `TriBITS prints all enables and disables to stdout`_ +22) `TriBITS auto-enables/disables done using non-cache local variables`_ In more detail, these rules/behaviors are: @@ -3443,15 +3444,16 @@ In more detail, these rules/behaviors are: .. _Package disable triggers auto-disables of downstream dependencies: -4) **Package disable triggers auto-disables of downstream dependencies**: - Any package ```` can be explicitly **disabled** by the - user by setting the cache variable - ``${PROJECT_NAME}_ENABLE_=OFF`` - (e.g. ``Trilinos_ENABLE_Teuchos=OFF``). When an package is explicitly - disabled, it will result in the disable of all `downstream`_ packages - that have required dependency on it. It will also disable optional support - for the disabled packages in downstream packages that list it as an - optional dependency. For an example, see `Explicit disable of a package`_. +4) **Package disable triggers auto-disables of downstream dependencies**: Any + package ```` can be explicitly **disabled** by the user by + setting the cache variable ``${PROJECT_NAME}_ENABLE_=OFF`` + (or ``TPL_ENABLE_=OFF`` for an external package/TPL) + (e.g. ``Trilinos_ENABLE_Teuchos=OFF``, ``TPL_ENABLE_BLAS=OFF``). When an + package is explicitly disabled, it will result in the disable of all + dependent `downstream`_ external packages/TPLs and internal packages that + have required dependency on it. It will also disable optional support for + the disabled packages in downstream packages that list it as an optional + dependency. For an example, see `Explicit disable of a package`_. .. _PT/ST TPLs given default unset enable/disable state: @@ -3505,24 +3507,9 @@ In more detail, these rules/behaviors are: ``TPL_ENABLE_Boost=ON``. For an example, see `Explicit enable of a package, its tests, an optional TPL, with ST enabled`_. -.. _TPL disable triggers auto-disables of downstream dependencies: - -9) **TPL disable triggers auto-disables of downstream dependencies**: Any TPLs - that are explicitly disabled (i.e. ``TPL_ENABLE_=OFF``) will - result in the disable of all `downstream`_ dependent packages that have a - required dependency on the TPL. For example, if the user sets - ``TPL_ENABLE_LAPACK=OFF``, then this will result in the disable of packages - ``Teuchos`` and ``Epetra``, and all of the required packages downstream - from them. Also, the explicitly disabled TPL will result in the disable of - optional support in all downstream packages. For example, if the user sets - ``TPL_ENABLE_MPI=OFF``, then TriBITS will automatically set - ``Teuchos_ENABLE_MPI=OFF`` and ``Epetra_ENABLE_MPI=OFF``. For examples, - see `Explicit disable of an optional TPL`_ and `Explicit disable of a - required TPL`_. - .. _Disables trump enables where there is a conflict: -10) **Disables trump enables where there is a conflict** and TriBITS will +9) **Disables trump enables where there is a conflict** and TriBITS will never override a disable in order to satisfy some dependency. For example, if the user sets ``Trilinos_ENABLE_Teuchos=OFF`` and ``Trilinos_ENABLE_RTOp=ON``, then TriBITS will **not** override the @@ -3553,7 +3540,7 @@ In more detail, these rules/behaviors are: .. _Enable/disable of parent package is enable/disable for subpackages: -11) **Enable/disable of parent package is enable/disable for subpackages**: An +10) **Enable/disable of parent package is enable/disable for subpackages**: An explicit enable/disable of a top-level parent package with subpackages with ``${PROJECT_NAME}_ENABLE_=(ON|OFF)`` is equivalent to the explicit enable/disable of all of the parent package's subpackages. @@ -3576,7 +3563,7 @@ In more detail, these rules/behaviors are: .. _Enable/disable of parent package tests/examples is enable/disable for subpackages tests/examples: -12) **Enable/disable of parent package tests/examples is enable/disable for +11) **Enable/disable of parent package tests/examples is enable/disable for subpackages tests/examples**: Setting ``_ENABLE_TESTS=[ON|OFF]`` is equivalent to setting the default for ``_ENABLE_TESTS=[ON|OFF]`` for each @@ -3590,7 +3577,7 @@ In more detail, these rules/behaviors are: .. _Subpackage enable does not auto-enable the parent package: -13) **Subpackage enable does not auto-enable the parent package**: Enabling an +12) **Subpackage enable does not auto-enable the parent package**: Enabling an package that is a subpackage does **not** automatically enable the parent package (except for at the very end, mostly just for show). For example, enabling the package ``ThyraEpetra`` does not result in enable @@ -3613,7 +3600,7 @@ In more detail, these rules/behaviors are: .. _Support for optional package/TPL is enabled by default: -14) **Support for optional package/TPL is enabled by default**: For an package +13) **Support for optional package/TPL is enabled by default**: For an package ```` with an optional dependency on an `upstream`_ package or TPL ````, TriBITS will automatically set the intra-enable variable @@ -3630,7 +3617,7 @@ In more detail, these rules/behaviors are: .. _Support for optional package can be explicitly disabled: -15) **Support for optional package can be explicitly disabled:** Even +14) **Support for optional package can be explicitly disabled:** Even though TriBITS will automatically set ``_ENABLE_=ON`` by default if ```` and ```` are both @@ -3650,7 +3637,7 @@ In more detail, these rules/behaviors are: .. _Explicit enable of optional package/TPL support auto-enables package/TPL: -16) **Explicit enable of optional package/TPL support auto-enables +15) **Explicit enable of optional package/TPL support auto-enables package/TPL**: If the user explicitly enables the TriBITS package ```` and explicitly sets ``_ENABLE_=ON`` on input, @@ -3670,7 +3657,7 @@ In more detail, these rules/behaviors are: .. _ST packages only auto-enabled if ST code is enabled: -17) **ST packages only auto-enabled if ST code is enabled**: TriBITS will +16) **ST packages only auto-enabled if ST code is enabled**: TriBITS will only enable an optional ``ST`` package when ``${PROJECT_NAME}_ENABLE_ALL_OPTIONAL_PACKAGES=ON`` if ``${PROJECT_NAME}_SECONDARY_TESTED_CODE=ON`` is also set. Otherwise, when @@ -3689,7 +3676,7 @@ In more detail, these rules/behaviors are: .. __ENABLE_ALL_FORWARD_DEP_PACKAGES enables downstream packages/tests: -18) **_ENABLE_ALL_FORWARD_DEP_PACKAGES enables downstream packages/tests**: +17) **_ENABLE_ALL_FORWARD_DEP_PACKAGES enables downstream packages/tests**: Setting the user cache-variable ``${PROJECT_NAME}_ENABLE_ALL_FORWARD_PACKAGES=ON`` will result in the `downstream`_ ``PT`` packages and tests to be enabled (and all ``PT`` @@ -3707,7 +3694,7 @@ In more detail, these rules/behaviors are: .. __ENABLE_ALL_PACKAGES enables all PT (cond. ST) packages: -19) **_ENABLE_ALL_PACKAGES enables all PT (cond. ST) packages**: +18) **_ENABLE_ALL_PACKAGES enables all PT (cond. ST) packages**: Setting the user cache-variable ``${PROJECT_NAME}_ENABLE_ALL_PACKAGES=ON`` will result in the enable of all ``PT`` packages when ``${PROJECT_NAME}_SECONDARY_TESTED_CODE=OFF`` and all ``PT`` and ``ST`` @@ -3726,7 +3713,7 @@ In more detail, these rules/behaviors are: .. __ENABLE_TESTS only enables explicitly enabled package tests: -20) **_ENABLE_TESTS only enables explicitly enabled package +19) **_ENABLE_TESTS only enables explicitly enabled package tests**: Setting ``${PROJECT_NAME}_ENABLE_TESTS=ON`` will **only enable tests for explicitly enabled packages** on input. For example, configuring with ``Trilinos_ENABLE_RTOp=ON`` and @@ -3741,7 +3728,7 @@ In more detail, these rules/behaviors are: .. _If no packages are enabled, nothing will get built: -21) **If no packages are enabled, nothing will get built**: Most TriBITS +20) **If no packages are enabled, nothing will get built**: Most TriBITS projects are set up such that if the user does not explicitly enable at least one package in some way, then nothing will be enabled or built. In this case, when ``${PROJECT_NAME}_ALLOW_NO_PACKAGES=TRUE`` a warning @@ -3755,7 +3742,7 @@ In more detail, these rules/behaviors are: .. _TriBITS prints all enables and disables to stdout: -22) **TriBITS prints all enables and disables to stdout**: TriBITS prints out +21) **TriBITS prints all enables and disables to stdout**: TriBITS prints out (to ``cmake`` stdout) the initial set of enables/disables on input, prints a line whenever it sets (or overrides) an enable or disable, and prints out the final set of enables/disables. Therefore, the user just needs to @@ -3768,7 +3755,7 @@ In more detail, these rules/behaviors are: .. _TriBITS auto-enables/disables done using non-cache local variables: -23) **TriBITS auto-enables/disables done using non-cache local variables**: +22) **TriBITS auto-enables/disables done using non-cache local variables**: TriBITS setting (or overrides) of enable/disable cache variables are done by setting local non-cache variables at the top project-level scope (i.e. the ``/CMakeLists.txt`` file scope). This is done so diff --git a/cmake/tribits/doc/guides/TribitsMacroFunctionDocTemplate.rst b/cmake/tribits/doc/guides/TribitsMacroFunctionDocTemplate.rst index c045c1962e54..c0916454df5b 100644 --- a/cmake/tribits/doc/guides/TribitsMacroFunctionDocTemplate.rst +++ b/cmake/tribits/doc/guides/TribitsMacroFunctionDocTemplate.rst @@ -44,6 +44,7 @@ @MACRO: tribits_project_enable_all() + @MACRO: tribits_repository_define_packages() + @MACRO: tribits_repository_define_tpls() + +@MACRO: tribits_set_and_inc_dirs() + @FUNCTION: tribits_set_st_for_dev_mode() + @MACRO: tribits_subpackage() + @MACRO: tribits_subpackage_postprocess() + diff --git a/cmake/tribits/doc/guides/TribitsSystemMacroFunctionDocTemplate.rst b/cmake/tribits/doc/guides/TribitsSystemMacroFunctionDocTemplate.rst index e42125762328..a8c9f53d216a 100644 --- a/cmake/tribits/doc/guides/TribitsSystemMacroFunctionDocTemplate.rst +++ b/cmake/tribits/doc/guides/TribitsSystemMacroFunctionDocTemplate.rst @@ -13,8 +13,9 @@ understand the internals of TriBITS. @FUNCTION: tribits_abort_on_missing_package() + @FUNCTION: tribits_abort_on_self_dep() + @MACRO: tribits_adjust_package_enables() + -@FUNCTION: tribits_append_forward_dep_packages() + +@MACRO: tribits_append_forward_dep_packages() + @MACRO: tribits_assert_read_dependency_vars() + +@FUNCTION: tribits_dump_package_dependencies_info() + @FUNCTION: tribits_extpkg_add_find_upstream_dependencies_str() + @FUNCTION: tribits_extpkg_create_all_libs_target() + @FUNCTION: tribits_extpkg_install_config_file() + @@ -22,7 +23,10 @@ understand the internals of TriBITS. @FUNCTION: tribits_extpkg_process_libraries_list() + @MACRO: tribits_extpkg_setup_enabled_dependencies() + @FUNCTION: tribits_extpkg_write_config_version_file() + -@FUNCTION: tribits_dump_package_dependencies_info() + +@FUNCTION: tribits_get_sublist_disabled() + +@FUNCTION: tribits_get_sublist_enabled() + +@FUNCTION: tribits_get_sublist_nondisabled() + +@FUNCTION: tribits_get_sublist_nonenabled() + @FUNCTION: tribits_print_initial_dependency_info() + @FUNCTION: tribits_print_tentatively_enabled_tpls() + @MACRO: tribits_parse_subpackages_append_packages_add_options() + @@ -42,7 +46,7 @@ understand the internals of TriBITS. @MACRO: tribits_read_subpackage_deps_file_add_to_graph() + @MACRO: tribits_read_toplevel_package_deps_files_add_to_graph() + @MACRO: tribits_save_off_dependency_vars() + -@FUNCTION: tribits_set_dep_packages() + +@MACRO: tribits_set_dep_packages() + @FUNCTION: tribits_trace_file_processing() + @FUNCTION: tribits_write_package_client_export_files_install_targets() + @MACRO: tribits_write_xml_dependency_files() + diff --git a/cmake/tribits/doc/guides/UtilsMacroFunctionDocTemplate.rst b/cmake/tribits/doc/guides/UtilsMacroFunctionDocTemplate.rst index f5c4cf3970d2..acc98214c162 100644 --- a/cmake/tribits/doc/guides/UtilsMacroFunctionDocTemplate.rst +++ b/cmake/tribits/doc/guides/UtilsMacroFunctionDocTemplate.rst @@ -31,7 +31,6 @@ @FUNCTION: print_var() + @FUNCTION: print_var_with_spaces() + @FUNCTION: remove_global_duplicates() + -@MACRO: set_and_inc_dirs() + @FUNCTION: set_cache_on_off_empty() + @MACRO: set_default() + @MACRO: set_default_and_from_env() + @@ -39,6 +38,10 @@ @FUNCTION: timer_get_raw_seconds() + @FUNCTION: timer_get_rel_seconds() + @FUNCTION: timer_print_rel_time() + +@FUNCTION: tribits_add_enum_cache_var() + +@FUNCTION: tribits_deprecated() + +@FUNCTION: tribits_deprecated_command() + +@MACRO: tribits_create_reverse_list() + @FUNCTION: tribits_strip_quotes_from_str() + @FUNCTION: unittest_compare_const() + @FUNCTION: unittest_has_substr_const() + diff --git a/cmake/tribits/doc/guides/users_guide/TribitsUsersGuide.rst b/cmake/tribits/doc/guides/users_guide/TribitsUsersGuide.rst index 96d44b9e9abe..be4cee320ff3 100644 --- a/cmake/tribits/doc/guides/users_guide/TribitsUsersGuide.rst +++ b/cmake/tribits/doc/guides/users_guide/TribitsUsersGuide.rst @@ -106,3 +106,5 @@ Appendix .. _tribits_read_all_project_deps_files_create_deps_graph(): TribitsMaintainersGuide.html#tribits-read-all-project-deps-files-create-deps-graph .. _${PACKAGE_NAME}_LIB_DEFINED_DEPENDENCIES: TribitsMaintainersGuide.html#package-name-lib-enabled-dependencies + +.. _${PACKAGE_NAME}_TEST_DEFINED_DEPENDENCIES: TribitsMaintainersGuide.html#package-name-test-enabled-dependencies diff --git a/cmake/tribits/examples/InsertedPkg/CMakeLists.txt b/cmake/tribits/examples/InsertedPkg/CMakeLists.txt index 59554162100b..7df9c56e8157 100644 --- a/cmake/tribits/examples/InsertedPkg/CMakeLists.txt +++ b/cmake/tribits/examples/InsertedPkg/CMakeLists.txt @@ -1,6 +1,6 @@ tribits_package(InsertedPkg) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) tribits_add_library( externalpkg diff --git a/cmake/tribits/examples/MixedSharedStaticLibs/shared_only/CMakeLists.txt b/cmake/tribits/examples/MixedSharedStaticLibs/shared_only/CMakeLists.txt index 5a4746eda691..7cec4e8cad26 100644 --- a/cmake/tribits/examples/MixedSharedStaticLibs/shared_only/CMakeLists.txt +++ b/cmake/tribits/examples/MixedSharedStaticLibs/shared_only/CMakeLists.txt @@ -1,6 +1,6 @@ tribits_subpackage(SharedOnly) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) tribits_add_library( shared_only_lib diff --git a/cmake/tribits/examples/MixedSharedStaticLibs/static_only/CMakeLists.txt b/cmake/tribits/examples/MixedSharedStaticLibs/static_only/CMakeLists.txt index 62e8bddd8490..7df2594891a6 100644 --- a/cmake/tribits/examples/MixedSharedStaticLibs/static_only/CMakeLists.txt +++ b/cmake/tribits/examples/MixedSharedStaticLibs/static_only/CMakeLists.txt @@ -1,6 +1,6 @@ tribits_subpackage(StaticOnly) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) tribits_add_library( static_only_lib diff --git a/cmake/tribits/examples/MockTrilinos/TPLsList.cmake b/cmake/tribits/examples/MockTrilinos/TPLsList.cmake index 7e9335cf2908..e83c918dce24 100644 --- a/cmake/tribits/examples/MockTrilinos/TPLsList.cmake +++ b/cmake/tribits/examples/MockTrilinos/TPLsList.cmake @@ -10,6 +10,7 @@ tribits_repository_define_tpls( ADOLC cmake/TPLs/ ST ADIC cmake/TPLs/ EX TVMET cmake/TPLs/ ST + #Zlib cmake/TPLs/ PT # Listed in zoltan/cmake/Dependencies.cmake! y12m cmake/TPLs/ ST SuperLUDist cmake/TPLs/ ST SuperLU cmake/TPLs/ ST diff --git a/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLLAPACKDependencies.cmake b/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLLAPACKDependencies.cmake new file mode 100644 index 000000000000..0256dbbfd4dd --- /dev/null +++ b/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLLAPACKDependencies.cmake @@ -0,0 +1,2 @@ +tribits_extpkg_define_dependencies( LAPACK + DEPENDENCIES BLAS) diff --git a/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLParMETISDependencies.cmake b/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLParMETISDependencies.cmake new file mode 100644 index 000000000000..d999aca2b2ae --- /dev/null +++ b/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLParMETISDependencies.cmake @@ -0,0 +1,2 @@ +tribits_extpkg_define_dependencies( ParMETIS + DEPENDENCIES METIS) diff --git a/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDependencies.cmake b/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDependencies.cmake new file mode 100644 index 000000000000..47a938258d0d --- /dev/null +++ b/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDependencies.cmake @@ -0,0 +1,2 @@ +tribits_extpkg_define_dependencies( SuperLU + DEPENDENCIES ParMETIS BLAS) diff --git a/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDistDependencies.cmake b/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDistDependencies.cmake new file mode 100644 index 000000000000..d0419545d2cd --- /dev/null +++ b/cmake/tribits/examples/MockTrilinos/cmake/TPLs/FindTPLSuperLUDistDependencies.cmake @@ -0,0 +1,2 @@ +tribits_extpkg_define_dependencies( SuperLUDist + DEPENDENCIES ParMETIS BLAS) diff --git a/cmake/tribits/examples/MockTrilinos/packages/zoltan/cmake/Dependencies.cmake b/cmake/tribits/examples/MockTrilinos/packages/zoltan/cmake/Dependencies.cmake index 06261248bff8..5d3bfcfe0062 100644 --- a/cmake/tribits/examples/MockTrilinos/packages/zoltan/cmake/Dependencies.cmake +++ b/cmake/tribits/examples/MockTrilinos/packages/zoltan/cmake/Dependencies.cmake @@ -37,6 +37,12 @@ # ************************************************************************ # @HEADER +if (SHOW_INVALID_TPL_NAME_ERROR) + set(Zlib_str Zlib) +else() + set(Zlib_str "") +endif() + tribits_package_define_dependencies( - LIB_OPTIONAL_TPLS MPI ParMETIS Scotch Zlib + LIB_OPTIONAL_TPLS MPI ParMETIS Scotch ${Zlib_str} ) diff --git a/cmake/tribits/examples/ReducedMockTrilinos/TPLsList.cmake b/cmake/tribits/examples/ReducedMockTrilinos/TPLsList.cmake index 542b88f79412..4de9acf2a02c 100644 --- a/cmake/tribits/examples/ReducedMockTrilinos/TPLsList.cmake +++ b/cmake/tribits/examples/ReducedMockTrilinos/TPLsList.cmake @@ -1,8 +1,8 @@ tribits_repository_define_tpls( - MPI "${${PROJECT_NAME}_TRIBITS_DIR}/core/std_tpls/" PT - BLAS "${${PROJECT_NAME}_TRIBITS_DIR}/core/std_tpls/" PT - LAPACK "${${PROJECT_NAME}_TRIBITS_DIR}/core/std_tpls/" PT - Boost "${${PROJECT_NAME}_TRIBITS_DIR}/core/std_tpls/" ST + MPI "${${PROJECT_NAME}_TRIBITS_DIR}/core/std_tpls/" PT + BLAS "${${PROJECT_NAME}_TRIBITS_DIR}/common_tpls/" PT + LAPACK "${${PROJECT_NAME}_TRIBITS_DIR}/common_tpls/" PT + Boost cmake/TPLs/ ST UMFPACK cmake/TPLs/ ST AMD cmake/TPLs/ EX PETSC "${${PROJECT_NAME}_TRIBITS_DIR}/common_tpls/" ST diff --git a/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/PackagesList.cmake b/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/PackagesList.cmake new file mode 100644 index 000000000000..41002b84335d --- /dev/null +++ b/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/PackagesList.cmake @@ -0,0 +1,3 @@ +tribits_repository_define_packages( + DependsOnLAPACK . PT + ) diff --git a/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/TPLsList.cmake b/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/TPLsList.cmake new file mode 100644 index 000000000000..e85baf197743 --- /dev/null +++ b/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/TPLsList.cmake @@ -0,0 +1 @@ +tribits_repository_define_tpls() diff --git a/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/cmake/Dependencies.cmake b/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/cmake/Dependencies.cmake new file mode 100644 index 000000000000..3f688dcd49e9 --- /dev/null +++ b/cmake/tribits/examples/ReducedMockTrilinos/extraRepos/DependsOnLAPACK/cmake/Dependencies.cmake @@ -0,0 +1,3 @@ +tribits_package_define_dependencies( + LIB_REQUIRED_TPLS LAPACK + ) diff --git a/cmake/tribits/examples/TargetDefinesPkg/CMakeLists.txt b/cmake/tribits/examples/TargetDefinesPkg/CMakeLists.txt index 4ca9cd0fa681..0952d5736ffd 100644 --- a/cmake/tribits/examples/TargetDefinesPkg/CMakeLists.txt +++ b/cmake/tribits/examples/TargetDefinesPkg/CMakeLists.txt @@ -1,6 +1,6 @@ tribits_package(TargetDefinesPkg) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) tribits_add_library( targetdefinespkg diff --git a/cmake/tribits/examples/TribitsExampleApp/AppHelperFuncs.cmake b/cmake/tribits/examples/TribitsExampleApp/AppHelperFuncs.cmake index 471f33eb2d20..bfd38d81577b 100644 --- a/cmake/tribits/examples/TribitsExampleApp/AppHelperFuncs.cmake +++ b/cmake/tribits/examples/TribitsExampleApp/AppHelperFuncs.cmake @@ -65,7 +65,6 @@ macro(getTribitsExProjStuffForAppByProject) message(" TribitsExProj_DIR = ${TribitsExProj_DIR}") message(" TribitsExProj_VERSION = ${TribitsExProj_VERSION}") message(" TribitsExProj_PACKAGE_LIST = ${TribitsExProj_PACKAGE_LIST}") - message(" TribitsExProj_TPL_LIST = ${TribitsExProj_TPL_LIST}") message(" TribitsExProj_BUILD_SHARED_LIBS = ${TribitsExProj_BUILD_SHARED_LIBS}") message("End of TribitsExProj details\n") @@ -139,7 +138,7 @@ endfunction() # function(getExpectedAppDepsStr expectedDepsStrOut) - if ("SimpleTpl" IN_LIST SimpleCxx_TPL_LIST) + if (TARGET SimpleTpl::all_libs) set(simpleCxxDeps "simpletpl ") else() set(simpleCxxDeps "") diff --git a/cmake/tribits/examples/TribitsExampleProject/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject/CMakeLists.txt index a44121b807fa..f413d381b010 100644 --- a/cmake/tribits/examples/TribitsExampleProject/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject/CMakeLists.txt @@ -27,6 +27,8 @@ include("${CMAKE_CURRENT_SOURCE_DIR}/ProjectName.cmake") # not in an include file :-( project(${PROJECT_NAME} NONE) +set(TRIBITS_HIDE_DEPRECATED_INCLUDE_DIRECTORIES_OVERRIDE TRUE) + # # B) Pull in the TriBITS system and execute # diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/mixed_lang/src/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject/packages/mixed_lang/src/CMakeLists.txt index a8d33b430650..ddbeb6658fe0 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/mixed_lang/src/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject/packages/mixed_lang/src/CMakeLists.txt @@ -4,12 +4,12 @@ tribits_configure_file(${PACKAGE_NAME}_config.h) set(HEADERS "") set(SOURCES "") -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +tribits_include_directories(${CMAKE_CURRENT_BINARY_DIR}) append_set(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) append_set(HEADERS MixedLang.hpp Ray_Tracer.hh diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/src/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/src/CMakeLists.txt index d00de0da8757..234a196d5144 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/src/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/src/CMakeLists.txt @@ -11,12 +11,12 @@ tribits_configure_file(${PACKAGE_NAME}_config.h) set(HEADERS "") set(SOURCES "") -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +tribits_include_directories(${CMAKE_CURRENT_BINARY_DIR}) append_set(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) append_set(HEADERS SimpleCxx_HelloWorld.hpp ) diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/CMakeLists.txt index 4b39105c91bc..f553d4ef2bc9 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/CMakeLists.txt @@ -1,3 +1,6 @@ +tribits_include_directories( REQUIRED_DURING_INSTALLATION_TESTING + ${CMAKE_CURRENT_SOURCE_DIR}/inc ) + tribits_add_executable_and_test( HelloWorldTests SOURCES diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/SimpleCxx_HelloWorld_Tests.cpp b/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/SimpleCxx_HelloWorld_Tests.cpp index 575555ffbe59..85430c8cffea 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/SimpleCxx_HelloWorld_Tests.cpp +++ b/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/SimpleCxx_HelloWorld_Tests.cpp @@ -1,9 +1,4 @@ - -#include -#include -#include -#include "SimpleCxx_HelloWorld.hpp" -#include "HeaderOnlyTpl_stuff.hpp" +#include "SimpleCxx_HelloWorld_Tests.hpp" #define TEST_FIND_SUBSTR_IN_STR(SUBSTR, STR) \ diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/inc/SimpleCxx_HelloWorld_Tests.hpp b/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/inc/SimpleCxx_HelloWorld_Tests.hpp new file mode 100644 index 000000000000..78b70ccc3d89 --- /dev/null +++ b/cmake/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/inc/SimpleCxx_HelloWorld_Tests.hpp @@ -0,0 +1,10 @@ +#ifndef SIMPLECXX_HELLOWORLD_TESTS_HPP +#define SIMPLECXX_HELLOWORLD_TESTS_HPP + +#include +#include +#include +#include "SimpleCxx_HelloWorld.hpp" +#include "HeaderOnlyTpl_stuff.hpp" + +#endif // SIMPLECXX_HELLOWORLD_TESTS_HPP diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/a/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/a/CMakeLists.txt index e7cdf9cf6f63..9de350b0a25a 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/a/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/a/CMakeLists.txt @@ -16,9 +16,9 @@ tribits_pkg_export_cache_var(${PACKAGE_NAME}_SPECIAL_VALUE) tribits_configure_file(${PACKAGE_NAME}_config.h) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +tribits_include_directories(${CMAKE_CURRENT_BINARY_DIR}) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) tribits_add_library(pws_a SOURCES A.cpp HEADERS A.hpp ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/src/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/src/CMakeLists.txt index cde554625db3..0f64659a5c98 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/src/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/src/CMakeLists.txt @@ -1,10 +1,10 @@ tribits_configure_file(${PACKAGE_NAME}_config.h) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +tribits_include_directories(${CMAKE_CURRENT_BINARY_DIR}) include(${CMAKE_CURRENT_LIST_DIR}/ShowLibErrors.cmake) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_BINARY_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) tribits_add_library(pws_b SOURCES B.cpp HEADERS B.hpp ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/tests/testlib/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/tests/testlib/CMakeLists.txt index 407fc6a27fe7..215659e60f2b 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/tests/testlib/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/tests/testlib/CMakeLists.txt @@ -1,6 +1,6 @@ # Define the include dirs for the TESTONLY lib. -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) # # Create a test-only b_mixed_lang lib which uses the optional test dependent diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/c/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/c/CMakeLists.txt index 475912fac4ab..696a5815c850 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/c/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject/packages/with_subpackages/c/CMakeLists.txt @@ -7,7 +7,7 @@ tribits_add_executable( c_util include(${CMAKE_CURRENT_LIST_DIR}/ShowLibErrors.cmake) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) tribits_add_library(pws_c SOURCES C.cpp HEADERS wsp_c/C.hpp diff --git a/cmake/tribits/examples/TribitsExampleProject/packages/wrap_external/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject/packages/wrap_external/CMakeLists.txt index 3adfc2cdb90b..0efcd994f721 100644 --- a/cmake/tribits/examples/TribitsExampleProject/packages/wrap_external/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject/packages/wrap_external/CMakeLists.txt @@ -145,7 +145,7 @@ add_dependencies(build_external_func pws_a) append_set(${PACKAGE_NAME}_LIB_TARGETS external_func) global_set(${PACKAGE_NAME}_LIBRARIES external_func pws_a) global_set(${PACKAGE_NAME}_HAS_NATIVE_LIBRARIES ON) -include_directories(${EXTERNAL_FUNC_SOURCE_DIR}) +tribits_include_directories(${EXTERNAL_FUNC_SOURCE_DIR}) # NOTE: Above, you have to add the upstream dependent libraries to the current # package's list of libraries because you can't link to an importing lib with # link_target_libraries() :-( diff --git a/cmake/tribits/examples/TribitsExampleProject2/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject2/CMakeLists.txt index 661cb556e0a0..8e63bc40e843 100644 --- a/cmake/tribits/examples/TribitsExampleProject2/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject2/CMakeLists.txt @@ -7,6 +7,7 @@ cmake_minimum_required(VERSION 3.17.0 FATAL_ERROR) include("${CMAKE_CURRENT_SOURCE_DIR}/ProjectName.cmake") project(${PROJECT_NAME} LANGUAGES NONE) +set(TRIBITS_HIDE_DEPRECATED_INCLUDE_DIRECTORIES_OVERRIDE TRUE) set(${PROJECT_NAME}_TRIBITS_DIR "${CMAKE_CURRENT_LIST_DIR}/../.." CACHE STRING "TriBITS base directory (default assumes in TriBITS source tree)") diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.txt index a0d23199e246..b74162bb25ed 100644 --- a/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.txt @@ -1,7 +1,7 @@ set(HEADERS "") set(SOURCES "") -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) append_set(HEADERS Package1.hpp diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package2/src/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject2/packages/package2/src/CMakeLists.txt index 1de2194cb03a..5f95a0ef0b9a 100644 --- a/cmake/tribits/examples/TribitsExampleProject2/packages/package2/src/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package2/src/CMakeLists.txt @@ -2,9 +2,9 @@ set(HEADERS "") set(SOURCES "") tribits_configure_file(${PACKAGE_NAME}_config.h) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +tribits_include_directories(${CMAKE_CURRENT_BINARY_DIR}) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) append_set(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h diff --git a/cmake/tribits/examples/TribitsExampleProject2/packages/package3/src/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProject2/packages/package3/src/CMakeLists.txt index ffe0ecc60d12..8b36f56b97af 100644 --- a/cmake/tribits/examples/TribitsExampleProject2/packages/package3/src/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProject2/packages/package3/src/CMakeLists.txt @@ -2,9 +2,9 @@ set(HEADERS "") set(SOURCES "") tribits_configure_file(${PACKAGE_NAME}_config.h) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +tribits_include_directories(${CMAKE_CURRENT_BINARY_DIR}) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) append_set(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h diff --git a/cmake/tribits/examples/TribitsExampleProjectAddons/packages/addon1/src/CMakeLists.txt b/cmake/tribits/examples/TribitsExampleProjectAddons/packages/addon1/src/CMakeLists.txt index d4fffaa075b4..c890968cdb23 100644 --- a/cmake/tribits/examples/TribitsExampleProjectAddons/packages/addon1/src/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsExampleProjectAddons/packages/addon1/src/CMakeLists.txt @@ -1,4 +1,4 @@ -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) tribits_add_library(addon1 SOURCES Addon1.cpp HEADERS Addon1.hpp diff --git a/cmake/tribits/examples/TribitsOldSimpleExampleApp/CMakeLists.txt b/cmake/tribits/examples/TribitsOldSimpleExampleApp/CMakeLists.txt index 34302ee7b669..b0d9d5d0699b 100644 --- a/cmake/tribits/examples/TribitsOldSimpleExampleApp/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsOldSimpleExampleApp/CMakeLists.txt @@ -52,11 +52,14 @@ target_include_directories(app enable_testing() -if ("SimpleTpl" IN_LIST TribitsExProj_TPL_LIST) +if ("SimpleTpl" IN_LIST TribitsExProj_TPL_LIST OR TARGET SimpleTpl::all_libs) set(simpleCxxDeps "simpletpl headeronlytpl") else() set(simpleCxxDeps "headeronlytpl") endif() +# NOTE: Above, TribitsExProj_TPL_LIST does not exist in new TriBITS so to make +# this work for new TriBITS as well, we need to check for target +# SimpleTpl::all_libs. Small price to pay for progress! add_test(NAME util_test COMMAND util) set_tests_properties(util_test PROPERTIES diff --git a/cmake/tribits/examples/TribitsSimpleExampleApp/CMakeLists.txt b/cmake/tribits/examples/TribitsSimpleExampleApp/CMakeLists.txt index 425e0717cdde..58725b4fc565 100644 --- a/cmake/tribits/examples/TribitsSimpleExampleApp/CMakeLists.txt +++ b/cmake/tribits/examples/TribitsSimpleExampleApp/CMakeLists.txt @@ -39,7 +39,7 @@ target_link_libraries(app PRIVATE TribitsExProj::all_selected_libs) enable_testing() -if ("SimpleTpl" IN_LIST TribitsExProj_TPL_LIST) +if (TARGET SimpleTpl::all_libs) set(simpleCxxDeps "simpletpl headeronlytpl") else() set(simpleCxxDeps "headeronlytpl") diff --git a/commonTools/gtest/CMakeLists.txt b/commonTools/gtest/CMakeLists.txt index 210d6218c186..72535fe88c20 100644 --- a/commonTools/gtest/CMakeLists.txt +++ b/commonTools/gtest/CMakeLists.txt @@ -5,7 +5,7 @@ SET(${PACKAGE_NAME}_SKIP_INSTALL FALSE CACHE BOOL ADD_DEFINITIONS(-DGTEST_HAS_PTHREAD=0) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/gtest/gtest.h diff --git a/packages/adelus/example/CMakeLists.txt b/packages/adelus/example/CMakeLists.txt index 3fdcc9bfa670..de56f780fc00 100644 --- a/packages/adelus/example/CMakeLists.txt +++ b/packages/adelus/example/CMakeLists.txt @@ -54,7 +54,7 @@ PROJECT(my_Adelus_driver C CXX) ADD_DEFINITIONS(-DKKVIEW_API) -INCLUDE_DIRECTORIES(${Trilinos_INCLUDE_DIRS} ${Trilinos_TPL_INCLUDE_DIRS}) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_INCLUDE_DIRS} ${Trilinos_TPL_INCLUDE_DIRS}) LINK_DIRECTORIES(${Trilinos_LIBRARY_DIRS} ${Trilinos_TPL_LIBRARY_DIRS}) ADD_EXECUTABLE(adelus_driver adelus_driver.cpp) diff --git a/packages/adelus/src/CMakeLists.txt b/packages/adelus/src/CMakeLists.txt index 81717dd70d3b..3228959e7b45 100644 --- a/packages/adelus/src/CMakeLists.txt +++ b/packages/adelus/src/CMakeLists.txt @@ -21,13 +21,13 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # # Core files diff --git a/packages/amesos/src/CMakeLists.txt b/packages/amesos/src/CMakeLists.txt index ac5445e53316..74fe29686dfb 100644 --- a/packages/amesos/src/CMakeLists.txt +++ b/packages/amesos/src/CMakeLists.txt @@ -20,7 +20,7 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h @@ -30,7 +30,7 @@ SET(HEADERS ${HEADERS} # support files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(SOURCES ${SOURCES} Amesos_Status.cpp diff --git a/packages/amesos2/src/CMakeLists.txt b/packages/amesos2/src/CMakeLists.txt index 0504cf45a19a..49725393f27a 100644 --- a/packages/amesos2/src/CMakeLists.txt +++ b/packages/amesos2/src/CMakeLists.txt @@ -60,7 +60,7 @@ SET(SOURCES "") ASSERT_DEFINED(PROJECT_SOURCE_DIR) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}) # If we use Trilinos_version then "make install" will fail. #APPEND_SET(HEADERS @@ -69,7 +69,7 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}) # Set headers (for IDEs and installing) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) APPEND_SET(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h @@ -78,14 +78,14 @@ APPEND_SET(HEADERS # NOTE: Above, we add the XXX_config.h file so that MS Visual Studio # will know to include this file in the dependency analysis -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -#INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/basker) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/KLU2/Include) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/KLU2/Source) -INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/AMD/Include) -INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/COLAMD/Include) -INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/BTF/Include) -INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/UFconfig) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +#TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/basker) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/KLU2/Include) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/KLU2/Source) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/AMD/Include) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/COLAMD/Include) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/BTF/Include) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/UFconfig) APPEND_SET(HEADERS Amesos2.hpp @@ -258,7 +258,7 @@ IF (${PACKAGE_NAME}_ENABLE_Basker) Amesos2_Basker.cpp ) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/basker) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/basker) APPEND_SET(HEADERS basker/basker.hpp basker/basker_decl.hpp diff --git a/packages/amesos2/src/KLU2/Source/CMakeLists.txt b/packages/amesos2/src/KLU2/Source/CMakeLists.txt index bb834a60373e..cd0c09eddeac 100644 --- a/packages/amesos2/src/KLU2/Source/CMakeLists.txt +++ b/packages/amesos2/src/KLU2/Source/CMakeLists.txt @@ -61,11 +61,11 @@ SET(SOURCES "") ASSERT_DEFINED(PROJECT_SOURCE_DIR) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}) # Set headers (for IDEs and installing) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) APPEND_SET(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h @@ -74,12 +74,12 @@ APPEND_SET(HEADERS # NOTE: Above, we add the XXX_config.h file so that MS Visual Studio # will know to include this file in the dependency analysis -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../Include) -INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/AMD/Include) -INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/COLAMD/Include) -INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/BTF/Include) -INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/UFconfig) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../Include) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/AMD/Include) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/COLAMD/Include) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/BTF/Include) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/UFconfig) APPEND_SET(HEADERS klu2_analyze_given.hpp diff --git a/packages/anasazi/epetra/src-rbgen/CMakeLists.txt b/packages/anasazi/epetra/src-rbgen/CMakeLists.txt index e656ed7342d6..7e81360f6fb9 100644 --- a/packages/anasazi/epetra/src-rbgen/CMakeLists.txt +++ b/packages/anasazi/epetra/src-rbgen/CMakeLists.txt @@ -12,8 +12,8 @@ SET(HEADERS "") SET(NOINSTALLHEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../src-rbgen) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../src-rbgen) # Abstract headers APPEND_SET(HEADERS diff --git a/packages/anasazi/epetra/src/CMakeLists.txt b/packages/anasazi/epetra/src/CMakeLists.txt index 31808b60d7cc..ccfdd298d0a8 100644 --- a/packages/anasazi/epetra/src/CMakeLists.txt +++ b/packages/anasazi/epetra/src/CMakeLists.txt @@ -19,7 +19,7 @@ CONFIGURE_FILE("${Trilinos_SOURCE_DIR}/packages/Trilinos_DLLExportMacro.h.in" SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) APPEND_SET(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}epetra_DLLExportMacro.h @@ -29,7 +29,7 @@ APPEND_SET(HEADERS # Core Files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS AnasaziEpetraAdapter.hpp diff --git a/packages/anasazi/epetra/util/ModeLaplace/CMakeLists.txt b/packages/anasazi/epetra/util/ModeLaplace/CMakeLists.txt index 4f8634ddb410..0677098dd017 100644 --- a/packages/anasazi/epetra/util/ModeLaplace/CMakeLists.txt +++ b/packages/anasazi/epetra/util/ModeLaplace/CMakeLists.txt @@ -19,7 +19,7 @@ CONFIGURE_FILE("${Trilinos_SOURCE_DIR}/packages/Trilinos_DLLExportMacro.h.in" SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) APPEND_SET(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}epetra_ModeLaplace_DLLExportMacro.h ) @@ -28,7 +28,7 @@ APPEND_SET(HEADERS # Core Files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS BlockPCGSolver.h diff --git a/packages/anasazi/src-rbgen/CMakeLists.txt b/packages/anasazi/src-rbgen/CMakeLists.txt index d27665c2de73..b7aa155894f1 100644 --- a/packages/anasazi/src-rbgen/CMakeLists.txt +++ b/packages/anasazi/src-rbgen/CMakeLists.txt @@ -12,7 +12,7 @@ SET(HEADERS "") SET(NOINSTALLHEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # Abstract headers APPEND_SET(HEADERS diff --git a/packages/anasazi/src/CMakeLists.txt b/packages/anasazi/src/CMakeLists.txt index 2442699c34d5..d882ecc53cec 100644 --- a/packages/anasazi/src/CMakeLists.txt +++ b/packages/anasazi/src/CMakeLists.txt @@ -36,7 +36,7 @@ CONFIGURE_FILE("${Trilinos_SOURCE_DIR}/packages/Trilinos_DLLExportMacro.h.in" SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h @@ -47,7 +47,7 @@ SET(HEADERS ${HEADERS} # Core Files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS AnasaziBasicEigenproblem.hpp @@ -149,7 +149,7 @@ APPEND_SET(HEADERS ASSERT_DEFINED(Anasazi_ENABLE_ThyraCore) IF (Anasazi_ENABLE_ThyraCore) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../thyra/src) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../thyra/src) APPEND_SET(HEADERS ../thyra/src/AnasaziThyraAdapter.hpp ../thyra/src/AnasaziThyraDebugAdapter.hpp @@ -158,7 +158,7 @@ ENDIF() ASSERT_DEFINED(Anasazi_ENABLE_Tpetra) IF (Anasazi_ENABLE_Tpetra) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../tpetra/src) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../tpetra/src) # The AnasaziTpetraAdapter headers are already pulled in by # <./packages/anasazi/tpetra/src/CMakeLists.txt>. ENDIF() diff --git a/packages/anasazi/test/CMakeLists.txt b/packages/anasazi/test/CMakeLists.txt index 2c9310b768e6..51adf9fd4f96 100644 --- a/packages/anasazi/test/CMakeLists.txt +++ b/packages/anasazi/test/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/MVOPTester) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/MVOPTester) ADD_SUBDIRECTORY(MVOPTester) ADD_SUBDIRECTORY(OrthoManager) diff --git a/packages/anasazi/test/OrthoManager/CMakeLists.txt b/packages/anasazi/test/OrthoManager/CMakeLists.txt index 06826bd9a689..99da387d570e 100644 --- a/packages/anasazi/test/OrthoManager/CMakeLists.txt +++ b/packages/anasazi/test/OrthoManager/CMakeLists.txt @@ -6,7 +6,7 @@ IF (${PACKAGE_NAME}_ENABLE_Triutils) # FIXME (mfh 04 Aug 2010) IF ({${PACKAGE_NAME}_ENABLE_COMPLEX) - INCLUDE_DIRECTORIES(../MVOPTester) + TRIBITS_INCLUDE_DIRECTORIES(../MVOPTester) TRIBITS_ADD_EXECUTABLE_AND_TEST( OrthoManagerComplexTester diff --git a/packages/anasazi/thyra/src/CMakeLists.txt b/packages/anasazi/thyra/src/CMakeLists.txt index 2f59e80fa9e4..796154d065d6 100644 --- a/packages/anasazi/thyra/src/CMakeLists.txt +++ b/packages/anasazi/thyra/src/CMakeLists.txt @@ -17,7 +17,7 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h @@ -27,7 +27,7 @@ SET(HEADERS ${HEADERS} # Core Files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS AnasaziBasicEigenproblem.hpp diff --git a/packages/anasazi/tpetra/src/CMakeLists.txt b/packages/anasazi/tpetra/src/CMakeLists.txt index 37be72368a39..6660448f0b39 100644 --- a/packages/anasazi/tpetra/src/CMakeLists.txt +++ b/packages/anasazi/tpetra/src/CMakeLists.txt @@ -15,13 +15,13 @@ SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) # # Core Files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS AnasaziTpetraAdapter.hpp diff --git a/packages/aztecoo/src/CMakeLists.txt b/packages/aztecoo/src/CMakeLists.txt index 4e9738592059..b27c6f58a3b4 100644 --- a/packages/aztecoo/src/CMakeLists.txt +++ b/packages/aztecoo/src/CMakeLists.txt @@ -27,13 +27,13 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # # C files diff --git a/packages/belos/doc/parameterList/CMakeLists.txt b/packages/belos/doc/parameterList/CMakeLists.txt index b307d66ad464..b5d958c7f771 100644 --- a/packages/belos/doc/parameterList/CMakeLists.txt +++ b/packages/belos/doc/parameterList/CMakeLists.txt @@ -2,7 +2,7 @@ IF (${PACKAGE_NAME}_ENABLE_Tpetra) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../../tpetra/src ) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../../tpetra/src ) # Create the ValidParameters executable TRIBITS_ADD_EXECUTABLE( diff --git a/packages/belos/epetra/src/CMakeLists.txt b/packages/belos/epetra/src/CMakeLists.txt index 1f9c2c6a29d4..0f658527713c 100644 --- a/packages/belos/epetra/src/CMakeLists.txt +++ b/packages/belos/epetra/src/CMakeLists.txt @@ -15,13 +15,13 @@ SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) # # Core Files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS BelosEpetraAdapter.hpp diff --git a/packages/belos/kokkos/example/CMakeLists.txt b/packages/belos/kokkos/example/CMakeLists.txt index b493959ea9af..2539e714db0c 100644 --- a/packages/belos/kokkos/example/CMakeLists.txt +++ b/packages/belos/kokkos/example/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${Belos_SOURCE_DIR}/kokkos/src) +TRIBITS_INCLUDE_DIRECTORIES(${Belos_SOURCE_DIR}/kokkos/src) TRIBITS_ADD_EXECUTABLE_AND_TEST( Kokkos_BlockGmresEx diff --git a/packages/belos/kokkos/src/CMakeLists.txt b/packages/belos/kokkos/src/CMakeLists.txt index 4d8c6851c1f1..3308e7f45a4d 100644 --- a/packages/belos/kokkos/src/CMakeLists.txt +++ b/packages/belos/kokkos/src/CMakeLists.txt @@ -15,13 +15,13 @@ SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) # # Core Files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS BelosKokkosAdapter.hpp diff --git a/packages/belos/kokkos/test/CMakeLists.txt b/packages/belos/kokkos/test/CMakeLists.txt index 2a37af1bd697..68b112e0894f 100644 --- a/packages/belos/kokkos/test/CMakeLists.txt +++ b/packages/belos/kokkos/test/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${Belos_SOURCE_DIR}/kokkos/src) +TRIBITS_INCLUDE_DIRECTORIES(${Belos_SOURCE_DIR}/kokkos/src) TRIBITS_ADD_EXECUTABLE_AND_TEST( KokkosMVOPTest diff --git a/packages/belos/src/CMakeLists.txt b/packages/belos/src/CMakeLists.txt index 664dc48f770f..36df2b008ce6 100644 --- a/packages/belos/src/CMakeLists.txt +++ b/packages/belos/src/CMakeLists.txt @@ -13,13 +13,13 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # CORE APPEND_SET(HEADERS diff --git a/packages/belos/test/GCRODR/CMakeLists.txt b/packages/belos/test/GCRODR/CMakeLists.txt index db62c961fb79..fe9e1488a034 100644 --- a/packages/belos/test/GCRODR/CMakeLists.txt +++ b/packages/belos/test/GCRODR/CMakeLists.txt @@ -1,6 +1,6 @@ -INCLUDE_DIRECTORIES(REQUIRED_DURING_INSTALLATION_TESTING ${CMAKE_CURRENT_SOURCE_DIR}/../MVOPTester) +TRIBITS_INCLUDE_DIRECTORIES(REQUIRED_DURING_INSTALLATION_TESTING ${CMAKE_CURRENT_SOURCE_DIR}/../MVOPTester) ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_Triutils) IF (${PACKAGE_NAME}_ENABLE_Triutils) @@ -8,7 +8,7 @@ IF (${PACKAGE_NAME}_ENABLE_Triutils) ASSERT_DEFINED(Teuchos_ENABLE_COMPLEX) IF(Teuchos_ENABLE_COMPLEX) - INCLUDE_DIRECTORIES(../MVOPTester) + TRIBITS_INCLUDE_DIRECTORIES(../MVOPTester) TRIBITS_ADD_EXECUTABLE_AND_TEST( gcrodr_complex_hb diff --git a/packages/belos/tpetra/src/CMakeLists.txt b/packages/belos/tpetra/src/CMakeLists.txt index e0062875cc05..0abb87db2e00 100644 --- a/packages/belos/tpetra/src/CMakeLists.txt +++ b/packages/belos/tpetra/src/CMakeLists.txt @@ -15,13 +15,13 @@ SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) # # Core Files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS BelosMultiVecTraits_Tpetra.hpp diff --git a/packages/belos/xpetra/src/CMakeLists.txt b/packages/belos/xpetra/src/CMakeLists.txt index 65897f3b1a0d..b72027256ee8 100644 --- a/packages/belos/xpetra/src/CMakeLists.txt +++ b/packages/belos/xpetra/src/CMakeLists.txt @@ -15,13 +15,13 @@ SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) # # Core Files # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) APPEND_SET(HEADERS BelosXpetraAdapter.hpp diff --git a/packages/common/auxiliarySoftware/SuiteSparse/src/CMakeLists.txt b/packages/common/auxiliarySoftware/SuiteSparse/src/CMakeLists.txt index 76cdf26bc963..a358b6f5e84a 100644 --- a/packages/common/auxiliarySoftware/SuiteSparse/src/CMakeLists.txt +++ b/packages/common/auxiliarySoftware/SuiteSparse/src/CMakeLists.txt @@ -21,14 +21,14 @@ SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/AMD/Include) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/BTF/Include) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/CAMD/Include) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/CCOLAMD/Include) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/COLAMD/Include) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/KLU/Include) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/UFconfig) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/AMD/Include) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/BTF/Include) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/CAMD/Include) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/CCOLAMD/Include) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/COLAMD/Include) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/KLU/Include) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/UFconfig) file(GLOB AMD_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/AMD/Include/*.h) file(GLOB BTF_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/BTF/Include/*.h) diff --git a/packages/compadre/examples/CMakeLists.tribits.cmake b/packages/compadre/examples/CMakeLists.tribits.cmake index a6ee5a92d0ef..523f31cae25d 100644 --- a/packages/compadre/examples/CMakeLists.tribits.cmake +++ b/packages/compadre/examples/CMakeLists.tribits.cmake @@ -1,4 +1,4 @@ -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) #tribits_add_executable( # UnitTests diff --git a/packages/compadre/src/CMakeLists.tribits.cmake b/packages/compadre/src/CMakeLists.tribits.cmake index c714908c844c..8a7511905816 100644 --- a/packages/compadre/src/CMakeLists.tribits.cmake +++ b/packages/compadre/src/CMakeLists.tribits.cmake @@ -11,13 +11,13 @@ bob_config_header(${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_Config.h ${PACKAGE set(HEADERS "") set(SOURCES "") -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +tribits_include_directories(${CMAKE_CURRENT_BINARY_DIR}) set(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_Config.h ) -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +tribits_include_directories(${CMAKE_CURRENT_SOURCE_DIR}) append_glob(HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) list(REMOVE_ITEM HEADERS diff --git a/packages/domi/doc/parameterList/CMakeLists.txt b/packages/domi/doc/parameterList/CMakeLists.txt index eb835efbac0a..6a5d03b56fde 100644 --- a/packages/domi/doc/parameterList/CMakeLists.txt +++ b/packages/domi/doc/parameterList/CMakeLists.txt @@ -42,7 +42,7 @@ # *********************************************************************** # @HEADER -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # Create the ValidParameters executable TRIBITS_ADD_EXECUTABLE( diff --git a/packages/domi/src/CMakeLists.txt b/packages/domi/src/CMakeLists.txt index 31e31e2a08d3..91776dfcb0e2 100644 --- a/packages/domi/src/CMakeLists.txt +++ b/packages/domi/src/CMakeLists.txt @@ -73,8 +73,8 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) # # Set the include directories -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # # Define the header and source files (and directories) diff --git a/packages/domi/test/MDArray/CMakeLists.txt b/packages/domi/test/MDArray/CMakeLists.txt index cb78a965ddcf..7874d2c5e660 100644 --- a/packages/domi/test/MDArray/CMakeLists.txt +++ b/packages/domi/test/MDArray/CMakeLists.txt @@ -44,7 +44,7 @@ #INCLUDE(TribitsCopyFilesToBinaryDir) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # Unit test the Slice class TRIBITS_ADD_EXECUTABLE_AND_TEST( diff --git a/packages/domi/test/MDComm/CMakeLists.txt b/packages/domi/test/MDComm/CMakeLists.txt index 721542809a95..c2aa3f3f66ba 100644 --- a/packages/domi/test/MDComm/CMakeLists.txt +++ b/packages/domi/test/MDComm/CMakeLists.txt @@ -44,7 +44,7 @@ #INCLUDE(TribitsCopyFilesToBinaryDir) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # Create the MDComm unit test executable TRIBITS_ADD_EXECUTABLE( diff --git a/packages/domi/test/MDMap/CMakeLists.txt b/packages/domi/test/MDMap/CMakeLists.txt index f464419e7dcb..a18f050171c9 100644 --- a/packages/domi/test/MDMap/CMakeLists.txt +++ b/packages/domi/test/MDMap/CMakeLists.txt @@ -44,7 +44,7 @@ #INCLUDE(TribitsCopyFilesToBinaryDir) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # Create the MDMap unit test executable TRIBITS_ADD_EXECUTABLE( diff --git a/packages/domi/test/MDVector/CMakeLists.txt b/packages/domi/test/MDVector/CMakeLists.txt index d497e29ea175..dfec34d53a32 100644 --- a/packages/domi/test/MDVector/CMakeLists.txt +++ b/packages/domi/test/MDVector/CMakeLists.txt @@ -44,7 +44,7 @@ #INCLUDE(TribitsCopyFilesToBinaryDir) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # Create the MDVector unit test executable TRIBITS_ADD_EXECUTABLE( diff --git a/packages/epetra/CMakeLists.txt b/packages/epetra/CMakeLists.txt index 91727f9c3167..72e200ce0acf 100644 --- a/packages/epetra/CMakeLists.txt +++ b/packages/epetra/CMakeLists.txt @@ -70,7 +70,7 @@ IF(TPL_ENABLE_MKL) OFF ) IF(Epetra_ENABLE_MKL_SPARSE) - INCLUDE_DIRECTORIES(${TPL_MKL_INCLUDE_DIRS}) + TRIBITS_INCLUDE_DIRECTORIES(${TPL_MKL_INCLUDE_DIRS}) TRIBITS_ADD_OPTION_AND_DEFINE(${PACKAGE_NAME}_DISABLE_MKL_SPARSE_MM Epetra_DISABLE_MKL_SPARSE_MM diff --git a/packages/epetra/src/CMakeLists.txt b/packages/epetra/src/CMakeLists.txt index 508dd7e27ff9..427a313a2901 100644 --- a/packages/epetra/src/CMakeLists.txt +++ b/packages/epetra/src/CMakeLists.txt @@ -26,7 +26,7 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) # Set the base Trilinos directory in order to find Trilinos_version.h ASSERT_DEFINED(PROJECT_SOURCE_DIR) -INCLUDE_DIRECTORIES(${Trilinos_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${Trilinos_BINARY_DIR}) SET(CURRENT_PACKAGE EPETRA) CONFIGURE_FILE("${Trilinos_SOURCE_DIR}/packages/Trilinos_DLLExportMacro.h.in" @@ -39,14 +39,14 @@ CONFIGURE_FILE("${Trilinos_SOURCE_DIR}/packages/Trilinos_DLLExportMacro.h.in" SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_DLLExportMacro.h ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(HEADERS ${HEADERS} Epetra_BLAS.h diff --git a/packages/epetraext/src/CMakeLists.txt b/packages/epetraext/src/CMakeLists.txt index 0e0b05695f51..f74358217703 100644 --- a/packages/epetraext/src/CMakeLists.txt +++ b/packages/epetraext/src/CMakeLists.txt @@ -20,12 +20,12 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(HEADERS ${HEADERS} EpetraExt_ConfigDefs.h @@ -50,7 +50,7 @@ SET(SOURCES ${SOURCES} IF (${PACKAGE_NAME}_BUILD_TRANSFORM) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/transform) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/transform) SET(HEADERS ${HEADERS} transform/EpetraExt_SubCopy_CrsMatrix.h @@ -121,7 +121,7 @@ ENDIF() IF (${PACKAGE_NAME}_BUILD_BTF) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/btf) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/btf) SET(HEADERS ${HEADERS} btf/EpetraExt_BTF_CrsGraph.h @@ -157,7 +157,7 @@ ENDIF() IF (${PACKAGE_NAME}_BUILD_INOUT) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/inout) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/inout) SET(HEADERS ${HEADERS} inout/EpetraExt_mmio.h @@ -217,7 +217,7 @@ ENDIF() IF (${PACKAGE_NAME}_BUILD_COLORING) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/coloring) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/coloring) SET(HEADERS ${HEADERS} coloring/EpetraExt_MapColoring.h @@ -238,7 +238,7 @@ ENDIF() IF (${PACKAGE_NAME}_BUILD_MATLAB) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/matlab) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/matlab) SET(HEADERS ${HEADERS} matlab/EpetraExt_MatlabEngine.h @@ -262,7 +262,7 @@ ENDIF() IF (${PACKAGE_NAME}_BUILD_MODEL_EVALUATOR) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/model_evaluator) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/model_evaluator) SET(HEADERS ${HEADERS} model_evaluator/EpetraExt_ModelEvaluator.h @@ -283,7 +283,7 @@ ENDIF() IF (${PACKAGE_NAME}_BUILD_BLOCK) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/block) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/block) SET(HEADERS ${HEADERS} block/EpetraExt_BlockCrsMatrix.h @@ -328,7 +328,7 @@ ENDIF() IF (${PACKAGE_NAME}_BUILD_RESTRICT) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/restrict) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/restrict) SET(HEADERS ${HEADERS} restrict/EpetraExt_RestrictedMultiVectorWrapper.h @@ -348,7 +348,7 @@ ENDIF() IF (${PACKAGE_NAME}_USING_PETSC) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/petsc) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/petsc) SET(HEADERS ${HEADERS} petsc/EpetraExt_PETScAIJMatrix.h @@ -366,7 +366,7 @@ ENDIF() ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_HYPRE) IF (${PACKAGE_NAME}_ENABLE_HYPRE) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/hypre) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/hypre) SET(HEADERS ${HEADERS} hypre/EpetraExt_HypreIJMatrix.h @@ -386,7 +386,7 @@ IF (${PROJECT_NAME}_ENABLE_PyTrilinos) FIND_PACKAGE(PythonInclude REQUIRED) - INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) + TRIBITS_INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) ENDIF() diff --git a/packages/epetraext/test/CMakeLists.txt b/packages/epetraext/test/CMakeLists.txt index ec4c87c1dde7..d1793b2f99cb 100644 --- a/packages/epetraext/test/CMakeLists.txt +++ b/packages/epetraext/test/CMakeLists.txt @@ -1,7 +1,7 @@ # Compile against epetra_test_err.h in all tests? -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) IF (${PACKAGE_NAME}_BUILD_TRANSFORM) diff --git a/packages/fei/base/CMakeLists.txt b/packages/fei/base/CMakeLists.txt index abd14e3820ec..01e9f222e515 100644 --- a/packages/fei/base/CMakeLists.txt +++ b/packages/fei/base/CMakeLists.txt @@ -17,14 +17,14 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../) # # Core headers # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) FILE(GLOB HEADERS *.hpp *.h) diff --git a/packages/fei/support-Trilinos/CMakeLists.txt b/packages/fei/support-Trilinos/CMakeLists.txt index 381c2bc56fd6..30bcd746a3a8 100644 --- a/packages/fei/support-Trilinos/CMakeLists.txt +++ b/packages/fei/support-Trilinos/CMakeLists.txt @@ -17,8 +17,8 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h @@ -28,7 +28,7 @@ SET(HEADERS ${HEADERS} # Core headers # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) FILE(GLOB HEADERS *.hpp) FILE(GLOB SOURCES *.cpp) diff --git a/packages/fei/unit_tests/CMakeLists.txt b/packages/fei/unit_tests/CMakeLists.txt index a35d476c0a2e..c76c624b2c01 100644 --- a/packages/fei/unit_tests/CMakeLists.txt +++ b/packages/fei/unit_tests/CMakeLists.txt @@ -1,10 +1,10 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../base) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../support-Trilinos) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../base) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../support-Trilinos) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/) TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) diff --git a/packages/galeri/src-epetra/CMakeLists.txt b/packages/galeri/src-epetra/CMakeLists.txt index c6edd3204c2d..9237c6a51677 100644 --- a/packages/galeri/src-epetra/CMakeLists.txt +++ b/packages/galeri/src-epetra/CMakeLists.txt @@ -20,8 +20,8 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../headers) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../headers) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h @@ -31,7 +31,7 @@ SET(HEADERS ${HEADERS} # src # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(HEADERS ${HEADERS} ../headers/Galeri_ConfigDefs.h @@ -64,7 +64,7 @@ ENDIF() # src/Maps # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Maps) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Maps) SET(HEADERS ${HEADERS} Maps/Galeri_Linear.h @@ -79,7 +79,7 @@ SET(HEADERS ${HEADERS} # src/CrsMatrices # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/CRSMatrices) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/CRSMatrices) SET(HEADERS ${HEADERS} CrsMatrices/Galeri_BigCross2D.h @@ -113,7 +113,7 @@ SET(HEADERS ${HEADERS} # src/FiniteElements # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/FiniteElements) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/FiniteElements) SET(HEADERS ${HEADERS} FiniteElements/Galeri_AbstractGrid.h diff --git a/packages/galeri/src-xpetra/CMakeLists.txt b/packages/galeri/src-xpetra/CMakeLists.txt index 45ad6c367fe1..e407ea8ec3be 100644 --- a/packages/galeri/src-xpetra/CMakeLists.txt +++ b/packages/galeri/src-xpetra/CMakeLists.txt @@ -3,11 +3,11 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../src-epetra) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../src-epetra) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../headers) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../src-epetra) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../src-epetra) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../headers) APPEND_SET(HEADERS diff --git a/packages/ifpack/src/CMakeLists.txt b/packages/ifpack/src/CMakeLists.txt index 8d2f708abfec..0d0f320f675b 100644 --- a/packages/ifpack/src/CMakeLists.txt +++ b/packages/ifpack/src/CMakeLists.txt @@ -37,13 +37,13 @@ ENDIF () SET(HEADERS) SET(SOURCES) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(HEADERS ${HEADERS} Ifpack_ConfigDefs.h @@ -187,7 +187,7 @@ ENDIF() IF (${PACKAGE_NAME}_ENABLE_Amesos) - INCLUDE_DIRECTORIES( + TRIBITS_INCLUDE_DIRECTORIES( ${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/AMD/Include ${Trilinos_SOURCE_DIR}/packages/common/auxiliarySoftware/SuiteSparse/src/UFconfig ) @@ -205,7 +205,7 @@ IF (${PACKAGE_NAME}_ENABLE_Amesos) ENDIF() IF (${PACKAGE_NAME}_ENABLE_Euclid) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/euclid) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/euclid) SET(HEADERS ${HEADERS} euclid/Euclid_dh.h @@ -275,7 +275,7 @@ IF (${PACKAGE_NAME}_ENABLE_Euclid) ENDIF() IF (${PACKAGE_NAME}_ENABLE_SUPPORTGRAPH) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/supportgraph) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/supportgraph) SET (HEADERS ${HEADERS} supportgraph/Ifpack_SupportGraph.h @@ -296,7 +296,7 @@ APPEND_SET(${PACKAGE_NAME}_EXPERIMENTAL_SOURCES ASSERT_DEFINED(${PACKAGE_NAME}_ENABLE_Experimental) IF(${PACKAGE_NAME}_ENABLE_Experimental) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/supportgraph) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/supportgraph) # # Add experimental files to HEADERS and SOURCES. # diff --git a/packages/ifpack/test/AztecOO/CMakeLists.txt b/packages/ifpack/test/AztecOO/CMakeLists.txt index c147906de95c..746c9ee6d08c 100644 --- a/packages/ifpack/test/AztecOO/CMakeLists.txt +++ b/packages/ifpack/test/AztecOO/CMakeLists.txt @@ -1,8 +1,8 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/) TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) diff --git a/packages/ifpack/test/AztecOO_LL/CMakeLists.txt b/packages/ifpack/test/AztecOO_LL/CMakeLists.txt index cfb437736aac..f3f3042905c2 100644 --- a/packages/ifpack/test/AztecOO_LL/CMakeLists.txt +++ b/packages/ifpack/test/AztecOO_LL/CMakeLists.txt @@ -1,8 +1,8 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/) TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) diff --git a/packages/ifpack2/adapters/CMakeLists.txt b/packages/ifpack2/adapters/CMakeLists.txt index 8429b54fed38..1b85a39b3aaf 100644 --- a/packages/ifpack2/adapters/CMakeLists.txt +++ b/packages/ifpack2/adapters/CMakeLists.txt @@ -8,14 +8,14 @@ SET(HEADERS "") SET(SOURCES "") IF(${PACKAGE_NAME}_ENABLE_ThyraTpetraAdapters) - SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}/thyra) + TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}/thyra) APPEND_GLOB(HEADERS ${DIR}/*.hpp) APPEND_GLOB(SOURCES ${DIR}/*.cpp) TRILINOS_CREATE_CLIENT_TEMPLATE_HEADERS(${DIR}) ENDIF(${PACKAGE_NAME}_ENABLE_ThyraTpetraAdapters) # Must glob the binary dir last to get all of the auto-generated headers -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_BINARY_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.hpp) # diff --git a/packages/ifpack2/example/CMakeLists.txt b/packages/ifpack2/example/CMakeLists.txt index 803792c8dbea..5573b6591c92 100644 --- a/packages/ifpack2/example/CMakeLists.txt +++ b/packages/ifpack2/example/CMakeLists.txt @@ -1,5 +1,5 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) TRIBITS_ADD_EXECUTABLE( ex1 diff --git a/packages/ifpack2/src/CMakeLists.txt b/packages/ifpack2/src/CMakeLists.txt index d16b67b28e6c..5e39aa9e18a6 100644 --- a/packages/ifpack2/src/CMakeLists.txt +++ b/packages/ifpack2/src/CMakeLists.txt @@ -188,7 +188,7 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS "") SET(SOURCES "") -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.hpp) APPEND_GLOB(SOURCES ${DIR}/*.cpp) TRILINOS_CREATE_CLIENT_TEMPLATE_HEADERS(${DIR}) @@ -196,7 +196,7 @@ TRILINOS_CREATE_CLIENT_TEMPLATE_HEADERS(${DIR}) # SupportGraph requires some TPLs and options to be enabled. IF (${PACKAGE_NAME}_ENABLE_Experimental AND ${PACKAGE_NAME}_ENABLE_Lemon AND ${PACKAGE_NAME}_ENABLE_Amesos2 AND ${PACKAGE_NAME}_ENABLE_Cholmod) TRILINOS_CREATE_CLIENT_TEMPLATE_HEADERS(${DIR}/supportgraph) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/supportgraph) + TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/supportgraph) SET(HEADERS ${HEADERS} supportgraph/Ifpack2_SupportGraph_decl.hpp supportgraph/Ifpack2_SupportGraph_def.hpp @@ -207,7 +207,7 @@ IF (${PACKAGE_NAME}_ENABLE_Experimental AND ${PACKAGE_NAME}_ENABLE_Lemon AND ${P ENDIF() # Must glob the binary dir last to get all of the auto-generated headers -SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_BINARY_DIR}) APPEND_GLOB(HEADERS ${DIR}/*.hpp) APPEND_SET(HEADERS ${DIR}/${PACKAGE_NAME}_config.h ) APPEND_SET(HEADERS ${DIR}/${PACKAGE_NAME}_ETIHelperMacros.h ) diff --git a/packages/ifpack2/test/belos/AdditiveSchwarzRILUK/CMakeLists.txt b/packages/ifpack2/test/belos/AdditiveSchwarzRILUK/CMakeLists.txt index 0fc6e497d3e8..29e2017d892c 100644 --- a/packages/ifpack2/test/belos/AdditiveSchwarzRILUK/CMakeLists.txt +++ b/packages/ifpack2/test/belos/AdditiveSchwarzRILUK/CMakeLists.txt @@ -1,6 +1,6 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) TRIBITS_ADD_EXECUTABLE_AND_TEST( AdditiveSchwarz_RILUK diff --git a/packages/ifpack2/test/belos/CMakeLists.txt b/packages/ifpack2/test/belos/CMakeLists.txt index 7117233c6a38..04a482a25812 100644 --- a/packages/ifpack2/test/belos/CMakeLists.txt +++ b/packages/ifpack2/test/belos/CMakeLists.txt @@ -1,6 +1,6 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) ADD_SUBDIRECTORY(AdditiveSchwarzRILUK) diff --git a/packages/ifpack2/test/vanka/CMakeLists.txt b/packages/ifpack2/test/vanka/CMakeLists.txt index ec5a59f299de..542cd4ae6a84 100644 --- a/packages/ifpack2/test/vanka/CMakeLists.txt +++ b/packages/ifpack2/test/vanka/CMakeLists.txt @@ -1,6 +1,6 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../src) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../../src) TRIBITS_ADD_EXECUTABLE_AND_TEST( TomVankaTest diff --git a/packages/intrepid/src/CMakeLists.txt b/packages/intrepid/src/CMakeLists.txt index 296bf127a750..c1958b25c4f4 100644 --- a/packages/intrepid/src/CMakeLists.txt +++ b/packages/intrepid/src/CMakeLists.txt @@ -17,13 +17,13 @@ TRIBITS_CONFIGURE_FILE(Intrepid_config.h) SET(HEADERS "") SET(SOURCES "") -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) APPEND_SET(HEADERS ${CMAKE_CURRENT_BINARY_DIR}/Intrepid_config.h ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # # All headers @@ -37,7 +37,7 @@ APPEND_SET(HEADERS # Shared headers # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Shared) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Shared) APPEND_SET(HEADERS Shared/Intrepid_ArrayToolsDefCloneScale.hpp Shared/Intrepid_ArrayToolsDefContractions.hpp @@ -67,10 +67,10 @@ APPEND_SET(HEADERS # Discretization headers # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Discretization/Integration) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Discretization/FunctionSpaceTools) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Discretization/Basis) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Discretization/TensorProductSpaceTools) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Discretization/Integration) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Discretization/FunctionSpaceTools) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Discretization/Basis) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Discretization/TensorProductSpaceTools) APPEND_SET(HEADERS Discretization/Integration/Intrepid_AdaptiveSparseGridInterfaceDef.hpp @@ -220,7 +220,7 @@ APPEND_SET(HEADERS # Cell headers # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Cell) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Cell) APPEND_SET(HEADERS Cell/Intrepid_CellTools.hpp Cell/Intrepid_CellToolsDef.hpp diff --git a/packages/intrepid2/perf-test/CMakeLists.txt b/packages/intrepid2/perf-test/CMakeLists.txt index 4c90c57ef130..1fc39aecf0d9 100644 --- a/packages/intrepid2/perf-test/CMakeLists.txt +++ b/packages/intrepid2/perf-test/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) ADD_SUBDIRECTORY(ComputeBasis) ADD_SUBDIRECTORY(DynRankView) diff --git a/packages/intrepid2/perf-test/ComputeBasis/CMakeLists.txt b/packages/intrepid2/perf-test/ComputeBasis/CMakeLists.txt index 5ddadcc0cd50..9658e1232597 100644 --- a/packages/intrepid2/perf-test/ComputeBasis/CMakeLists.txt +++ b/packages/intrepid2/perf-test/ComputeBasis/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) IF(Kokkos_ENABLE_SERIAL) ADD_SUBDIRECTORY(Serial) diff --git a/packages/intrepid2/perf-test/ComputeBasis/Cuda/CMakeLists.txt b/packages/intrepid2/perf-test/ComputeBasis/Cuda/CMakeLists.txt index 3efdb02678fa..cc34271a198c 100644 --- a/packages/intrepid2/perf-test/ComputeBasis/Cuda/CMakeLists.txt +++ b/packages/intrepid2/perf-test/ComputeBasis/Cuda/CMakeLists.txt @@ -1,5 +1,5 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(SOURCES "") diff --git a/packages/intrepid2/perf-test/ComputeBasis/OpenMP/CMakeLists.txt b/packages/intrepid2/perf-test/ComputeBasis/OpenMP/CMakeLists.txt index 3efdb02678fa..cc34271a198c 100644 --- a/packages/intrepid2/perf-test/ComputeBasis/OpenMP/CMakeLists.txt +++ b/packages/intrepid2/perf-test/ComputeBasis/OpenMP/CMakeLists.txt @@ -1,5 +1,5 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(SOURCES "") diff --git a/packages/intrepid2/perf-test/ComputeBasis/Serial/CMakeLists.txt b/packages/intrepid2/perf-test/ComputeBasis/Serial/CMakeLists.txt index 3efdb02678fa..cc34271a198c 100644 --- a/packages/intrepid2/perf-test/ComputeBasis/Serial/CMakeLists.txt +++ b/packages/intrepid2/perf-test/ComputeBasis/Serial/CMakeLists.txt @@ -1,5 +1,5 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(SOURCES "") diff --git a/packages/intrepid2/perf-test/DynRankView/CMakeLists.txt b/packages/intrepid2/perf-test/DynRankView/CMakeLists.txt index 3c2750bb9190..69b55c972bed 100644 --- a/packages/intrepid2/perf-test/DynRankView/CMakeLists.txt +++ b/packages/intrepid2/perf-test/DynRankView/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) IF(Kokkos_ENABLE_SERIAL) ADD_SUBDIRECTORY(Serial) diff --git a/packages/intrepid2/perf-test/DynRankView/Cuda/CMakeLists.txt b/packages/intrepid2/perf-test/DynRankView/Cuda/CMakeLists.txt index 458cb62315bb..048e49724335 100644 --- a/packages/intrepid2/perf-test/DynRankView/Cuda/CMakeLists.txt +++ b/packages/intrepid2/perf-test/DynRankView/Cuda/CMakeLists.txt @@ -1,5 +1,5 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(SOURCES "") diff --git a/packages/intrepid2/perf-test/DynRankView/OpenMP/CMakeLists.txt b/packages/intrepid2/perf-test/DynRankView/OpenMP/CMakeLists.txt index 458cb62315bb..048e49724335 100644 --- a/packages/intrepid2/perf-test/DynRankView/OpenMP/CMakeLists.txt +++ b/packages/intrepid2/perf-test/DynRankView/OpenMP/CMakeLists.txt @@ -1,5 +1,5 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(SOURCES "") diff --git a/packages/intrepid2/perf-test/DynRankView/Serial/CMakeLists.txt b/packages/intrepid2/perf-test/DynRankView/Serial/CMakeLists.txt index afcb274528dc..addaa1d469f1 100644 --- a/packages/intrepid2/perf-test/DynRankView/Serial/CMakeLists.txt +++ b/packages/intrepid2/perf-test/DynRankView/Serial/CMakeLists.txt @@ -1,5 +1,5 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(SOURCES "") diff --git a/packages/intrepid2/src/CMakeLists.txt b/packages/intrepid2/src/CMakeLists.txt index 960310c600c2..cca7b476b23f 100644 --- a/packages/intrepid2/src/CMakeLists.txt +++ b/packages/intrepid2/src/CMakeLists.txt @@ -49,11 +49,11 @@ LIST(REMOVE_DUPLICATES INCDIRS) FOREACH(INCDIR ${INCDIRS}) ## MESSAGE( STATUS "INCDIR : " ${INCDIR} ) - INCLUDE_DIRECTORIES(${INCDIR}) + TRIBITS_INCLUDE_DIRECTORIES(${INCDIR}) ENDFOREACH() -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # # D) Define the targets for package's library(s) diff --git a/packages/intrepid2/unit-test/Cell/CMakeLists.txt b/packages/intrepid2/unit-test/Cell/CMakeLists.txt index 06dac30b0010..3be30cf0436c 100644 --- a/packages/intrepid2/unit-test/Cell/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Cell/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_HEX_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_HEX_FEM/CMakeLists.txt index 5529d05453c5..b7f2c86eabc9 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_HEX_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_HEX_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_QUAD_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_QUAD_FEM/CMakeLists.txt index 0d28c5e10775..fdc7df24790b 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_QUAD_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_QUAD_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_TET_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_TET_FEM/CMakeLists.txt index f2e011f36049..67a01d904ea5 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_TET_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_TET_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_TRI_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_TRI_FEM/CMakeLists.txt index 17c83d7bb6fa..dc47f75c718f 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_TRI_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/DeRHAM_TRI_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_HEX_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_HEX_I1_FEM/CMakeLists.txt index 945499ecaca3..9c85536c8f04 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_HEX_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_HEX_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_HEX_In_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_HEX_In_FEM/CMakeLists.txt index 46f1e06404ee..5e06a09eb454 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_HEX_In_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_HEX_In_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_QUAD_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_QUAD_I1_FEM/CMakeLists.txt index 8d312baa49a8..cb69d71df184 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_QUAD_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_QUAD_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_QUAD_In_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_QUAD_In_FEM/CMakeLists.txt index 75da846685f7..8755589ff621 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_QUAD_In_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_QUAD_In_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TET_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TET_I1_FEM/CMakeLists.txt index c55825a86240..f5d634954c8f 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TET_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TET_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TET_In_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TET_In_FEM/CMakeLists.txt index bc26f191637d..133b3a77868a 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TET_In_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TET_In_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TRI_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TRI_I1_FEM/CMakeLists.txt index 4444a2e23d59..76766346b5cf 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TRI_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TRI_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TRI_In_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TRI_In_FEM/CMakeLists.txt index c4eb3e10e148..5ce72d53a974 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TRI_In_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_TRI_In_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_WEDGE_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_WEDGE_I1_FEM/CMakeLists.txt index f420d7c985f3..485e7dfdfadd 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HCURL_WEDGE_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HCURL_WEDGE_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_HEX_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_HEX_I1_FEM/CMakeLists.txt index 921df7b61e41..c8d281bcb49d 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_HEX_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_HEX_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_HEX_In_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_HEX_In_FEM/CMakeLists.txt index 5152c351ccc1..05d15e60e70f 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_HEX_In_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_HEX_In_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_QUAD_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_QUAD_I1_FEM/CMakeLists.txt index 36691f2b1336..bcda1ff0b32d 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_QUAD_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_QUAD_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_QUAD_In_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_QUAD_In_FEM/CMakeLists.txt index 52de5115eaee..a5b01981d6f6 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_QUAD_In_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_QUAD_In_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TET_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TET_I1_FEM/CMakeLists.txt index b69d69649f72..4ed14e31a822 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TET_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TET_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TET_In_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TET_In_FEM/CMakeLists.txt index 6bd08296ed5f..60a34963742f 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TET_In_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TET_In_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TRI_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TRI_I1_FEM/CMakeLists.txt index 2e91ea9296f6..cfa3c6d7ee13 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TRI_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TRI_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TRI_In_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TRI_In_FEM/CMakeLists.txt index fe86d0dd9382..0523c74171ea 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TRI_In_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_TRI_In_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_WEDGE_I1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_WEDGE_I1_FEM/CMakeLists.txt index 1443291acc47..7d6c9a27cd75 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HDIV_WEDGE_I1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HDIV_WEDGE_I1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_C1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_C1_FEM/CMakeLists.txt index a569545a2326..16379535b189 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_C1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_C1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_C2_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_C2_FEM/CMakeLists.txt index d73db74fc767..c55ac04519c7 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_C2_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_C2_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_Cn_FEM/CMakeLists.txt index c0fb7238f19d..d427a02830a1 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_HEX_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # test diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_C1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_C1_FEM/CMakeLists.txt index 66be084d1d27..8e83e5e79e80 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_C1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_C1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_Cn_FEM/CMakeLists.txt index 0173946caa56..5c0294c42d18 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_Cn_FEM_JACOBI/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_Cn_FEM_JACOBI/CMakeLists.txt index adc0a21103ce..92a682bedd9c 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_Cn_FEM_JACOBI/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_LINE_Cn_FEM_JACOBI/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_PYR_C1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_PYR_C1_FEM/CMakeLists.txt index f5651ca47f51..c8d82611555d 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_PYR_C1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_PYR_C1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_C1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_C1_FEM/CMakeLists.txt index e6361a704af9..a9044329174d 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_C1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_C1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_C2_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_C2_FEM/CMakeLists.txt index a94d9156036a..3df9f211f62d 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_C2_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_C2_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_Cn_FEM/CMakeLists.txt index cc98f0025934..83c91c7674f8 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_QUAD_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # test diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_C1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_C1_FEM/CMakeLists.txt index 45b3db19f768..52bc6c051780 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_C1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_C1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_C2_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_C2_FEM/CMakeLists.txt index 4696782c5f86..6c46e650c119 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_C2_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_C2_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_COMP12_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_COMP12_FEM/CMakeLists.txt index 2d8ee06a3274..ff36bd2c0a02 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_COMP12_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_COMP12_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_Cn_FEM/CMakeLists.txt index 2d689462f31a..fc56c9ac745f 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # test diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_Cn_FEM_ORTH/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_Cn_FEM_ORTH/CMakeLists.txt index 7c39ab11b1e2..d6b9202d58f9 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_Cn_FEM_ORTH/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TET_Cn_FEM_ORTH/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_C1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_C1_FEM/CMakeLists.txt index ff6f0df4d07e..9afb5b60d8b2 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_C1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_C1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_C2_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_C2_FEM/CMakeLists.txt index 4b2d6b4a5190..978408943f4b 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_C2_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_C2_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_Cn_FEM/CMakeLists.txt index 39d5e30bd420..04cb1bcfc9ef 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # test diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_Cn_FEM_ORTH/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_Cn_FEM_ORTH/CMakeLists.txt index 4c5df63a6501..d13a115f40a8 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_Cn_FEM_ORTH/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_TRI_Cn_FEM_ORTH/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_WEDGE_C1_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_WEDGE_C1_FEM/CMakeLists.txt index 801c8242ed8d..7f8c1848100e 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_WEDGE_C1_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_WEDGE_C1_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_WEDGE_C2_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_WEDGE_C2_FEM/CMakeLists.txt index 933af0e02be4..9de6c70a099c 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_WEDGE_C2_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HGRAD_WEDGE_C2_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_C0_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_C0_FEM/CMakeLists.txt index 8c5194b7e52e..35e9be038e07 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_C0_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_C0_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_HEX_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_HEX_Cn_FEM/CMakeLists.txt index 44f65705e1b0..4b64112810e0 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_HEX_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_HEX_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_LINE_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_LINE_Cn_FEM/CMakeLists.txt index 5bb953596def..5ff16a3809c5 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_LINE_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_LINE_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_QUAD_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_QUAD_Cn_FEM/CMakeLists.txt index da53d02dc7cd..9488b23dbbdc 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_QUAD_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_QUAD_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_TET_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_TET_Cn_FEM/CMakeLists.txt index 43b9c584caca..9cfc6eccf6c1 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_TET_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_TET_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_TRI_Cn_FEM/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_TRI_Cn_FEM/CMakeLists.txt index cb6063487996..512d8e2dcdc3 100644 --- a/packages/intrepid2/unit-test/Discretization/Basis/HVOL_TRI_Cn_FEM/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Basis/HVOL_TRI_Cn_FEM/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/FunctionSpaceTools/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/FunctionSpaceTools/CMakeLists.txt index bc5626bfb86b..09ef41aa547f 100644 --- a/packages/intrepid2/unit-test/Discretization/FunctionSpaceTools/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/FunctionSpaceTools/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Discretization/Integration/CMakeLists.txt b/packages/intrepid2/unit-test/Discretization/Integration/CMakeLists.txt index 0936908bf589..e3b4f2fa13a2 100644 --- a/packages/intrepid2/unit-test/Discretization/Integration/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Discretization/Integration/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/MonolithicExecutable/CMakeLists.txt b/packages/intrepid2/unit-test/MonolithicExecutable/CMakeLists.txt index 1b5019eb4b80..3b05fd70b8e2 100644 --- a/packages/intrepid2/unit-test/MonolithicExecutable/CMakeLists.txt +++ b/packages/intrepid2/unit-test/MonolithicExecutable/CMakeLists.txt @@ -4,7 +4,7 @@ #FILE(GLOB TEST_SOURCES "*.cpp" ${ETI_SOURCES} ) FILE(GLOB TEST_SOURCES "*.cpp") -INCLUDE_DIRECTORIES("../../assembly-examples") +TRIBITS_INCLUDE_DIRECTORIES("../../assembly-examples") TRIBITS_ADD_EXECUTABLE_AND_TEST( Intrepid2_Tests diff --git a/packages/intrepid2/unit-test/Orientation/CMakeLists.txt b/packages/intrepid2/unit-test/Orientation/CMakeLists.txt index e2c895af3c03..4ed6bae13257 100644 --- a/packages/intrepid2/unit-test/Orientation/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Orientation/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Projection/CMakeLists.txt b/packages/intrepid2/unit-test/Projection/CMakeLists.txt index 59edeef82e45..0dd72ae7ec25 100644 --- a/packages/intrepid2/unit-test/Projection/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Projection/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) # value types SET(Intrepid2_TEST_ETI_VALUETYPE_NAME "") diff --git a/packages/intrepid2/unit-test/Shared/ArrayTools/CMakeLists.txt b/packages/intrepid2/unit-test/Shared/ArrayTools/CMakeLists.txt index fba6dceeb8be..b7fa5aca6a9d 100644 --- a/packages/intrepid2/unit-test/Shared/ArrayTools/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Shared/ArrayTools/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(Intrepid2_TEST_ETI_FILE "test_01;test_02;test_03;test_04;test_05") diff --git a/packages/intrepid2/unit-test/Shared/PointTools/CMakeLists.txt b/packages/intrepid2/unit-test/Shared/PointTools/CMakeLists.txt index 1e721c9ba703..08f122a52785 100644 --- a/packages/intrepid2/unit-test/Shared/PointTools/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Shared/PointTools/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(Intrepid2_TEST_ETI_FILE "test_01") diff --git a/packages/intrepid2/unit-test/Shared/Polylib/CMakeLists.txt b/packages/intrepid2/unit-test/Shared/Polylib/CMakeLists.txt index d251e33e3b5b..364cf1da008b 100644 --- a/packages/intrepid2/unit-test/Shared/Polylib/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Shared/Polylib/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(Intrepid2_TEST_ETI_FILE "test_01") diff --git a/packages/intrepid2/unit-test/Shared/RealSpaceTools/CMakeLists.txt b/packages/intrepid2/unit-test/Shared/RealSpaceTools/CMakeLists.txt index 7d54c87b93fb..c32dccfbd94b 100644 --- a/packages/intrepid2/unit-test/Shared/RealSpaceTools/CMakeLists.txt +++ b/packages/intrepid2/unit-test/Shared/RealSpaceTools/CMakeLists.txt @@ -1,4 +1,4 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(Intrepid2_TEST_ETI_FILE "test_01") diff --git a/packages/intrepid2/unit-test/performance/StructuredIntegration/CMakeLists.txt b/packages/intrepid2/unit-test/performance/StructuredIntegration/CMakeLists.txt index 86db43427c93..9cd20e448e41 100644 --- a/packages/intrepid2/unit-test/performance/StructuredIntegration/CMakeLists.txt +++ b/packages/intrepid2/unit-test/performance/StructuredIntegration/CMakeLists.txt @@ -2,7 +2,7 @@ SET(SOURCES "") FILE(GLOB SOURCES *.cpp) -INCLUDE_DIRECTORIES("../../../assembly-examples") +TRIBITS_INCLUDE_DIRECTORIES("../../../assembly-examples") SET(LIBRARIES intrepid2) diff --git a/packages/isorropia/src/CMakeLists.txt b/packages/isorropia/src/CMakeLists.txt index 041a5f0dc60d..d275c4f717f2 100644 --- a/packages/isorropia/src/CMakeLists.txt +++ b/packages/isorropia/src/CMakeLists.txt @@ -21,13 +21,13 @@ TRIBITS_CONFIGURE_FILE(${PACKAGE_NAME}_config.h) SET(HEADERS) SET(SOURCES) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) SET(HEADERS ${HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h ) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(HEADERS ${HEADERS} Isorropia_CostDescriber.hpp @@ -52,8 +52,8 @@ SET(SOURCES ${SOURCES} # src/epetra # -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/epetra) -#INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../utils) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/epetra) +#TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../utils) SET(HEADERS ${HEADERS} epetra/Isorropia_EpetraCostDescriber.hpp @@ -85,7 +85,7 @@ SET(SOURCES ${SOURCES} # zoltan -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/epetra/zoltanLib) +TRIBITS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/epetra/zoltanLib) SET(HEADERS ${HEADERS} epetra/zoltanLib/QueryObject.hpp diff --git a/packages/kokkos-kernels/perf_test/CMakeLists.txt b/packages/kokkos-kernels/perf_test/CMakeLists.txt index 91dc72786755..98172f4ada7b 100644 --- a/packages/kokkos-kernels/perf_test/CMakeLists.txt +++ b/packages/kokkos-kernels/perf_test/CMakeLists.txt @@ -24,7 +24,7 @@ TARGET_INCLUDE_DIRECTORIES(kokkoskernelsperf_gtest PUBLIC $