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

frodak frodak17 at gmail.com
Tue Nov 27 15:06:13 EST 2018


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/9f0ac596/attachment-0001.html>


More information about the CMake mailing list