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@i7-lab:~/temp/bldlibvnc$ make -q CMakeFiles/vncserver.dir/libvncserver/zrleoutstream.c.o zzz@i7-lab:~/temp/bldlibvnc$ echo $? 0 zzz@i7-lab:~/temp/bldlibvnc$ make -q zzz@i7-lab:~/temp/bldlibvnc$ echo $? 1 OR zzz@i7-lab:~/temp/bldlibvnc$ make -q vncclient zzz@i7-lab:~/temp/bldlibvnc$ echo $? 1 zzz@i7-lab:~/temp/bldlibvnc$ make -q libvncclient.so zzz@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.tzon...@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 >
-- 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