[Cmake] GNU Makefile dependencies unnecessarily restrict make -k

Bill Hoffman bill.hoffman at kitware.com
Fri Apr 18 14:28:59 EDT 2003


The test is there so that if you add a new subdir in CMakeLists.txt file
and do not run cmake from the top again, running make will not fail.
There is no way for cmake to know if gnu make or some other system make
is being used, so gnu makeisms can not be in the Makefiles.

However, what we do is make -i, which will let the process continue
even with errors.

-Bill


At 11:25 AM 4/18/2003, Wheeler, Frederick W (Research) wrote:

>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
>_______________________________________________
>Cmake mailing list
>Cmake at public.kitware.com
>http://public.kitware.com/mailman/listinfo/cmake 






More information about the CMake mailing list