diff --git a/test/core/CMakeLists.txt b/test/core/CMakeLists.txt index 442c5b3b8..0f987cc7a 100644 --- a/test/core/CMakeLists.txt +++ b/test/core/CMakeLists.txt @@ -49,7 +49,7 @@ tribits_add_advanced_test( TestingFunctionMacro_UnitTests -D${PROJECT_NAME}_TRIBITS_DIR=${${PROJECT_NAME}_TRIBITS_DIR} -P "${CMAKE_CURRENT_SOURCE_DIR}/TestingFunctionMacro_UnitTests.cmake" PASS_REGULAR_EXPRESSION_ALL - "Final UnitTests Result: num_run = 717" + "Final UnitTests Result: num_run = 719" "Final UnitTests Result: PASSED" ) diff --git a/test/core/ExamplesUnitTests/TribitsExampleProject_Tests.cmake b/test/core/ExamplesUnitTests/TribitsExampleProject_Tests.cmake index e461d2aaa..5a1349f28 100644 --- a/test/core/ExamplesUnitTests/TribitsExampleProject_Tests.cmake +++ b/test/core/ExamplesUnitTests/TribitsExampleProject_Tests.cmake @@ -1600,7 +1600,7 @@ tribits_add_advanced_test( TribitsExampleProject_ALL_ST_LibUsage ARGS -DSPKB_SHOW_UPSTREAM_DEPLIBS_ERROR=ON . PASS_REGULAR_EXPRESSION_ALL - "WARNING: 'simplecxx' in DEPLIBS is not a lib in this package" + "'simplecxx' in DEPLIBS is not a lib in this package" "packages/with_subpackages/b/src/CMakeLists.txt:.* [(]tribits_add_library[)]" "Generating done" "Build files have been written to: .*/TriBITS_TribitsExampleProject_ALL_ST_LibUsage" @@ -1612,7 +1612,7 @@ tribits_add_advanced_test( TribitsExampleProject_ALL_ST_LibUsage -DSPKB_SHOW_UPSTREAM_DEPLIBS_ERROR= . PASS_REGULAR_EXPRESSION_ALL - "WARNING: Lib 'pws_b' in IMPORTEDLIBS is in this package " + "Lib 'pws_b' in IMPORTEDLIBS is in this package " "packages/with_subpackages/b/tests/testlib/CMakeLists.txt:.* [(]tribits_add_library[)]" "Generating done" "Build files have been written to: .*/TriBITS_TribitsExampleProject_ALL_ST_LibUsage" @@ -1625,7 +1625,7 @@ tribits_add_advanced_test( TribitsExampleProject_ALL_ST_LibUsage -DSPKB_SHOW_PKG_LIB_IMPORTEDLIBS_ERROR= . PASS_REGULAR_EXPRESSION_ALL - "WARNING: Lib 'simplecxx' being passed through IMPORTEDLIBS" + "Lib 'simplecxx' being passed through IMPORTEDLIBS" "TribitsExampleProject/packages/with_subpackages/b/cmake/Dependencies.cmake" "packages/with_subpackages/b/tests/testlib/CMakeLists.txt:.* [(]tribits_add_library[)]" "Generating done" @@ -1638,7 +1638,7 @@ tribits_add_advanced_test( TribitsExampleProject_ALL_ST_LibUsage -DSPKB_SHOW_UPSTREAM_PKG_LIB_IMPORTEDLIBS_ERROR= . PASS_REGULAR_EXPRESSION_ALL - "WARNING: 'b_mixed_lang' in DEPLIBS is a TESTONLY lib " + "'b_mixed_lang' in DEPLIBS is a TESTONLY lib " "TribitsExampleProject/packages/with_subpackages/c/cmake/Dependencies.cmake" "packages/with_subpackages/c/CMakeLists.txt:.* [(]tribits_add_library[)]" "Generating done" @@ -1651,7 +1651,7 @@ tribits_add_advanced_test( TribitsExampleProject_ALL_ST_LibUsage -DSPKC_SHOW_TESTONLY_DEPLBIS_ERROR= . PASS_REGULAR_EXPRESSION_ALL - "WARNING: 'b_mixed_lang' in IMPORTEDLIBS is a TESTONLY lib" + "'b_mixed_lang' in IMPORTEDLIBS is a TESTONLY lib" "packages/with_subpackages/c/CMakeLists.txt:.* [(]tribits_add_library[)]" "Generating done" "Build files have been written to: .*/TriBITS_TribitsExampleProject_ALL_ST_LibUsage" @@ -1663,7 +1663,7 @@ tribits_add_advanced_test( TribitsExampleProject_ALL_ST_LibUsage -DSPKC_SHOW_TESTONLY_IMPORTEDLIBS_ERROR= . PASS_REGULAR_EXPRESSION_ALL - "WARNING: 'm' in DEPLIBS is not a lib defined in the current cmake " + "'m' in DEPLIBS is not a lib defined in the current cmake " "packages/with_subpackages/b/src/CMakeLists.txt:.* [(]tribits_add_library[)]" "Generating done" "Build files have been written to: .*/TriBITS_TribitsExampleProject_ALL_ST_LibUsage" @@ -1712,7 +1712,7 @@ tribits_add_advanced_test( TribitsExampleProject_ALL_ST_LibUsage -DSPKB_SHOW_IMPORTED_LIBS_THIS_PKG_ERROR= . PASS_REGULAR_EXPRESSION_ALL - "WARNING: Passing TESTONLY lib 'b_mixed_lang' through DEPLIBS is deprecated" + "Passing TESTONLY lib 'b_mixed_lang' through DEPLIBS is deprecated" "packages/with_subpackages/b/tests/CMakeLists.txt:.* [(]tribits_add_executable_and_test[)]" "Generating done" "Build files have been written to: .*/TriBITS_TribitsExampleProject_ALL_ST_LibUsage" @@ -1724,7 +1724,7 @@ tribits_add_advanced_test( TribitsExampleProject_ALL_ST_LibUsage -DSPKB_SHOW_TESTONLY_DEBLIBS_WARNING= . PASS_REGULAR_EXPRESSION_ALL - "WARNING: Passing non-TESTONLY lib 'pws_b' through DEPLIBS is deprecated" + "Passing non-TESTONLY lib 'pws_b' through DEPLIBS is deprecated" "packages/with_subpackages/b/tests/CMakeLists.txt:.* [(]tribits_add_executable_and_test[)]" "Generating done" "Build files have been written to: .*/TriBITS_TribitsExampleProject_ALL_ST_LibUsage" @@ -1736,7 +1736,7 @@ tribits_add_advanced_test( TribitsExampleProject_ALL_ST_LibUsage -DSPKB_SHOW_NONTESTONLY_DEBLIBS_WARNING= . PASS_REGULAR_EXPRESSION_ALL - "WARNING: Passing external lib 'm' through DEPLIBS is deprecated" + "Passing external lib 'm' through DEPLIBS is deprecated" "packages/with_subpackages/b/tests/CMakeLists.txt:.* [(]tribits_add_executable_and_test[)]" "Generating done" "Build files have been written to: .*/TriBITS_TribitsExampleProject_ALL_ST_LibUsage" @@ -1784,7 +1784,7 @@ tribits_add_advanced_test( TribitsExampleProject_ALL_ST_LibUsage_LibPrefix ARGS -DSPKB_SHOW_UPSTREAM_DEPLIBS_ERROR=ON . PASS_REGULAR_EXPRESSION_ALL - "WARNING: 'simplecxx' in DEPLIBS is not a lib in this package" + "'simplecxx' in DEPLIBS is not a lib in this package" "packages/with_subpackages/b/src/CMakeLists.txt:.* [(]tribits_add_library[)]" "Generating done" "Build files have been written to: .*/TriBITS_TribitsExampleProject_ALL_ST_LibUsage_LibPrefix" @@ -1796,7 +1796,7 @@ tribits_add_advanced_test( TribitsExampleProject_ALL_ST_LibUsage_LibPrefix -DSPKB_SHOW_UPSTREAM_DEPLIBS_ERROR= . PASS_REGULAR_EXPRESSION_ALL - "WARNING: Lib 'pws_b' in IMPORTEDLIBS is in this package " + "Lib 'pws_b' in IMPORTEDLIBS is in this package " "packages/with_subpackages/b/tests/testlib/CMakeLists.txt:.* [(]tribits_add_library[)]" "Generating done" "Build files have been written to: .*/TriBITS_TribitsExampleProject_ALL_ST_LibUsage_LibPrefix" @@ -1809,7 +1809,7 @@ tribits_add_advanced_test( TribitsExampleProject_ALL_ST_LibUsage_LibPrefix -DSPKB_SHOW_PKG_LIB_IMPORTEDLIBS_ERROR= . PASS_REGULAR_EXPRESSION_ALL - "WARNING: Lib 'simplecxx' being passed through IMPORTEDLIBS" + "Lib 'simplecxx' being passed through IMPORTEDLIBS" "TribitsExampleProject/packages/with_subpackages/b/cmake/Dependencies.cmake" "packages/with_subpackages/b/tests/testlib/CMakeLists.txt:.* [(]tribits_add_library[)]" "Generating done" @@ -1822,7 +1822,7 @@ tribits_add_advanced_test( TribitsExampleProject_ALL_ST_LibUsage_LibPrefix -DSPKB_SHOW_UPSTREAM_PKG_LIB_IMPORTEDLIBS_ERROR= . PASS_REGULAR_EXPRESSION_ALL - "WARNING: 'b_mixed_lang' in DEPLIBS is a TESTONLY lib " + "'b_mixed_lang' in DEPLIBS is a TESTONLY lib " "TribitsExampleProject/packages/with_subpackages/c/cmake/Dependencies.cmake" "packages/with_subpackages/c/CMakeLists.txt:.* [(]tribits_add_library[)]" "Generating done" @@ -1835,7 +1835,7 @@ tribits_add_advanced_test( TribitsExampleProject_ALL_ST_LibUsage_LibPrefix -DSPKC_SHOW_TESTONLY_DEPLBIS_ERROR= . PASS_REGULAR_EXPRESSION_ALL - "WARNING: 'b_mixed_lang' in IMPORTEDLIBS is a TESTONLY lib" + "'b_mixed_lang' in IMPORTEDLIBS is a TESTONLY lib" "packages/with_subpackages/c/CMakeLists.txt:.* [(]tribits_add_library[)]" "Generating done" "Build files have been written to: .*/TriBITS_TribitsExampleProject_ALL_ST_LibUsage_LibPrefix" @@ -1847,7 +1847,7 @@ tribits_add_advanced_test( TribitsExampleProject_ALL_ST_LibUsage_LibPrefix -DSPKC_SHOW_TESTONLY_IMPORTEDLIBS_ERROR= . PASS_REGULAR_EXPRESSION_ALL - "WARNING: 'm' in DEPLIBS is not a lib defined in the current cmake " + "'m' in DEPLIBS is not a lib defined in the current cmake " "packages/with_subpackages/b/src/CMakeLists.txt:.* [(]tribits_add_library[)]" "Generating done" "Build files have been written to: .*/TriBITS_TribitsExampleProject_ALL_ST_LibUsage_LibPrefix" @@ -1896,7 +1896,7 @@ tribits_add_advanced_test( TribitsExampleProject_ALL_ST_LibUsage_LibPrefix -DSPKB_SHOW_IMPORTED_LIBS_THIS_PKG_ERROR= . PASS_REGULAR_EXPRESSION_ALL - "WARNING: Passing TESTONLY lib 'b_mixed_lang' through DEPLIBS is deprecated" + "Passing TESTONLY lib 'b_mixed_lang' through DEPLIBS is deprecated" "packages/with_subpackages/b/tests/CMakeLists.txt:.* [(]tribits_add_executable_and_test[)]" "Generating done" "Build files have been written to: .*/TriBITS_TribitsExampleProject_ALL_ST_LibUsage_LibPrefix" @@ -1908,7 +1908,7 @@ tribits_add_advanced_test( TribitsExampleProject_ALL_ST_LibUsage_LibPrefix -DSPKB_SHOW_TESTONLY_DEBLIBS_WARNING= . PASS_REGULAR_EXPRESSION_ALL - "WARNING: Passing non-TESTONLY lib 'pws_b' through DEPLIBS is deprecated" + "Passing non-TESTONLY lib 'pws_b' through DEPLIBS is deprecated" "packages/with_subpackages/b/tests/CMakeLists.txt:.* [(]tribits_add_executable_and_test[)]" "Generating done" "Build files have been written to: .*/TriBITS_TribitsExampleProject_ALL_ST_LibUsage_LibPrefix" @@ -2816,7 +2816,7 @@ tribits_add_advanced_test( TribitsExampleProject_TargetDefinesPkg -DTribitsExProj_ENABLE_TESTS=ON . PASS_REGULAR_EXPRESSION_ALL - "WARNING: Passing extra defines through 'DEFINES'" + "Passing extra defines through 'DEFINES'" "Final set of enabled top-level packages: TargetDefinesPkg 1" "Final set of enabled packages: TargetDefinesPkg 1" "Configuring done" diff --git a/test/core/TestingFunctionMacro_UnitTests.cmake b/test/core/TestingFunctionMacro_UnitTests.cmake index a94ac9de3..e45aa9483 100644 --- a/test/core/TestingFunctionMacro_UnitTests.cmake +++ b/test/core/TestingFunctionMacro_UnitTests.cmake @@ -346,7 +346,7 @@ function(unittest_tribits_misc) tribits_filter_and_assert_categories(CATEGORIES) set(MESSAGE_WRAPPER_UNIT_TEST_MODE FALSE) unittest_compare_const(MESSAGE_WRAPPER_INPUT - "WARNING;Warning: 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.") unittest_compare_const(CATEGORIES "BASIC;HEAVY;NIGHTLY") message("Testing tribits_filter_and_assert_categories( ... HEAVY)") @@ -1747,7 +1747,7 @@ function(unittest_tribits_add_test_categories) tribits_add_test( ${EXEN} CATEGORIES WEEKLY ) unittest_compare_const( MESSAGE_WRAPPER_INPUT - "WARNING;Warning: 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.;-- PackageA_SomeExec: Added test (HEAVY, PROCESSORS=1)!" ) unittest_compare_const( TRIBITS_ADD_TEST_ADD_TEST_INPUT @@ -4597,6 +4597,16 @@ function(unittest_tribits_deprecated) "DEPRECATION;This is a deprecation message with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE unset" ) + message("Testing tribits_deprecated() with multiple message arguments") + unset(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE) + global_set(MESSAGE_WRAPPER_INPUT) + tribits_deprecated("This is a deprecation message with" + " multiple message arguments") + unittest_compare_const( + MESSAGE_WRAPPER_INPUT + "DEPRECATION;This is a deprecation message with; multiple message arguments" + ) + message("Testing tribits_deprecated() with TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE set to empty string") set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE "") global_set(MESSAGE_WRAPPER_INPUT) @@ -4691,6 +4701,18 @@ function(unittest_tribits_deprecated_command) "DEPRECATION;TriBITS command 'tribits_another_deprecated_command' is deprecated.\n\nUse tribits_some_new_command instead." ) + message("Testing tribits_deprecated_command() with multiple MESSAGE arguments") + unset(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE) + global_set(MESSAGE_WRAPPER_INPUT) + tribits_deprecated_command(tribits_yet_another_deprecated_command + MESSAGE "This is a deprecation message with" + " multiple arguments." + ) + 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." + ) + endfunction() @@ -4791,4 +4813,4 @@ message("*** Determine final result of all unit tests") message("***\n") # Pass in the number of expected tests that must pass! -unittest_final_result(717) +unittest_final_result(719) diff --git a/tribits/core/package_arch/TribitsAddExecutable.cmake b/tribits/core/package_arch/TribitsAddExecutable.cmake index f08e7b78b..ec989628f 100644 --- a/tribits/core/package_arch/TribitsAddExecutable.cmake +++ b/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/tribits/core/package_arch/TribitsAddExecutableAndTest.cmake b/tribits/core/package_arch/TribitsAddExecutableAndTest.cmake index a82196b55..264c96d53 100644 --- a/tribits/core/package_arch/TribitsAddExecutableAndTest.cmake +++ b/tribits/core/package_arch/TribitsAddExecutableAndTest.cmake @@ -40,6 +40,7 @@ include(TribitsAddExecutable) include(TribitsAddTest) +include(TribitsDeprecatedHelpers) # @@ -207,6 +208,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 diff --git a/tribits/core/package_arch/TribitsAddLibrary.cmake b/tribits/core/package_arch/TribitsAddLibrary.cmake index 4bac9f943..6f7890a33 100644 --- a/tribits/core/package_arch/TribitsAddLibrary.cmake +++ b/tribits/core/package_arch/TribitsAddLibrary.cmake @@ -48,6 +48,7 @@ include(PrependGlobalSet) include(RemoveGlobalDuplicates) include(TribitsGeneralMacros) include(TribitsReportInvalidTribitsUsage) +include(TribitsDeprecatedHelpers) include(SetAndIncDirs) @@ -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/tribits/core/package_arch/TribitsGeneralMacros.cmake b/tribits/core/package_arch/TribitsGeneralMacros.cmake index 9fc855390..f510b40b5 100644 --- a/tribits/core/package_arch/TribitsGeneralMacros.cmake +++ b/tribits/core/package_arch/TribitsGeneralMacros.cmake @@ -42,6 +42,7 @@ include(AssertDefined) include(MessageWrapper) include(TribitsParseArgumentsHelpers) include(TribitsSortListAccordingToMasterList) +include(TribitsDeprecatedHelpers) # Optionally start CMake code configure timing @@ -337,9 +338,8 @@ 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() diff --git a/tribits/core/package_arch/TribitsIncludeDirectories.cmake b/tribits/core/package_arch/TribitsIncludeDirectories.cmake index 3f90fc873..f31da5dfb 100644 --- a/tribits/core/package_arch/TribitsIncludeDirectories.cmake +++ b/tribits/core/package_arch/TribitsIncludeDirectories.cmake @@ -38,6 +38,7 @@ # @HEADER include(CMakeParseArguments) +include(TribitsDeprecatedHelpers) # @MACRO: tribits_include_directories() @@ -89,7 +90,11 @@ endmacro() # Deprecated. Use tribits_include_directories() instead! macro(include_directories) - cmake_parse_arguments( + tribits_deprecated_command(include_directories + MESSAGE "Use tribits_include_directories() instead." + ) + + cmake_parse_arguments( #prefix PARSE #options @@ -101,11 +106,6 @@ 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) _include_directories(${PARSE_UNPARSED_ARGUMENTS}) endif() diff --git a/tribits/core/package_arch/TribitsListHelpers.cmake b/tribits/core/package_arch/TribitsListHelpers.cmake index 92184a252..69ade415d 100644 --- a/tribits/core/package_arch/TribitsListHelpers.cmake +++ b/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/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake b/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake index dd3f9a213..3ed4f3537 100644 --- a/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake +++ b/tribits/core/package_arch/TribitsSetUpEnabledOnlyDependencies.cmake @@ -37,6 +37,8 @@ # ************************************************************************ # @HEADER +include(TribitsDeprecatedHelpers) + # Function that creates enable-only dependency data-structures # @@ -63,8 +65,8 @@ function(tribits_set_up_enabled_only_dependencies) AND NOT "${${PROJECT_NAME}_GENERATE_EXPORT_FILES_FOR_ONLY_LISTED_SE_PACKAGES}" STREQUAL "" ) - message(DEPRECATION - "WARNING! The cache var" + 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" diff --git a/tribits/core/package_arch/TribitsTestCategories.cmake b/tribits/core/package_arch/TribitsTestCategories.cmake index c0058c9c7..acd55cee1 100644 --- a/tribits/core/package_arch/TribitsTestCategories.cmake +++ b/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/tribits/core/package_arch/TribitsTplDeclareLibraries.cmake b/tribits/core/package_arch/TribitsTplDeclareLibraries.cmake index 16e8bae9e..aa808d8e8 100644 --- a/tribits/core/package_arch/TribitsTplDeclareLibraries.cmake +++ b/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/tribits/core/utils/AppendStringVar.cmake b/tribits/core/utils/AppendStringVar.cmake index 9b4e553a1..dbd0c1fb5 100644 --- a/tribits/core/utils/AppendStringVar.cmake +++ b/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/tribits/core/utils/ParseVariableArguments.cmake b/tribits/core/utils/ParseVariableArguments.cmake index 92e1b060f..da2e58ad2 100644 --- a/tribits/core/utils/ParseVariableArguments.cmake +++ b/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/tribits/core/utils/TribitsDeprecatedHelpers.cmake b/tribits/core/utils/TribitsDeprecatedHelpers.cmake index 32931ba09..4dec816bf 100644 --- a/tribits/core/utils/TribitsDeprecatedHelpers.cmake +++ b/tribits/core/utils/TribitsDeprecatedHelpers.cmake @@ -70,13 +70,15 @@ set(TRIBITS_HANDLE_TRIBITS_DEPRECATED_CODE_ALL_VALID_VALUES # # tribits_deprecated() # -function(tribits_deprecated message) +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}" "${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}'") endif() @@ -96,11 +98,11 @@ endfunction() # function(tribits_deprecated_command name) # Parse input arguments - set(argOneValArgKeywords MESSAGE) + set(argMultiValArgKeywords MESSAGE) cmake_parse_arguments(PARSE_ARGV 1 PREFIX "" # options - "${argOneValArgKeywords}" # one_value_keywords - "" # multi_value_keywords + "" # one_value_keywords + "${argMultiValArgKeywords}" # multi_value_keywords ) tribits_check_for_unparsed_arguments(PREFIX)