[CMake] automatically re-generating makefiles
Eric Noulard
eric.noulard at gmail.com
Tue Mar 17 16:15:21 EDT 2009
2009/3/17 Bill Hoffman <bill.hoffman at kitware.com>:
> Matthew Woehlke wrote:
>>
>> Bill Hoffman wrote:
>> AFAICT, right now the Makefile itself does not have any dependencies; it
>> seems that adding 'Makefile: <build system files>' with the rule from
>> cmake_check_build_system would fix the original problem. So the question is
>> if running cmake_check_build_system twice in a row can either be eliminated
>> or kept reasonable.
>>
> I still don't get the original problem??? We used to have Makefile: <build
> system files>. It was removed when that work was pushed into
> cmake_check_build_system.
The original problem was that when adding a NEW target "second" to an existing
CMakeLists.txt, if you use Unix Makefile generator directly hit:
make second, you get:
$ make second
make: *** Pas de règle pour fabriquer la cible « second ». Arrêt.
whereas if you do enter, make you get:
$ make
-- Configuring done
-- Generating done
-- Build files have been written to: /home/eric/Test/bb
[ 50%] Built target first
Scanning dependencies of target second
[100%] Building C object CMakeFiles/second.dir/second.c.o
Linking C executable second
[100%] Built target second
Thus the "cmake_check_build_system" is not triggered by the
make second
You'll find a sample project attach.
1) configure it
2) build it using "make"
3) edit CMakeLists.txt and uncomment the "second" ADD_EXECUTABLE
4) make second
--
Erk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample.zip
Type: application/zip
Size: 766 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090317/18d47c54/attachment.zip>
More information about the CMake
mailing list