Documentation/4.1/Developers/Style Guide/CMake

From Slicer Wiki
Revision as of 04:24, 22 June 2012 by Finetjul (talk | contribs) (Created page with '__TOC__ = Naming = # Macros/functions should be lower case and words separated with underscores #: <code>include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Logic)</code> not <code>…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Home < Documentation < 4.1 < Developers < Style Guide < CMake

Contents

Naming

  1. Macros/functions should be lower case and words separated with underscores
    include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Logic) not INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Logic)
    find_package(VTK REQUIRED) not FIND_PACKAGE(VTK REQUIRED) nor Find_Package(VTK REQUIRED)
  2. Global variables are uppercase and words separated with underscores
    CMAKE_CURRENT_SOURCE_DIR not cmake_current_source_dir
  3. Local variables are lowercase and words separated with underscores
    foreach(file ${FILES_TO_CONFIGURE})... not foreach(FILE ${FILES_TO_CONFIGURE})...