View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015992CMakeCMakepublic2016-02-27 00:112016-06-10 14:31
ReporterRodger Combs 
Assigned ToGregor Jasny 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product VersionCMake 3.4.3 
Target VersionFixed in Version 
Summary0015992: Xcode generator's ReRunCMake.make fails if dependencies have been deleted
DescriptionCurrently, if a file that a CMake script previously had a dependency on is deleted, the Xcode generator's ReRunCMake.make Makefile will fail with a "no rule to make target <…>" error. This happens pretty frequently if you have a CMake script that reads the ref file for your current git branch and you delete branches regularly, and can also happen if you make other build system changes.

This can be solved by wrapping each item in the list with `$(wildcard <path>)`, which effectively makes the dependencies optional.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0040569)
Gregor Jasny (developer)
2016-02-28 11:36

I pushed the xcode-regenerate-on-deleted-files into next.
(0040570)
Gregor Jasny (developer)
2016-02-28 11:37

Rodger: Thanks for the helpful hint about the wildcard function
(0040574)
Gregor Jasny (developer)
2016-02-29 03:32

Had to revert the change because $(wildcard ) cannot properly handle white spaces in paths:

Example:
before: file\ name.txt
    @echo Re-generating $@
    @touch $@

after: $(wildcard file\ name.txt)
    @echo Re-generating $@
    @touch $@


Any ideas?
(0040575)
Gregor Jasny (developer)
2016-02-29 03:37

I could think of of re-writing the whole up-to-date check in POSIX Shell instead of make.
(0040576)
Rodger Combs (reporter)
2016-02-29 04:04

This isn't pretty, since Make generally doesn't support spaces in filenames, but I got a hack to work:

empty:=
space:= $(empty) $(empty)
spaceplus:= $(empty)\ $(empty)
TARGETS += $(subst $(space),$(spaceplus),$(wildcard file\ name.txt))

define RULE
after: $(TARGETS)
    @echo Re-generating $$@ from $$<
    @touch $$@
endef

$(eval $(RULE))
(0040598)
Gregor Jasny (developer)
2016-03-06 12:25

Thanks for the pretty helpful example code. Why do we need the extra indirection via the evaluated RULE? If I just keep the TARGETS += magic it seems to work, too. Am I missing something?
(0040657)
Gregor Jasny (developer)
2016-03-09 14:35

Next attempt is merged into next.
(0042946)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2016-02-27 00:11 Rodger Combs New Issue
2016-02-27 14:12 Gregor Jasny Assigned To => Gregor Jasny
2016-02-27 14:12 Gregor Jasny Status new => assigned
2016-02-28 11:36 Gregor Jasny Note Added: 0040569
2016-02-28 11:37 Gregor Jasny Note Added: 0040570
2016-02-29 03:32 Gregor Jasny Note Added: 0040574
2016-02-29 03:37 Gregor Jasny Note Added: 0040575
2016-02-29 04:04 Rodger Combs Note Added: 0040576
2016-03-06 12:25 Gregor Jasny Note Added: 0040598
2016-03-09 14:35 Gregor Jasny Note Added: 0040657
2016-06-10 14:29 Kitware Robot Note Added: 0042946
2016-06-10 14:29 Kitware Robot Status assigned => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team