Robert Maynard wrote:

> * The "CodeLite" generator gained a new "CMAKE_CODELITE_USE_TARGETS"
> option to change project creation from projects to targets.


Something that I have often noticed (and which causes problems) in my 
refactoring is that per-directory variable definitions are used when they 
are not appropriate or intended. 

This causes problems because now the code has to read the value for each 
directory and can't assume that the value is always the same as the value 
from the top-level CMakeLists file. It adds complexity to the code which 
could otherwise be removed.

In some cases (language-specific definitions) the definition may not be 
defined in the top level due to an enable_language() in a subdirectory. As 
far as I know, in other sibling directories the language can still be used, 
so the variable definitions are telling an inconsistent story in that case. 
Perhaps enable_language should only be allowed in the top-level.

This CodeLite variable looks like an example of this misuse of variable 
definitions too. It is read via cmMakefile::IsOn. That means that different 
directories can set it to different values, which is probably not the 
intention of the author of the feature, and it means that that (probably 
broken) behavior needs to be preserved.

Does CMake need a 'better answer' to the question of 'how to add features 
like this to CMake'? 

Is the answer 'Use global properties or a cache variable instead'?

Thanks,

Steve.


-- 

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:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to