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 <froda...@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@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