[Cmake] GNU Makefile dependencies unnecessarily restrict make -k

Wheeler, Frederick W (Research) wheeler at crd.ge.com
Fri Apr 18 11:25:38 EDT 2003


It looks to me like cmake is creating Makefile stanzas that have unneeded
dependencies, which causes "make -k" to not work as it should.

Example: In the VXL project, the core/vul directory has 2 subdirs: examples
and tests whose builds are independent.  Nothing in examples depends on
anything in tests, and vice versa.  However, the GNU Makefile produced by
CMake has this stanza.


default_target_tests: $(TARGETS) default_target_examples
	@if test ! -d /home/wheeler/work_vxl/vxl_bld_cyg/core/vul/tests;
then $(MAKE) rebuild_cache; fi
	echo /home/wheeler/work_vxl/vxl_bld_cyg/core/vul/tests: building
default_target
	@cd /home/wheeler/work_vxl/vxl_bld_cyg/core/vul/tests; $(MAKE)
default_target


It says that default_target_tests depends on default_target_examples, but
why?

This causes problems when using the "-k" option to "make".  If there is a
problem building in the examples directory, it would be nice to still go
ahead and build the tests directory, if you used the -k option.

By removing the "default_target_examples" from the stanza above I was able
to verify correct behavior of "make -k".  However, I also added this line...

.PHONY: default_target_tests

I think cmake should add .PHONY: lines like this for all targets that are
not actual files when generating gnu makefiles.

I'm using the latest cmake cygwin package.



Regards,
Fred Wheeler



More information about the CMake mailing list