diff options
author | Hans Johnson <hans.j.johnson@gmail.com> | 2019-10-31 11:36:37 -0500 |
---|---|---|
committer | Hans Johnson <hans.j.johnson@gmail.com> | 2019-10-31 11:36:37 -0500 |
commit | 8c8cab1afdc325dfe0a3c1ad805014ea4010e208 (patch) | |
tree | 65946d241f9e757a0f745832e35fba9d44c193c9 /bench/btl/cmake/MacroOptionalAddSubdirectory.cmake | |
parent | 6fb3e5f1767855bc1a8aa3c868bc7fbf0eeb67ef (diff) |
STYLE: Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands. Later command names
became case-insensitive. Now the preferred style is lower-case.
Diffstat (limited to 'bench/btl/cmake/MacroOptionalAddSubdirectory.cmake')
-rw-r--r-- | bench/btl/cmake/MacroOptionalAddSubdirectory.cmake | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/bench/btl/cmake/MacroOptionalAddSubdirectory.cmake b/bench/btl/cmake/MacroOptionalAddSubdirectory.cmake index 545048b68..8d46fcea2 100644 --- a/bench/btl/cmake/MacroOptionalAddSubdirectory.cmake +++ b/bench/btl/cmake/MacroOptionalAddSubdirectory.cmake @@ -1,6 +1,6 @@ -# - MACRO_OPTIONAL_ADD_SUBDIRECTORY() combines ADD_SUBDIRECTORY() with an OPTION() +# - MACRO_OPTIONAL_ADD_SUBDIRECTORY() combines add_subdirectory() with an option() # MACRO_OPTIONAL_ADD_SUBDIRECTORY( <dir> ) -# If you use MACRO_OPTIONAL_ADD_SUBDIRECTORY() instead of ADD_SUBDIRECTORY(), +# If you use MACRO_OPTIONAL_ADD_SUBDIRECTORY() instead of add_subdirectory(), # this will have two effects # 1 - CMake will not complain if the directory doesn't exist # This makes sense if you want to distribute just one of the subdirs @@ -16,16 +16,16 @@ # For details see the accompanying COPYING-CMAKE-SCRIPTS file. -MACRO (MACRO_OPTIONAL_ADD_SUBDIRECTORY _dir ) - GET_FILENAME_COMPONENT(_fullPath ${_dir} ABSOLUTE) - IF(EXISTS ${_fullPath}) - IF(${ARGC} EQUAL 2) - OPTION(BUILD_${_dir} "Build directory ${_dir}" ${ARGV1}) - ELSE(${ARGC} EQUAL 2) - OPTION(BUILD_${_dir} "Build directory ${_dir}" TRUE) - ENDIF(${ARGC} EQUAL 2) - IF(BUILD_${_dir}) - ADD_SUBDIRECTORY(${_dir}) - ENDIF(BUILD_${_dir}) - ENDIF(EXISTS ${_fullPath}) -ENDMACRO (MACRO_OPTIONAL_ADD_SUBDIRECTORY) +macro (MACRO_OPTIONAL_ADD_SUBDIRECTORY _dir ) + get_filename_component(_fullPath ${_dir} ABSOLUTE) + if(EXISTS ${_fullPath}) + if(${ARGC} EQUAL 2) + option(BUILD_${_dir} "Build directory ${_dir}" ${ARGV1}) + else(${ARGC} EQUAL 2) + option(BUILD_${_dir} "Build directory ${_dir}" TRUE) + endif(${ARGC} EQUAL 2) + if(BUILD_${_dir}) + add_subdirectory(${_dir}) + endif(BUILD_${_dir}) + endif(EXISTS ${_fullPath}) +endmacro (MACRO_OPTIONAL_ADD_SUBDIRECTORY) |