aboutsummaryrefslogtreecommitdiff
path: root/modules/ECMOptionalAddSubdirectory.cmake
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2011-09-17 13:19:45 -0400
committerAllen Winter <allen.winter@kdab.com>2011-09-17 13:19:45 -0400
commitbf2ecfb4211eab489fca88d3149dcd75bfdc595e (patch)
tree6f7530f28c17f304a4ed4a9c8d62b1a3686a5c15 /modules/ECMOptionalAddSubdirectory.cmake
parent0eb0e68dbfbae9591f060ba9d90cc9a690e1fe26 (diff)
downloadextra-cmake-modules-bf2ecfb4211eab489fca88d3149dcd75bfdc595e.tar.gz
extra-cmake-modules-bf2ecfb4211eab489fca88d3149dcd75bfdc595e.tar.bz2
a bit of cleaning using cmakelint.py
Diffstat (limited to 'modules/ECMOptionalAddSubdirectory.cmake')
-rw-r--r--modules/ECMOptionalAddSubdirectory.cmake34
1 files changed, 17 insertions, 17 deletions
diff --git a/modules/ECMOptionalAddSubdirectory.cmake b/modules/ECMOptionalAddSubdirectory.cmake
index 192d1f4b..ef6592a0 100644
--- a/modules/ECMOptionalAddSubdirectory.cmake
+++ b/modules/ECMOptionalAddSubdirectory.cmake
@@ -1,5 +1,5 @@
# - ECM_OPTIONAL_ADD_SUBDIRECTORY() combines ADD_SUBDIRECTORY() with an OPTION()
-# ECM_OPTIONAL_ADD_SUBDIRECTORY( <dir> )
+# ECM_OPTIONAL_ADD_SUBDIRECTORY(<dir>)
# If you use ECM_OPTIONAL_ADD_SUBDIRECTORY() instead of ADD_SUBDIRECTORY(),
# this will have two effects
# 1 - CMake will not complain if the directory doesn't exist
@@ -22,20 +22,20 @@
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-function(ECM_OPTIONAL_ADD_SUBDIRECTORY _dir )
- get_filename_component(_fullPath ${_dir} ABSOLUTE)
- if(EXISTS ${_fullPath}/CMakeLists.txt)
- if(DISABLE_ALL_OPTIONAL_SUBDIRECTORIES)
- set(_DEFAULT_OPTION_VALUE FALSE)
- else()
- set(_DEFAULT_OPTION_VALUE TRUE)
- endif()
- if(DISABLE_ALL_OPTIONAL_SUBDIRS AND NOT DEFINED BUILD_${_dir})
- set(_DEFAULT_OPTION_VALUE FALSE)
- endif()
- option(BUILD_${_dir} "Build directory ${_dir}" ${_DEFAULT_OPTION_VALUE})
- if(BUILD_${_dir})
- add_subdirectory(${_dir})
- endif()
- endif()
+function(ECM_OPTIONAL_ADD_SUBDIRECTORY _dir)
+ get_filename_component(_fullPath ${_dir} ABSOLUTE)
+ if(EXISTS ${_fullPath}/CMakeLists.txt)
+ if(DISABLE_ALL_OPTIONAL_SUBDIRECTORIES)
+ set(_DEFAULT_OPTION_VALUE FALSE)
+ else()
+ set(_DEFAULT_OPTION_VALUE TRUE)
+ endif()
+ if(DISABLE_ALL_OPTIONAL_SUBDIRS AND NOT DEFINED BUILD_${_dir})
+ set(_DEFAULT_OPTION_VALUE FALSE)
+ endif()
+ option(BUILD_${_dir} "Build directory ${_dir}" ${_DEFAULT_OPTION_VALUE})
+ if(BUILD_${_dir})
+ add_subdirectory(${_dir})
+ endif()
+ endif()
endfunction()