GetPrerequisites outputs lots of warnings when used with Windows UCRT if recursive parameter is 0
Example CMakeLists.txt
:
cmake_minimum_required(VERSION 3.8)
project(foo)
set(CPP_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/foo.cpp")
file(WRITE "${CPP_FILENAME}" "int main() {}")
add_executable(foo "${CPP_FILENAME}")
set(SCRIPT_FILENAME "${CMAKE_CURRENT_BINARY_DIR}/dependencies-$<CONFIG>.cmake")
file(GENERATE OUTPUT "${SCRIPT_FILENAME}" CONTENT "
include(GetPrerequisites)
get_prerequisites(\"$<TARGET_FILE:foo>\" PREREQUISITES 1 0 \"\" \"\")
message(STATUS \"Prerequisites: \\\"\${PREREQUISITES}\\\"\")
")
add_custom_command(TARGET foo POST_BUILD COMMAND "${CMAKE_COMMAND}" -P "${SCRIPT_FILENAME}")
Output:
λ mkdir build && cd build && cmake --version && cmake .. && cmake --build . --config Release -- /v:m /nologo
cmake version 3.9.0-rc3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
-- Building for: Visual Studio 14 2015
-- The C compiler identification is MSVC 19.0.24215.1
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/mfischer/src/videmo/cmake-bug/build
Checking Build System
CMake does not need to re-run because C:/Users/mfischer/src/videmo/cmake-bug/build/CMakeFiles/generate.stamp is up-to-date.
Building Custom Rule C:/Users/mfischer/src/videmo/cmake-bug/CMakeLists.txt
CMake does not need to re-run because C:/Users/mfischer/src/videmo/cmake-bug/build/CMakeFiles/generate.stamp is up-to-date.
foo.cpp
foo.vcxproj -> C:\Users\mfischer\src\videmo\cmake-bug\build\Release\foo.exe
--
EXEC : warning : cannot resolve item 'api-ms-win-crt-runtime-l1-1-0.dll' [C:\Users\mfischer\src\videmo\cmake-bug\build\foo.vcxproj]
possible problems:
need more directories?
need to use InstallRequiredSystemLibraries?
run in install tree instead of build tree?
EXEC : -- warning : gp_resolved_file_type non-absolute file 'api-ms-win-crt-runtime-l1-1-0.dll' returning type 'system' -- possibly incorrect [C:\Users\mfischer\src\videmo\cmake-bug\build\foo.vcxproj]
--
EXEC : warning : cannot resolve item 'api-ms-win-crt-math-l1-1-0.dll' [C:\Users\mfischer\src\videmo\cmake-bug\build\foo.vcxproj]
possible problems:
need more directories?
need to use InstallRequiredSystemLibraries?
run in install tree instead of build tree?
EXEC : -- warning : gp_resolved_file_type non-absolute file 'api-ms-win-crt-math-l1-1-0.dll' returning type 'system' -- possibly incorrect [C:\Users\mfischer\src\videmo\cmake-bug\build\foo.vcxproj]
--
EXEC : warning : cannot resolve item 'api-ms-win-crt-stdio-l1-1-0.dll' [C:\Users\mfischer\src\videmo\cmake-bug\build\foo.vcxproj]
possible problems:
need more directories?
need to use InstallRequiredSystemLibraries?
run in install tree instead of build tree?
EXEC : -- warning : gp_resolved_file_type non-absolute file 'api-ms-win-crt-stdio-l1-1-0.dll' returning type 'system' -- possibly incorrect [C:\Users\mfischer\src\videmo\cmake-bug\build\foo.vcxproj]
--
EXEC : warning : cannot resolve item 'api-ms-win-crt-locale-l1-1-0.dll' [C:\Users\mfischer\src\videmo\cmake-bug\build\foo.vcxproj]
possible problems:
need more directories?
need to use InstallRequiredSystemLibraries?
run in install tree instead of build tree?
EXEC : -- warning : gp_resolved_file_type non-absolute file 'api-ms-win-crt-locale-l1-1-0.dll' returning type 'system' -- possibly incorrect [C:\Users\mfischer\src\videmo\cmake-bug\build\foo.vcxproj]
--
EXEC : warning : cannot resolve item 'api-ms-win-crt-heap-l1-1-0.dll' [C:\Users\mfischer\src\videmo\cmake-bug\build\foo.vcxproj]
possible problems:
need more directories?
need to use InstallRequiredSystemLibraries?
run in install tree instead of build tree?
EXEC : -- warning : gp_resolved_file_type non-absolute file 'api-ms-win-crt-heap-l1-1-0.dll' returning type 'system' -- possibly incorrect [C:\Users\mfischer\src\videmo\cmake-bug\build\foo.vcxproj]
-- Prerequisites: ""
Building Custom Rule C:/Users/mfischer/src/videmo/cmake-bug/CMakeLists.txt
CMake does not need to re-run because C:/Users/mfischer/src/videmo/cmake-bug/build/CMakeFiles/generate.stamp is up-to-date.