On Tue, Nov 13, 2018 at 11:36:24 +0100, Eric Noulard wrote:
> > My personal tendency is to use lower case for local variables and upper
> > case for global variables. May be we can normalize variables to upper case
> > regarding global variables used by CMake itself (which is globally the
> > current rule).
> 
> Having a convention for local is nice and I tend to prefix with _ (single
> or double) variables that should be local.
> lowercasing locals is fine too, however I think that enforcing casing on
> "user-defined" variable may not be desirable, concerning CMAKE_ CTEST_ and
> CPACK_
> I guess they already are all UPPERCASE so we may stick with this as a
> convention?

My personal style is to use lowercase for derived or internal variables
(and properties). Uppercase is left for environment (e.g., CMake) or
user variables. Note that CMake also defines some un-namespaced
variables including:

  - BUILD_SHARED_LIBS
  - BUILD_TESTING
  - many CTest variables (*_COMMAND, DART_TESTING_TIMEOUT, etc.)

--Ben
-- 

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-developers

Reply via email to