Merge topic 'fix-13392-nmake-empty-depends-problem'
7ae7d66 NMake: Fix problem with empty DEPENDS args (#13392) 078e35d NMake: Add a test to demonstrate EmptyDepends issue (#13392)
This commit is contained in:
commit
9c48fc7213
@ -1875,6 +1875,14 @@ bool cmLocalGenerator::GetRealDependency(const char* inName,
|
|||||||
// modify the name so stripping down to just the file name should
|
// modify the name so stripping down to just the file name should
|
||||||
// produce the target name in this case.
|
// produce the target name in this case.
|
||||||
std::string name = cmSystemTools::GetFilenameName(inName);
|
std::string name = cmSystemTools::GetFilenameName(inName);
|
||||||
|
|
||||||
|
// If the input name is the empty string, there is no real
|
||||||
|
// dependency. Short-circuit the other checks:
|
||||||
|
if(name == "")
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if(cmSystemTools::GetFilenameLastExtension(name) == ".exe")
|
if(cmSystemTools::GetFilenameLastExtension(name) == ".exe")
|
||||||
{
|
{
|
||||||
name = cmSystemTools::GetFilenameWithoutLastExtension(name);
|
name = cmSystemTools::GetFilenameWithoutLastExtension(name);
|
||||||
|
@ -573,6 +573,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
|
|||||||
)
|
)
|
||||||
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand")
|
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand")
|
||||||
|
|
||||||
|
ADD_TEST_MACRO(EmptyDepends ${CMAKE_CTEST_COMMAND})
|
||||||
|
|
||||||
add_test(CustomCommandWorkingDirectory ${CMAKE_CTEST_COMMAND}
|
add_test(CustomCommandWorkingDirectory ${CMAKE_CTEST_COMMAND}
|
||||||
--build-and-test
|
--build-and-test
|
||||||
"${CMake_SOURCE_DIR}/Tests/CustomCommandWorkingDirectory"
|
"${CMake_SOURCE_DIR}/Tests/CustomCommandWorkingDirectory"
|
||||||
|
15
Tests/EmptyDepends/CMakeLists.txt
Normal file
15
Tests/EmptyDepends/CMakeLists.txt
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
cmake_minimum_required(VERSION 2.8)
|
||||||
|
project(EmptyDepends)
|
||||||
|
|
||||||
|
include(CTest)
|
||||||
|
|
||||||
|
set(extra_dep)
|
||||||
|
|
||||||
|
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/qrc_my.cxx
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_BINARY_DIR}/qrc_my.cxx"
|
||||||
|
DEPENDS "${extra_dep}" "${CMAKE_BINARY_DIR}/my.qrc")
|
||||||
|
|
||||||
|
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/my.qrc
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_BINARY_DIR}/my.qrc)
|
||||||
|
|
||||||
|
add_library(qrc SHARED ${CMAKE_BINARY_DIR}/qrc_my.cxx)
|
Loading…
x
Reference in New Issue
Block a user