[CMake] Does CMake support the --question option for GNU Makefiles?

Alex Tzonkov alex.tzonkov at gmail.com
Tue Nov 27 22:12:15 EST 2018


Thanks for the quick response it makes more sense now. Looking at our CMake
files, I see now that all our targets are indeed PHONY, because we use
*add_custom_target
*to create those targets. So no matter what they are always considered out
of date. For now I'll have to assume that whoever wrote the CMake files had
a good reason for doing that. Is that considered a recommend way to set up
a project, or perhaps each and every project is unique so it does not make
sense to even have a recommendation?

On Tue, Nov 27, 2018 at 12:06 PM frodak <frodak17 at gmail.com> wrote:

> I think this is just a misunderstanding and not related to CMake.
>
> Make --question mode always returns a 1 if the target is PHONY because
> these targets are always out of date.
> The Makefiles generated by CMake use a top level PHONY target (and other
> PHONY targets as well)
>
> zzz at i7-lab:~/temp/bldlibvnc$ make -q
> CMakeFiles/vncserver.dir/libvncserver/zrleoutstream.c.o
> zzz at i7-lab:~/temp/bldlibvnc$ echo $?
> 0
> zzz at i7-lab:~/temp/bldlibvnc$ make -q
> zzz at i7-lab:~/temp/bldlibvnc$ echo $?
> 1
>
> OR
>
> zzz at i7-lab:~/temp/bldlibvnc$ make -q vncclient
> zzz at i7-lab:~/temp/bldlibvnc$ echo $?
> 1
> zzz at i7-lab:~/temp/bldlibvnc$ make -q libvncclient.so
> zzz at i7-lab:~/temp/bldlibvnc$ echo $?
> 0
>
> So you'll need to discern the actual target you want to check.
>
> Best regards...
>
> On Tue, Nov 27, 2018 at 11:51 AM Alex Tzonkov <alex.tzonkov at gmail.com>
> wrote:
>
>> We are using cmake for our project and recently discovered that the
>> generated Makefiles do not seem to work correctly with the '--question' or
>> '-q' option. The return code is always '1' even if there are no changes
>> which would require rebuilding/recompiling anything. I am not sure if this
>> is an issue with our CmakeLists.txt files or *.cmake files or a general
>> issue with cmake. Any pointers would be greatly appreciated.
>>
>> I apologize if this is an answered question, I tried really hard to
>> search the archives, but searching for "--question" is futile, as the
>> searches return pretty much every question.
>>
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more
>> information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> https://cmake.org/mailman/listinfo/cmake
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20181127/3e7fb5ca/attachment.html>


More information about the CMake mailing list