ITK CMake Style: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
(New page: I propose the following, starting with Version 4.0 (since this will break backward compatibility of cmake files and user options): # There is one cmake var that controls all features in t...)
 
No edit summary
Line 5: Line 5:
#* If it is on, then all options within Code/Review are enabled.
#* If it is on, then all options within Code/Review are enabled.
#* Default value is OFF
#* Default value is OFF
# Individual options offered in Code/Review and that CHANGE the current behavior of ITK may also have a CMake var that can be turn on to enable just that feature
# Individual options offered in Code/Review and that CHANGE the current behavior of ITK may also have a CMake var that can be turn on to enable just that feature
#* If the feature only EXTENDS ITK's functionality, there is no need to create a cmake var for it - those Extensions are discussed below.
#* If the feature only EXTENDS ITK's functionality, there is no need to create a cmake var for it - those Extensions are discussed below.
Line 12: Line 11:
#* if ITK_USE_REVIEW is off, then these options are built if their individual vars are turned on
#* if ITK_USE_REVIEW is off, then these options are built if their individual vars are turned on
#* Default value is OFF for all such vars
#* Default value is OFF for all such vars
# Code/Review options that EXTEND the current behavior of ITK's are grouped into a single CMake var call ITK_REVIEW_EXTENSIONS
# Code/Review options that EXTEND the current behavior of ITK's are grouped into a single CMake var call ITK_REVIEW_EXTENSIONS
#* This is an advanced var
#* This is an advanced var
Line 18: Line 16:
#* if ITK_USE_REVIEW is off, then these options are built if their individual vars are turned on
#* if ITK_USE_REVIEW is off, then these options are built if their individual vars are turned on
#* Default value is OFF for this var
#* Default value is OFF for this var
# Once options move from Review into ITK proper, their individual cmake vars go away.
# Once options move from Review into ITK proper, their individual cmake vars go away.
# All options that require external packages will be listed as ITK_USE_<PACKAGE_NAME>  (e.g., ITK_USE_FFTW)
# All options that require external packages will be listed as ITK_USE_<PACKAGE_NAME>  (e.g., ITK_USE_FFTW)
#* Such cmake vars are Advanced vars (hidden unless advance option in cmake is selected)
#* Such cmake vars are Advanced vars (hidden unless advance option in cmake is selected)
#* Default value is OFF
#* Default value is OFF
# Add options specific to an external package must be lists as ITK_<PACKAGE_NAME>_VAR (e.g., ITK_FFTW_USE_GPU) or as <PACKAGE_NAME>_VAR (e.g., FFTW_USE_GPU) and be marked as advanced.
# Add options specific to an external package must be lists as ITK_<PACKAGE_NAME>_VAR (e.g., ITK_FFTW_USE_GPU) or as <PACKAGE_NAME>_VAR (e.g., FFTW_USE_GPU) and be marked as advanced.
 
# CMake vars are considered to be "expensive" to add, use, and maintain.  That is, they should not be added unless absolutely necessary
# CMake vars are considered to be "expensive" to add and maintain.  That is, they should not be added unless absolutely necessary

Revision as of 14:18, 24 August 2008

I propose the following, starting with Version 4.0 (since this will break backward compatibility of cmake files and user options):

  1. There is one cmake var that controls all features in the review directory ITK_USE_REVIEW
    • It should be a standard (not an advanced) cmake var (you should see it even without turning on advanced option in cmake)
    • If it is on, then all options within Code/Review are enabled.
    • Default value is OFF
  2. Individual options offered in Code/Review and that CHANGE the current behavior of ITK may also have a CMake var that can be turn on to enable just that feature
    • If the feature only EXTENDS ITK's functionality, there is no need to create a cmake var for it - those Extensions are discussed below.
    • Variable names should begin with ITK_REVIEW (e.g., ITK_REVIEW_OPTIMIZED_REGISTRATION_METHODS)
    • If ITK_USE_REVIEW is on, then these options are built regardless of their individual var setting
    • if ITK_USE_REVIEW is off, then these options are built if their individual vars are turned on
    • Default value is OFF for all such vars
  3. Code/Review options that EXTEND the current behavior of ITK's are grouped into a single CMake var call ITK_REVIEW_EXTENSIONS
    • This is an advanced var
    • If ITK_USE_REVIEW is on, then these options are built regardless of their individual var setting
    • if ITK_USE_REVIEW is off, then these options are built if their individual vars are turned on
    • Default value is OFF for this var
  4. Once options move from Review into ITK proper, their individual cmake vars go away.
  5. All options that require external packages will be listed as ITK_USE_<PACKAGE_NAME> (e.g., ITK_USE_FFTW)
    • Such cmake vars are Advanced vars (hidden unless advance option in cmake is selected)
    • Default value is OFF
  6. Add options specific to an external package must be lists as ITK_<PACKAGE_NAME>_VAR (e.g., ITK_FFTW_USE_GPU) or as <PACKAGE_NAME>_VAR (e.g., FFTW_USE_GPU) and be marked as advanced.
  7. CMake vars are considered to be "expensive" to add, use, and maintain. That is, they should not be added unless absolutely necessary