diff options
author | Brad King <brad.king@kitware.com> | 2015-09-16 14:24:16 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-09-17 14:21:32 (GMT) |
commit | e134e53b47fc9f0337529ce2b6851cec6319a8af (patch) | |
tree | a712dc8248b379139ca900a531f7a37bddc44057 /Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake | |
parent | da00be6359055ffdb2067a9ec1e817eb782ad145 (diff) | |
download | CMake-e134e53b47fc9f0337529ce2b6851cec6319a8af.zip CMake-e134e53b47fc9f0337529ce2b6851cec6319a8af.tar.gz CMake-e134e53b47fc9f0337529ce2b6851cec6319a8af.tar.bz2 |
Add support for *.manifest source files with MSVC tools
Classify .manifest sources separately, add dependencies on them, and
pass them to the MS manifest tool to merge with linker-generated
manifest files.
Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
Diffstat (limited to 'Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake')
-rw-r--r-- | Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake b/Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake new file mode 100644 index 0000000..ef33012 --- /dev/null +++ b/Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake @@ -0,0 +1,19 @@ +enable_language(C) + +add_executable(main main.c ${CMAKE_CURRENT_BINARY_DIR}/test.manifest) + +if(MSVC AND NOT MSVC_VERSION LESS 1400) + set(EXTRA_CHECK [[ +file(STRINGS "$<TARGET_FILE:main>" content REGEX "name=\"Kitware.CMake.C-Exe-Manifest-step[0-9]\"") +if(NOT "${content}" MATCHES "name=\"Kitware.CMake.C-Exe-Manifest-step${check_step}\"") + set(RunCMake_TEST_FAILED "Binary has no manifest with name=\"Kitware.CMake.C-Exe-Manifest-step${check_step}\":\n ${content}") +endif() +]]) +endif() + +file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT " +set(check_pairs + \"$<TARGET_FILE:main>|${CMAKE_CURRENT_BINARY_DIR}/test.manifest\" + ) +${EXTRA_CHECK} +") |