diff --git a/refactoring/replace_include_directories_r.sh b/refactoring/replace_include_directories_r.sh new file mode 100755 index 000000000..1e0fbb4f2 --- /dev/null +++ b/refactoring/replace_include_directories_r.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# +# Run this in a subdir to replace all occurrences of INCLUDE_DIRECTORIES with +# TRIBITS_INCLUDE_DIRECTORIES (and lower-case versions). Take into account +# token boundaries so will not replace in the middle of a token. +# +# Run as: +# +# $ cd +# $ /replace_include_directories_r.sh +# + +_SCRIPT_DIR=`echo $0 | sed "s/\(.*\)\/.*replace_include_directories_r.sh/\1/g"` +#echo $_SCRIPT_DIR + +echo +echo "Replacing INCLUDE_DIRECTORIES with TRIBITS_INCLUDE_DIRECTORIES in all CMakeList.txt and *.cmake files ..." +echo + +find . \( -name CMakeLists.txt -or -name "*.cmake" \) -exec ${_SCRIPT_DIR}/token-replace.py -t INCLUDE_DIRECTORIES -r TRIBITS_INCLUDE_DIRECTORIES -f {} \; + +echo +echo "Replacing include_directories with tribits_include_directories in all CMakeList.txt and *.cmake files ..." +echo + +find . \( -name CMakeLists.txt -or -name "*.cmake" \) -exec ${_SCRIPT_DIR}/token-replace.py -t include_directories -r tribits_include_directories -f {} \; diff --git a/refactoring/string-replace.py b/refactoring/string-replace.py new file mode 100755 index 000000000..2a04a691f --- /dev/null +++ b/refactoring/string-replace.py @@ -0,0 +1,64 @@ +#!/bin/env python3 + +usageHelp = r""" + +Replace a given string with another string in a file (but only touch the file +if there were changes). + +""" + + +def getCmndLineOptions(): + from argparse import ArgumentParser, RawDescriptionHelpFormatter + + clp = ArgumentParser(description=usageHelp, + formatter_class=RawDescriptionHelpFormatter) + + clp.add_argument( + "-s", dest="stringToReplace", required=True, + help="String to repalce" ) + + clp.add_argument( + "-r", dest="replacementString", required=True, + help="Replacement string" ) + + clp.add_argument( + "-f", dest="inputFile", required=True, + help="Input file (and also output if -o not specified)" ) + + clp.add_argument( + "-o", dest="outputFile", default="", + help="Input file (and also output if -o not specified)" ) + + options = clp.parse_args(sys.argv[1:]) + + if options.outputFile == "": + options.outputFile = options.inputFile + + return options + + +# +# Main() +# + +if __name__ == '__main__': + + import sys + + inOptions = getCmndLineOptions() + + with open(inOptions.inputFile, 'r') as file: + lines = file.readlines() + + fileWasChanged = False + newLines = [] + for line in lines: + newLine = line.replace(inOptions.stringToReplace, inOptions.replacementString) + if newLine != line: + fileWasChanged = True + newLines.append(newLine) + + if (fileWasChanged or inOptions.outputFile != inOptions.inputFile): + with open(inOptions.outputFile, 'w') as file: + file.writelines(newLines) diff --git a/refactoring/token-replace.py b/refactoring/token-replace.py new file mode 100755 index 000000000..11ea49aaa --- /dev/null +++ b/refactoring/token-replace.py @@ -0,0 +1,77 @@ +#!/bin/env python3 + +usageHelp = r""" + +Replace a given token string with another string in a file (but only touch the +file if there were changes). + +This will only match complete tokens that match the regex: + + ([^A-Za-z0-9_])|^)_ENABLE_INSTALLATION_TESTING option works as it should. This above -# test also shows the the installation of the non-Fortran packages in -# TribitsExampleProject works and is independent from the source and build -# trees. If you comment out the cmake options -# TribitsExProj_ENABLE_INSTALLATION_TESTING and TribitsExProj_INSTALLATION_DIR -# you will see that build of the project fails because we removed some source -# files that are needed. This proves that they are being used from the -# install tree! +# _ENABLE_INSTALLATION_TESTING option works as it should. It removes +# source files from the installation testing source tree which shows that +# those files are not being built. It also leaves the library header files +# but it breaks them to ensure that they do not get selected therefore include +# dirs from the soruce tree are not added. Since the include directories from +# the installed project are pulled in with -isystem, the -I for the local +# source tree would be searched first. Therefore, this test shows that those +# -I directories are not added to the compile lines. This above test also +# shows the installation of the non-Fortran packages in TribitsExampleProject +# works and is independent from the source and build trees. If you comment +# out the cmake options TribitsExProj_ENABLE_INSTALLATION_TESTING and +# TribitsExProj_INSTALLATION_DIR you will see that build of the project fails +# because we removed some source files that are needed. This proves that they +# are being used from the install tree! ######################################################################## diff --git a/test/core/ExamplesUnitTests/append_line_to_files.sh b/test/core/ExamplesUnitTests/append_line_to_files.sh new file mode 100755 index 000000000..3dea5a7a2 --- /dev/null +++ b/test/core/ExamplesUnitTests/append_line_to_files.sh @@ -0,0 +1,12 @@ +#!/bin/bash -e +# +# Append a line to one or more files: +# +# append_line_to_files.sh ... + +LINE_TO_APPEND=$1 ; shift + +for file in $@ ; do + echo "Appending '$LINE_TO_APPEND' to file '${file}'" + echo "$LINE_TO_APPEND" >> $file +done diff --git a/test/core/TestingFunctionMacro_UnitTests.cmake b/test/core/TestingFunctionMacro_UnitTests.cmake index 059276a67..a4e632c07 100644 --- a/test/core/TestingFunctionMacro_UnitTests.cmake +++ b/test/core/TestingFunctionMacro_UnitTests.cmake @@ -94,9 +94,12 @@ include(AppendStringVar) function(unittest_append_string_var) message("\n***") - message("*** Testing append_string_var()") + message("*** Testing append_string_var() (deprecated)") message("***\n") + # Suppress deprecation warnings + set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE IGNORE) + message("append_string_var(): Testing simple concatenation") set(SOME_STRING_VAR "") append_string_var(SOME_STRING_VAR @@ -367,7 +370,7 @@ function(unittest_tribits_misc) tribits_filter_and_assert_categories(CATEGORIES) set(MESSAGE_WRAPPER_UNIT_TEST_MODE FALSE) unittest_compare_const(MESSAGE_WRAPPER_INPUT - "DEPRECATION;The test category 'WEEKLY' is deprecated; and is replaced with 'HEAVY'. Please change to use 'HEAVY' instead.") + "DEPRECATION;The test category 'WEEKLY' is deprecated; and is replaced with 'HEAVY'. Please change to use 'HEAVY' instead.;${TRIBITS_DEPRECATE_MSG_LAST_PART}") unittest_compare_const(CATEGORIES "BASIC;HEAVY;NIGHTLY") message("Testing tribits_filter_and_assert_categories( ... HEAVY)") @@ -1768,7 +1771,7 @@ function(unittest_tribits_add_test_categories) tribits_add_test( ${EXEN} CATEGORIES WEEKLY ) unittest_compare_const( MESSAGE_WRAPPER_INPUT - "DEPRECATION;The test category 'WEEKLY' is deprecated; and is replaced with 'HEAVY'. Please change to use 'HEAVY' instead.;-- PackageA_SomeExec: Added test (HEAVY, PROCESSORS=1)!" + "DEPRECATION;The test category 'WEEKLY' is deprecated; and is replaced with 'HEAVY'. Please change to use 'HEAVY' instead.;${TRIBITS_DEPRECATE_MSG_LAST_PART};-- PackageA_SomeExec: Added test (HEAVY, PROCESSORS=1)!" ) unittest_compare_const( TRIBITS_ADD_TEST_ADD_TEST_INPUT @@ -4615,7 +4618,7 @@ function(unittest_tribits_deprecated) tribits_deprecated("This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE unset") unittest_compare_const( MESSAGE_WRAPPER_INPUT - "DEPRECATION;This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE unset" + "DEPRECATION;This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE unset;${TRIBITS_DEPRECATE_MSG_LAST_PART}" ) message("Testing tribits_deprecated() with multiple message arguments") @@ -4625,7 +4628,7 @@ function(unittest_tribits_deprecated) " multiple message arguments") unittest_compare_const( MESSAGE_WRAPPER_INPUT - "DEPRECATION;This is a deprecation message with; multiple message arguments" + "DEPRECATION;This is a deprecation message with; multiple message arguments;${TRIBITS_DEPRECATE_MSG_LAST_PART}" ) message("Testing tribits_deprecated() with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to empty string") @@ -4634,7 +4637,7 @@ function(unittest_tribits_deprecated) tribits_deprecated("This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to empty string") unittest_compare_const( MESSAGE_WRAPPER_INPUT - "DEPRECATION;This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to empty string" + "DEPRECATION;This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to empty string;${TRIBITS_DEPRECATE_MSG_LAST_PART}" ) message("Testing tribits_deprecated() with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to DEPRECATION") @@ -4643,7 +4646,7 @@ function(unittest_tribits_deprecated) tribits_deprecated("This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to DEPRECATION") unittest_compare_const( MESSAGE_WRAPPER_INPUT - "DEPRECATION;This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to DEPRECATION" + "DEPRECATION;This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to DEPRECATION;${TRIBITS_DEPRECATE_MSG_LAST_PART}" ) message("Testing tribits_deprecated() with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to AUTHOR_WARNING") @@ -4652,7 +4655,7 @@ function(unittest_tribits_deprecated) tribits_deprecated("This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to AUTHOR_WARNING") unittest_compare_const( MESSAGE_WRAPPER_INPUT - "AUTHOR_WARNING;This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to AUTHOR_WARNING" + "AUTHOR_WARNING;This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to AUTHOR_WARNING;${TRIBITS_DEPRECATE_MSG_LAST_PART}" ) message("Testing tribits_deprecated() with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to SEND_ERROR") @@ -4661,7 +4664,7 @@ function(unittest_tribits_deprecated) tribits_deprecated("This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to SEND_ERROR") unittest_compare_const( MESSAGE_WRAPPER_INPUT - "SEND_ERROR;This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to SEND_ERROR" + "SEND_ERROR;This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to SEND_ERROR;${TRIBITS_DEPRECATE_MSG_LAST_PART}" ) message("Testing tribits_deprecated() with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to FATAL_ERROR") @@ -4670,7 +4673,7 @@ function(unittest_tribits_deprecated) tribits_deprecated("This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to FATAL_ERROR") unittest_compare_const( MESSAGE_WRAPPER_INPUT - "FATAL_ERROR;This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to FATAL_ERROR" + "FATAL_ERROR;This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to FATAL_ERROR;${TRIBITS_DEPRECATE_MSG_LAST_PART}" ) message("Testing tribits_deprecated() with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to INVALID") @@ -4679,7 +4682,7 @@ function(unittest_tribits_deprecated) tribits_deprecated("This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to INVALID") unittest_compare_const( MESSAGE_WRAPPER_INPUT - "FATAL_ERROR;Invalid value for TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE: 'INVALID'" + "FATAL_ERROR;Invalid value for; TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE=;'INVALID'" ) endfunction() @@ -4699,7 +4702,7 @@ function(unittest_tribits_deprecated_command) tribits_deprecated_command(tribits_some_deprecated_command) unittest_compare_const( MESSAGE_WRAPPER_INPUT - "DEPRECATION;TriBITS command 'tribits_some_deprecated_command' is deprecated." + "DEPRECATION;TriBITS command 'tribits_some_deprecated_command' is deprecated.;${TRIBITS_DEPRECATE_MSG_LAST_PART}" ) message("Testing tribits_deprecated_command() with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to AUTHOR_WARNING") @@ -4708,7 +4711,7 @@ function(unittest_tribits_deprecated_command) tribits_deprecated_command(tribits_some_other_deprecated_command) unittest_compare_const( MESSAGE_WRAPPER_INPUT - "AUTHOR_WARNING;TriBITS command 'tribits_some_other_deprecated_command' is deprecated." + "AUTHOR_WARNING;TriBITS command 'tribits_some_other_deprecated_command' is deprecated.;${TRIBITS_DEPRECATE_MSG_LAST_PART}" ) message("Testing tribits_deprecated_command() with a message") @@ -4719,7 +4722,7 @@ function(unittest_tribits_deprecated_command) ) unittest_compare_const( MESSAGE_WRAPPER_INPUT - "DEPRECATION;TriBITS command 'tribits_another_deprecated_command' is deprecated.\n\nUse tribits_some_new_command instead." + "DEPRECATION;TriBITS command 'tribits_another_deprecated_command' is deprecated.\n\nUse tribits_some_new_command instead.;${TRIBITS_DEPRECATE_MSG_LAST_PART}" ) message("Testing tribits_deprecated_command() with multiple MESSAGE arguments") @@ -4731,7 +4734,7 @@ function(unittest_tribits_deprecated_command) ) unittest_compare_const( MESSAGE_WRAPPER_INPUT - "DEPRECATION;TriBITS command 'tribits_yet_another_deprecated_command' is deprecated.\n\nThis is a deprecation message with; multiple arguments." + "DEPRECATION;TriBITS command 'tribits_yet_another_deprecated_command' is deprecated.\n\nThis is a deprecation message with; multiple arguments.;${TRIBITS_DEPRECATE_MSG_LAST_PART}" ) endfunction() @@ -4756,6 +4759,11 @@ set( TRIBITS_ADD_TEST_ADD_TEST_UNITTEST TRUE ) # Capture the add_test() arguments for tribits_add_test(). set( TRIBITS_ADD_TEST_ADD_TEST_CAPTURE TRUE ) +# String for common part of tribits_deprecate() message +set(TRIBITS_DEPRECATE_MSG_LAST_PART + "\n\nNOTE: To Make these warnings go away, set -D" + " TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE=IGNORE (see the build reference guide).") + message("\n***") message("*** Testing misc TriBITS functions and macros") message("***\n") diff --git a/test/core/TribitsAdjustPackageEnables_UnitTests.cmake b/test/core/TribitsAdjustPackageEnables_UnitTests.cmake index 811333abf..b460f17de 100644 --- a/test/core/TribitsAdjustPackageEnables_UnitTests.cmake +++ b/test/core/TribitsAdjustPackageEnables_UnitTests.cmake @@ -379,6 +379,9 @@ function(unittest_enable_all_st_generate_export_deps_only_ex2package1_se_pkgs) message("*** Test generation of export dependencies only up to Ex2Package1 with deprecated var _GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES") message("***\n") + # Suppress deprecation warnings + set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE IGNORE) + # Debugging #set(${PROJECT_NAME}_VERBOSE_CONFIGURE ON) #set(${PROJECT_NAME}_DUMP_PACKAGE_DEPENDENCIES ON) @@ -387,7 +390,7 @@ function(unittest_enable_all_st_generate_export_deps_only_ex2package1_se_pkgs) set(${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE ON) set(${PROJECT_NAME}_GENERATE_EXPORT_FILE_DEPENDENCIES ON) set(${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES - Ex2Package1 RTOp) + Ex2Package1 RTOp) # Deprecated! unittest_helper_read_and_process_packages() diff --git a/test/core/TribitsReadAllProjectDepsFilesCreateDepsGraph_UnitTests.cmake b/test/core/TribitsReadAllProjectDepsFilesCreateDepsGraph_UnitTests.cmake index 878459e52..f742ecbb4 100644 --- a/test/core/TribitsReadAllProjectDepsFilesCreateDepsGraph_UnitTests.cmake +++ b/test/core/TribitsReadAllProjectDepsFilesCreateDepsGraph_UnitTests.cmake @@ -195,6 +195,9 @@ function(unitest_tribits_set_ss_for_dev_mode_backward_compatible) message("*** Testing tribits_set_ss_for_dev_mode() backward compatibility") message("***\n") + # Suppress deprecation warnings + set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE IGNORE) + message("\nTest in dev mode, ST off ...") set(${PROJECT_NAME}_ENABLE_DEVELOPMENT_MODE ON) set(${PROJECT_NAME}_ENABLE_SECONDARY_TESTED_CODE OFF) diff --git a/tribits/CHANGELOG.md b/tribits/CHANGELOG.md index 5b1147d33..0d122142a 100644 --- a/tribits/CHANGELOG.md +++ b/tribits/CHANGELOG.md @@ -2,6 +2,25 @@ ChangeLog for TriBITS ---------------------------------------- +## 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 diff --git a/tribits/core/package_arch/TribitsGlobalMacros.cmake b/tribits/core/package_arch/TribitsGlobalMacros.cmake index 283d81af7..7f452f338 100644 --- a/tribits/core/package_arch/TribitsGlobalMacros.cmake +++ b/tribits/core/package_arch/TribitsGlobalMacros.cmake @@ -959,8 +959,12 @@ 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 "DEPRECATION" + 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 diff --git a/tribits/core/package_arch/TribitsIncludeDirectories.cmake b/tribits/core/package_arch/TribitsIncludeDirectories.cmake index f31da5dfb..e28809495 100644 --- a/tribits/core/package_arch/TribitsIncludeDirectories.cmake +++ b/tribits/core/package_arch/TribitsIncludeDirectories.cmake @@ -43,14 +43,14 @@ 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. @@ -62,10 +62,10 @@ include(TribitsDeprecatedHelpers) # 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) @@ -81,13 +81,25 @@ 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) tribits_deprecated_command(include_directories @@ -106,7 +118,11 @@ macro(include_directories) ${ARGN} ) - 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/tribits/core/utils/CMakeOverrides.cmake b/tribits/core/utils/CMakeOverrides.cmake deleted file mode 100644 index 1c95ecfdb..000000000 --- a/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/tribits/core/utils/TribitsDeprecatedHelpers.cmake b/tribits/core/utils/TribitsDeprecatedHelpers.cmake index 4dec816bf..0ae57138e 100644 --- a/tribits/core/utils/TribitsDeprecatedHelpers.cmake +++ b/tribits/core/utils/TribitsDeprecatedHelpers.cmake @@ -42,34 +42,33 @@ include(TribitsParseArgumentsHelpers) set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_VALUES_THAT_CALL_MESSAGE - DEPRECATION AUTHOR_WARNING SEND_ERROR FATAL_ERROR - ) + DEPRECATION AUTHOR_WARNING SEND_ERROR FATAL_ERROR ) set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_VALUES_THAT_DONT_CALL_MESSAGE - IGNORE - ) + 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_CALL_MESSAGE} - ) + ${TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_VALUES_THAT_DONT_CALL_MESSAGE} ) # @FUNCTION: tribits_deprecated() # -# Notify the user that some TriBITS functionality is deprecated. Depending on -# the value of TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE, this can do one of -# several things: -# -# - ``DEPRECATION`` or empty string: 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. +# 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 "" "" "") @@ -78,9 +77,16 @@ function(tribits_deprecated) 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}) - 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}'") + 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() diff --git a/tribits/doc/build_ref/TribitsBuildReferenceBody.rst b/tribits/doc/build_ref/TribitsBuildReferenceBody.rst index f71863a55..07f0570a2 100644 --- a/tribits/doc/build_ref/TribitsBuildReferenceBody.rst +++ b/tribits/doc/build_ref/TribitsBuildReferenceBody.rst @@ -2089,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 ------------------------- diff --git a/tribits/doc/guides/TribitsCoreDetailedReference.rst b/tribits/doc/guides/TribitsCoreDetailedReference.rst index e5ef0fa66..2cc0fb95e 100644 --- a/tribits/doc/guides/TribitsCoreDetailedReference.rst +++ b/tribits/doc/guides/TribitsCoreDetailedReference.rst @@ -98,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. @@ -862,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/tribits/examples/InsertedPkg/CMakeLists.txt b/tribits/examples/InsertedPkg/CMakeLists.txt index 595541621..7df9c56e8 100644 --- a/tribits/examples/InsertedPkg/CMakeLists.txt +++ b/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/tribits/examples/MixedSharedStaticLibs/shared_only/CMakeLists.txt b/tribits/examples/MixedSharedStaticLibs/shared_only/CMakeLists.txt index 5a4746eda..7cec4e8ca 100644 --- a/tribits/examples/MixedSharedStaticLibs/shared_only/CMakeLists.txt +++ b/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/tribits/examples/MixedSharedStaticLibs/static_only/CMakeLists.txt b/tribits/examples/MixedSharedStaticLibs/static_only/CMakeLists.txt index 62e8bddd8..7df259489 100644 --- a/tribits/examples/MixedSharedStaticLibs/static_only/CMakeLists.txt +++ b/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/tribits/examples/TargetDefinesPkg/CMakeLists.txt b/tribits/examples/TargetDefinesPkg/CMakeLists.txt index 4ca9cd0fa..0952d5736 100644 --- a/tribits/examples/TargetDefinesPkg/CMakeLists.txt +++ b/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/tribits/examples/TribitsExampleProject/CMakeLists.txt b/tribits/examples/TribitsExampleProject/CMakeLists.txt index a44121b80..f413d381b 100644 --- a/tribits/examples/TribitsExampleProject/CMakeLists.txt +++ b/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/tribits/examples/TribitsExampleProject/packages/mixed_lang/src/CMakeLists.txt b/tribits/examples/TribitsExampleProject/packages/mixed_lang/src/CMakeLists.txt index a8d33b430..ddbeb6658 100644 --- a/tribits/examples/TribitsExampleProject/packages/mixed_lang/src/CMakeLists.txt +++ b/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/tribits/examples/TribitsExampleProject/packages/simple_cxx/src/CMakeLists.txt b/tribits/examples/TribitsExampleProject/packages/simple_cxx/src/CMakeLists.txt index d00de0da8..234a196d5 100644 --- a/tribits/examples/TribitsExampleProject/packages/simple_cxx/src/CMakeLists.txt +++ b/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/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/CMakeLists.txt b/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/CMakeLists.txt index 4b39105c9..f553d4ef2 100644 --- a/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/CMakeLists.txt +++ b/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/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/SimpleCxx_HelloWorld_Tests.cpp b/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/SimpleCxx_HelloWorld_Tests.cpp index 575555ffb..85430c8cf 100644 --- a/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/SimpleCxx_HelloWorld_Tests.cpp +++ b/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/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/inc/SimpleCxx_HelloWorld_Tests.hpp b/tribits/examples/TribitsExampleProject/packages/simple_cxx/test/inc/SimpleCxx_HelloWorld_Tests.hpp new file mode 100644 index 000000000..78b70ccc3 --- /dev/null +++ b/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/tribits/examples/TribitsExampleProject/packages/with_subpackages/a/CMakeLists.txt b/tribits/examples/TribitsExampleProject/packages/with_subpackages/a/CMakeLists.txt index e7cdf9cf6..9de350b0a 100644 --- a/tribits/examples/TribitsExampleProject/packages/with_subpackages/a/CMakeLists.txt +++ b/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/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/src/CMakeLists.txt b/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/src/CMakeLists.txt index cde554625..0f64659a5 100644 --- a/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/src/CMakeLists.txt +++ b/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/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/tests/testlib/CMakeLists.txt b/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/tests/testlib/CMakeLists.txt index 407fc6a27..215659e60 100644 --- a/tribits/examples/TribitsExampleProject/packages/with_subpackages/b/tests/testlib/CMakeLists.txt +++ b/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/tribits/examples/TribitsExampleProject/packages/with_subpackages/c/CMakeLists.txt b/tribits/examples/TribitsExampleProject/packages/with_subpackages/c/CMakeLists.txt index 475912fac..696a5815c 100644 --- a/tribits/examples/TribitsExampleProject/packages/with_subpackages/c/CMakeLists.txt +++ b/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/tribits/examples/TribitsExampleProject/packages/wrap_external/CMakeLists.txt b/tribits/examples/TribitsExampleProject/packages/wrap_external/CMakeLists.txt index 3adfc2cdb..0efcd994f 100644 --- a/tribits/examples/TribitsExampleProject/packages/wrap_external/CMakeLists.txt +++ b/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/tribits/examples/TribitsExampleProject2/CMakeLists.txt b/tribits/examples/TribitsExampleProject2/CMakeLists.txt index 661cb556e..8e63bc40e 100644 --- a/tribits/examples/TribitsExampleProject2/CMakeLists.txt +++ b/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/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.txt b/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.txt index a0d23199e..b74162bb2 100644 --- a/tribits/examples/TribitsExampleProject2/packages/package1/src/CMakeLists.txt +++ b/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/tribits/examples/TribitsExampleProject2/packages/package2/src/CMakeLists.txt b/tribits/examples/TribitsExampleProject2/packages/package2/src/CMakeLists.txt index 1de2194cb..5f95a0ef0 100644 --- a/tribits/examples/TribitsExampleProject2/packages/package2/src/CMakeLists.txt +++ b/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/tribits/examples/TribitsExampleProject2/packages/package3/src/CMakeLists.txt b/tribits/examples/TribitsExampleProject2/packages/package3/src/CMakeLists.txt index ffe0ecc60..8b36f56b9 100644 --- a/tribits/examples/TribitsExampleProject2/packages/package3/src/CMakeLists.txt +++ b/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/tribits/examples/TribitsExampleProjectAddons/packages/addon1/src/CMakeLists.txt b/tribits/examples/TribitsExampleProjectAddons/packages/addon1/src/CMakeLists.txt index d4fffaa07..c890968cd 100644 --- a/tribits/examples/TribitsExampleProjectAddons/packages/addon1/src/CMakeLists.txt +++ b/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