Commit 21f5ed80 authored by Brad King's avatar Brad King Committed by Kitware Robot

Merge topic 'use_additional_clean_files'

eda39636 UseSWIG: Use ADDITIONAL_CLEAN_FILES for cleaning
8c47be28 UseJava: Use ADDITIONAL_CLEAN_FILES for cleaning
ac86c02d UseEcos: Use ADDITIONAL_CLEAN_FILES for cleaning
2532e003 FindDoxygen: Use ADDITIONAL_CLEAN_FILES for cleaning
4edc0ef3 Test: Improve WarnUnusedCliUnused to run on all generators
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !3328
parents acc2f022 eda39636
......@@ -974,7 +974,7 @@ doxygen_add_docs() for target ${targetName}")
"${DOXYGEN_OUTPUT_DIRECTORY}/${DOXYGEN_HTML_OUTPUT}")
endif()
set_property(DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES "${_args_clean_html_dir}")
ADDITIONAL_CLEAN_FILES "${_args_clean_html_dir}")
endif()
# Build up a list of files we can identify from the inputs so we can list
......
......@@ -214,10 +214,10 @@ macro(ECOS_ADD_EXECUTABLE _exe_NAME )
)
#add the created files to the clean-files
set_directory_properties(
PROPERTIES
ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.bin;${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.srec;${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst;"
)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES
"${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.bin"
"${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.srec"
"${CMAKE_CURRENT_BINARY_DIR}/${_exe_NAME}.lst")
add_custom_target(ecosclean ${CMAKE_COMMAND} -DECOS_DIR=${CMAKE_CURRENT_BINARY_DIR}/ecos/ -P ${ECOS_CMAKE_MODULE_DIR}/ecos_clean.cmake )
add_custom_target(normalclean ${CMAKE_MAKE_PROGRAM} clean WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
......
......@@ -735,7 +735,8 @@ function(add_jar _TARGET_NAME)
# this INTERFACE library depends on jar generation
add_dependencies (${_GENERATE_NATIVE_HEADERS_TARGET} ${_TARGET_NAME})
set_property (DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}")
set_property (DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES
"${_GENERATE_NATIVE_HEADERS_OUTPUT_DIR}")
endif()
endfunction()
......
......@@ -708,9 +708,9 @@ function(SWIG_ADD_LIBRARY name)
endif()
endforeach()
set_property (DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES ${swig_generated_sources} ${swig_generated_timestamps})
ADDITIONAL_CLEAN_FILES ${swig_generated_sources} ${swig_generated_timestamps})
if (UseSWIG_MODULE_VERSION VERSION_GREATER 1)
set_property (DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${outputdir}")
set_property (DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES "${outputdir}")
endif()
add_library(${target_name}
......
......@@ -2525,24 +2525,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
FAIL_REGULAR_EXPRESSION "CMakeLists.txt:5 \\(set\\):")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset")
if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND NOT WIN32)
# Ninja does not support ADDITIONAL_MAKE_CLEAN_FILES and therefore fails
# this test. (See #13371)
# Apparently Visual Studio does not support it either. As the MakeClean
# test above is only run with the Makefiles generator, only run this
# test with the Makefiles generator also.
add_test(WarnUnusedCliUnused ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/WarnUnusedCliUnused"
"${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused"
${build_generator_args}
--build-project WarnUnusedCliUnused
--build-options ${build_options}
"-DUNUSED_CLI_VARIABLE=Unused")
set_tests_properties(WarnUnusedCliUnused PROPERTIES
PASS_REGULAR_EXPRESSION "CMake Warning:.*Manually-specified variables were not used by the project:.* UNUSED_CLI_VARIABLE")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused")
endif()
add_test(WarnUnusedCliUnused ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/WarnUnusedCliUnused"
"${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused"
${build_generator_args}
--build-project WarnUnusedCliUnused
--build-options ${build_options}
"-DUNUSED_CLI_VARIABLE=Unused")
set_tests_properties(WarnUnusedCliUnused PROPERTIES
PASS_REGULAR_EXPRESSION "CMake Warning:.*Manually-specified variables were not used by the project:.* UNUSED_CLI_VARIABLE")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused")
add_test(WarnUnusedCliUsed ${CMAKE_CTEST_COMMAND}
--build-and-test
......
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.14)
project(WarnUnusedCliUnused)
set_directory_properties(PROPERTIES
ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_BINARY_DIR}/CMakeCache.txt"
)
# Remove UNUSED_CLI_VARIABLE from the cache to trigger the
# CMake warning message on re-builds as well.
unset(UNUSED_CLI_VARIABLE CACHE)
add_library(dummy empty.cpp)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment