On 3/8/2012 9:38 PM, Peter Collingbourne wrote:
I did an exact search for that string:

http://www.google.co.uk/search?sourceid=chrome&ie=UTF-8&q=%22if(CMAKE_GENERATOR+MATCHES+Makefiles%22

and received only 36 hits, most of which seem to be matching
CMake's own code, which we can certainly change if necessary.

This search has 5400:

http://www.google.com/search?q=%22IF%28CMAKE_GENERATOR+MATCHES+%22Makefiles%22%22&hl=en&prmd=imvns&ei=j3BZT4u2FejjsQLsqumTAQ&start=10&sa=N&biw=1452&bih=593

Many do come from cmake, but here is one from a notable project:

http://lists.mysql.com/commits/119783


However, I am somewhat persuaded by your argument here:

2) If we go with your suggestion, things will continue to work if what
   the project does for Make happens to also be appropriate for Ninja.
   But that isn't always the case -- if the project cares about
   which generator is being used then it may well be doing something
   specific to the Makefile generator (such as relying on the fact
   that CMake builds recursive makefiles by running the build program
   in a subdirectory, or using "$(MAKE)" -- you can see an example
   of that in ExternalProject.cmake).  In that case things would break
   unless the conditional excludes Ninja:

   IF(CMAKE_GENERATOR MATCHES "Makefiles" AND NOT CMAKE_GENERATOR MATCHES 
"Ninja")

The external project is a good anti-example for doing this approach.


-Bill
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to